[NUI][TCSACR-299][Add a new testcase for widget] 03/237103/5
authorSunghyun Kim <scholb.kim@samsung.com>
Thu, 25 Jun 2020 05:20:01 +0000 (14:20 +0900)
committerSunghyun Kim <scholb.kim@samsung.com>
Mon, 6 Jul 2020 09:15:43 +0000 (18:15 +0900)
Add new constructor for creating NUIWidgetApplication.
this constructor can creating NUIWidgetApplication using
Dictionary<Type,string>.
It is for multi-class widget.

Change-Id: I6a0bec077134518176b55107ccf6e32c242d6b90

tct-suite-vs/Tizen.NUI.Tests/testcase/TSNUIWidgetApplication.cs [changed mode: 0755->0644]

old mode 100755 (executable)
new mode 100644 (file)
index 682a5d9..8f117ca
@@ -1,6 +1,7 @@
 using NUnit.Framework;
 using NUnit.Framework.TUnit;
 using System;
+using System.Collections.Generic;
 using Tizen;
 using Tizen.NUI;
 using Tizen.NUI.BaseComponents;
@@ -72,6 +73,47 @@ namespace Tizen.NUI.Tests
 
         [Test]
         [Category("P1")]
+        [Description("NUIWidgetApplication constructor test. Check whether object  which use multi-class created or not.")]
+        [Property("SPEC", "Tizen.NUI.NUIWidgetApplication.NUIWidgetApplication C")]
+        [Property("SPEC_URL", "-")]
+        [Property("CRITERIA", "CONSTR")]
+        [Property("COVPARAM", "Dictionary<System.Type, string>")]
+        [Property("AUTHOR", "Sunghyun kim, scholb.kim@samsung.com")]
+        public void NUIWidgetApplication_INIT_FOR_MULTI_INSTANCE()
+        {
+            /* TEST CODE */
+            Dictionary<Type, string> widgetSet = new Dictionary<Type, string>();
+            widgetSet.Add(typeof(MyWidget), "Tizen.NUI.Tests");
+            var widgetApplication = new NUIWidgetApplication(widgetSet);
+            Assert.IsNotNull(widgetApplication, "NUIWidgetApplication can't create successfully.");
+            Assert.IsInstanceOf<NUIWidgetApplication>(widgetApplication, "Should be an instance of NUIWidgetApplication type.");
+        }
+
+        [Test]
+        [Category("P2")]
+        [Description("Check exception when constructing a NUIWidgetApplication with invalid value.")]
+        [Property("SPEC", "Tizen.NUI.NUIWidgetApplication.NUIWidgetApplication C")]
+        [Property("SPEC_URL", "-")]
+        [Property("CRITERIA", "CONSTR")]
+        [Property("COVPARAM", "Dictionary<System.Type, string>")]
+        [Property("AUTHOR", "Sunghyun kim, scholb.kim@samsung.com")]
+        public void NUIWidgetApplication_INIT_FOR_MULTI_INSTANCE_Exception()
+        {
+            /* TEST CODE */
+            try
+            {
+                Dictionary<Type, string> widgetSet = null;
+                var widgetApplication = new NUIWidgetApplication(widgetSet);
+                Assert.Fail("Should throw the Exception: There is no Dictionary");
+            }
+            catch(InvalidOperationException e)
+            {
+                Assert.Pass("Create a NUIWidgetApplication with invalid Dictionary");
+            }
+        }
+
+        [Test]
+        [Category("P1")]
         [Description("Test Dispose, try to dispose the Widget.")]
         [Property("SPEC", "Tizen.NUI.NUIWidgetApplication.Dispose M")]
         [Property("SPEC_URL", "-")]