[NUI][ACR-119][Update TCT for NUI.] 80/189380/7
authorFeng Jin <feng16.jin@samsung.com>
Fri, 22 Dec 2017 17:40:43 +0000 (01:40 +0800)
committerhuiyu.eun <huiyu.eun@samsung.com>
Mon, 1 Oct 2018 04:44:50 +0000 (13:44 +0900)
Change-Id: I47ab5a3c2945cdcbc1020db999a9daf60e6161ee
Signed-off-by: Feng Jin <feng16.jin@samsung.com>
tct-suite-vs/Tizen.NUI.Tests/testcase/TSNUIWidgetApplication.cs [new file with mode: 0755]
tct-suite-vs/Tizen.NUI.Tests/testcase/TSWidget.cs

diff --git a/tct-suite-vs/Tizen.NUI.Tests/testcase/TSNUIWidgetApplication.cs b/tct-suite-vs/Tizen.NUI.Tests/testcase/TSNUIWidgetApplication.cs
new file mode 100755 (executable)
index 0000000..682a5d9
--- /dev/null
@@ -0,0 +1,97 @@
+using NUnit.Framework;
+using NUnit.Framework.TUnit;
+using System;
+using Tizen;
+using Tizen.NUI;
+using Tizen.NUI.BaseComponents;
+using Tizen.NUI.UIComponents;
+
+namespace Tizen.NUI.Tests
+{
+    public class MyWidget : Widget
+    {
+        protected override void OnCreate(string contentInfo, Window window)
+        {
+            window.BackgroundColor = Color.White;
+            TextLabel textLabel = new TextLabel("Widget Works");
+
+            window.GetDefaultLayer().Add(textLabel);
+            base.OnCreate(contentInfo, window);
+        }
+    }
+
+    [TestFixture]
+    [Description("Tizen.NUI.NUIWidgetApplication Tests")]
+    public class NUIWidgetApplicationTests
+    {
+        private string TAG = "Tizen.NUI.NUIWidgetApplicationTests";
+
+        [SetUp]
+        public void Init()
+        {
+            Tizen.Log.Info(TAG, "#################### Init() is called!");
+        }
+
+        [TearDown]
+        public void Destroy()
+        {
+            Tizen.Log.Info(TAG, "#################### Destroy() is called!");
+        }
+
+        [Test]
+        [Category("P1")]
+        [Description("NUIWidgetApplication constructor test.Check whether object is successfully created or not.")]
+        [Property("SPEC", "Tizen.NUI.NUIWidgetApplication.NUIWidgetApplication C")]
+        [Property("SPEC_URL", "-")]
+        [Property("CRITERIA", "CONSTR")]
+        [Property("COVPARAM", "System.type")]
+        [Property("AUTHOR", "Xianbing Teng, xb.teng@samsung.com")]
+        public void NUIWidgetApplication_INIT()
+        {
+            /* TEST CODE */
+            var widgetApplication = new NUIWidgetApplication(typeof(MyWidget));
+            Assert.IsNotNull(widgetApplication, "NUIWidgetApplication can't create successfully.");
+            Assert.IsInstanceOf<NUIWidgetApplication>(widgetApplication, "Should be an instance of NUIWidgetApplication type.");
+        }
+
+        [Test]
+        [Category("P1")]
+        [Description("NUIWidgetApplication constructor test. Check whether object  which set stylesheet is successfully created or not.")]
+        [Property("SPEC", "Tizen.NUI.NUIWidgetApplication.NUIWidgetApplication C")]
+        [Property("SPEC_URL", "-")]
+        [Property("CRITERIA", "CONSTR")]
+        [Property("COVPARAM", "System.type, string")]
+        [Property("AUTHOR", "Xianbing Teng, xb.teng@partner.samsung.com")]
+        public void NUIWidgetApplication_INIT_WITH_STRING()
+        {
+            /* TEST CODE */
+            var widgetApplication = new NUIWidgetApplication(typeof(MyWidget), "stylesheet");
+            Assert.IsNotNull(widgetApplication, "NUIWidgetApplication can't create successfully.");
+            Assert.IsInstanceOf<NUIWidgetApplication>(widgetApplication, "Should be an instance of NUIWidgetApplication type.");
+        }
+
+        [Test]
+        [Category("P1")]
+        [Description("Test Dispose, try to dispose the Widget.")]
+        [Property("SPEC", "Tizen.NUI.NUIWidgetApplication.Dispose M")]
+        [Property("SPEC_URL", "-")]
+        [Property("CRITERIA", "MR")]
+        [Property("AUTHOR", "Xianbing Teng, xb.teng@partner.samsung.com")]
+        public void Dispose_TEST()
+        {
+            /* TEST CODE */
+            try
+            {
+                NUIWidgetApplication widgetApplication = new NUIWidgetApplication(typeof(MyWidget));
+                Assert.IsNotNull(widgetApplication, "NUIWidgetApplication can't create successfully.");
+                widgetApplication.Dispose();
+            }
+            catch (Exception e)
+            {
+                Tizen.Log.Error(TAG, "Caught Exception" + e.ToString());
+                LogUtils.Write(LogUtils.DEBUG, LogUtils.TAG, "Caught Exception" + e.ToString());
+                Assert.Fail("Caught Exception" + e.ToString());
+            }
+        }
+    }
+}
index 5a7ac4c..614a6dc 100755 (executable)
@@ -12,10 +12,10 @@ namespace Tizen.NUI.Tests
     [Description("Tizen.NUI.Widget Tests")]
     public class WidgetTests
     {
-        private static string TAG = "NUI";
+        private string TAG = "NUI";
 
         [SetUp]
-        public static void Init()
+        public void Init()
         {
             Tizen.Log.Info(TAG, "Init() is called!");
             App.MainTitleChangeText("WidgetTests");
@@ -23,7 +23,7 @@ namespace Tizen.NUI.Tests
         }
 
         [TearDown]
-        public static void Destroy()
+        public void Destroy()
         {
             Tizen.Log.Info(TAG, "Destroy() is called!");
         }
@@ -47,10 +47,33 @@ namespace Tizen.NUI.Tests
 
         [Test]
         [Category("P1")]
+        [Description("Test SetContentInfo, try to set content info for Widget.")]
+        [Property("SPEC", "Tizen.NUI.Widget.SetContentInfo M")]
+        [Property("SPEC_URL", "-")]
+        [Property("CRITERIA", "MR")]
+        [Property("AUTHOR", "Xianbing Teng, xb.teng@partner.samsung.com")]
+        public void SetContentInfo_CHECK_RETURN_VALUE()
+        {
+            /* TEST CODE */
+            try
+            {
+                Widget widget = new Widget();
+                widget.SetContentInfo("Widget");
+            }
+            catch (Exception e)
+            {
+                Tizen.Log.Error(TAG, "Caught Exception" + e.ToString());
+                LogUtils.Write(LogUtils.DEBUG, LogUtils.TAG, "Caught Exception" + e.ToString());
+                Assert.Fail("Caught Exception" + e.ToString());
+            }
+        }
+
+        [Test]
+        [Category("P1")]
         [Description("Test Dispose, try to dispose the Widget.")]
         [Property("SPEC", "Tizen.NUI.Widget.Dispose M")]
         [Property("SPEC_URL", "-")]
-        [Property("CRITERIA", "MR MCST")]
+        [Property("CRITERIA", "MR")]
         [Property("AUTHOR", "Feng Jin, feng16.jin@samsung.com")]
         public void Dispose_CHECK_RETURN_VALUE()
         {