From: Feng Jin Date: Fri, 22 Dec 2017 17:40:43 +0000 (+0800) Subject: [NUI][ACR-119][Update TCT for NUI.] X-Git-Tag: tct5.0_m2~37^2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=refs%2Fchanges%2F80%2F189380%2F7;p=test%2Ftct%2Fcsharp%2Fapi.git [NUI][ACR-119][Update TCT for NUI.] Change-Id: I47ab5a3c2945cdcbc1020db999a9daf60e6161ee Signed-off-by: Feng Jin --- 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 index 000000000..682a5d94b --- /dev/null +++ b/tct-suite-vs/Tizen.NUI.Tests/testcase/TSNUIWidgetApplication.cs @@ -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(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(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()); + } + } + } +} diff --git a/tct-suite-vs/Tizen.NUI.Tests/testcase/TSWidget.cs b/tct-suite-vs/Tizen.NUI.Tests/testcase/TSWidget.cs index 5a7ac4c70..614a6dc5d 100755 --- a/tct-suite-vs/Tizen.NUI.Tests/testcase/TSWidget.cs +++ b/tct-suite-vs/Tizen.NUI.Tests/testcase/TSWidget.cs @@ -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!"); } @@ -45,12 +45,35 @@ namespace Tizen.NUI.Tests Assert.IsInstanceOf(Widget, "Should be an instance of Widget type."); } + [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() {