From 90372df9bf5092f733f233347678d56085ed3a9c Mon Sep 17 00:00:00 2001 From: "guowei.wang" Date: Thu, 10 Jun 2021 11:14:02 +0800 Subject: [PATCH] [NUI] Add Transition(internal & public) TCs. --- .../internal/Transition/TSTransitionItem.cs | 225 ++++++++++++ .../internal/Transition/TSTransitionItemBase.cs | 385 +++++++++++++++++++++ .../internal/Transition/TSTransitionSet.cs | 376 ++++++++++++++++++++ .../internal/Transition/TSTransitionSetSignal.cs | 313 +++++++++++++++++ .../testcase/public/Transition/TSTransition.cs | 92 +++++ .../testcase/public/Transition/TSTransitionBase.cs | 125 +++++++ 6 files changed, 1516 insertions(+) create mode 100755 test/Tizen.NUI.Tests/Tizen.NUI.TCT/testcase/internal/Transition/TSTransitionItem.cs create mode 100755 test/Tizen.NUI.Tests/Tizen.NUI.TCT/testcase/internal/Transition/TSTransitionItemBase.cs create mode 100755 test/Tizen.NUI.Tests/Tizen.NUI.TCT/testcase/internal/Transition/TSTransitionSet.cs create mode 100755 test/Tizen.NUI.Tests/Tizen.NUI.TCT/testcase/internal/Transition/TSTransitionSetSignal.cs create mode 100755 test/Tizen.NUI.Tests/Tizen.NUI.TCT/testcase/public/Transition/TSTransition.cs create mode 100755 test/Tizen.NUI.Tests/Tizen.NUI.TCT/testcase/public/Transition/TSTransitionBase.cs diff --git a/test/Tizen.NUI.Tests/Tizen.NUI.TCT/testcase/internal/Transition/TSTransitionItem.cs b/test/Tizen.NUI.Tests/Tizen.NUI.TCT/testcase/internal/Transition/TSTransitionItem.cs new file mode 100755 index 0000000..adfdd83 --- /dev/null +++ b/test/Tizen.NUI.Tests/Tizen.NUI.TCT/testcase/internal/Transition/TSTransitionItem.cs @@ -0,0 +1,225 @@ +using global::System; +using NUnit.Framework; +using NUnit.Framework.TUnit; +using Tizen.NUI.Components; +using Tizen.NUI.BaseComponents; + +namespace Tizen.NUI.Devel.Tests +{ + using tlog = Tizen.Log; + + [TestFixture] + [Description("Internal/Transition/TransitionItem")] + class TSTransitionItem + { + private const string tag = "NUITEST"; + + [SetUp] + public void Init() + { + tlog.Info(tag, "Init() is called!"); + } + + [TearDown] + public void Destroy() + { + tlog.Info(tag, "Destroy() is called!"); + } + + [Test] + [Category("P1")] + [Description("TransitionItem constructor.")] + [Property("SPEC", "Tizen.NUI.TransitionItem.TransitionItem C")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "CONSTR")] + [Property("AUTHOR", "guowei.wang@samsung.com")] + public void TransitionItemConstructor() + { + tlog.Debug(tag, $"TransitionItemConstructor START"); + + View currentView = new View() + { + Name = "currentPage", + TransitionOptions = new TransitionOptions(Window.Instance) + }; + currentView.TransitionOptions.TransitionTag = "Transition"; + currentView.TransitionOptions.EnableTransition = true; + + View newView = new View() + { + Name = "newPage", + TransitionOptions = new TransitionOptions(Window.Instance) + }; + newView.TransitionOptions.TransitionTag = "Transition"; + newView.TransitionOptions.EnableTransition = true; + + AlphaFunction alphaFunction = new AlphaFunction(AlphaFunction.BuiltinFunctions.Default); + TimePeriod timePeriod = new TimePeriod(500); + + var testingTarget = new TransitionItem(currentView, newView, timePeriod, alphaFunction); + Assert.IsNotNull(testingTarget, "Should be not null!"); + Assert.IsInstanceOf(testingTarget, "Should be an Instance of TransitionItem!"); + + newView.Dispose(); + currentView.Dispose(); + timePeriod.Dispose(); + alphaFunction.Dispose(); + testingTarget.Dispose(); + tlog.Debug(tag, $"TransitionItemConstructor END (OK)"); + } + + [Test] + [Category("P1")] + [Description("TransitionItem ShowSourceAfterFinished.")] + [Property("SPEC", "Tizen.NUI.TransitionItem.ShowSourceAfterFinished A")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "PROW")] + [Property("AUTHOR", "guowei.wang@samsung.com")] + public void TransitionItemShowSourceAfterFinished() + { + tlog.Debug(tag, $"TransitionItemShowSourceAfterFinished START"); + + View currentView = new View() + { + Name = "currentPage", + TransitionOptions = new TransitionOptions(Window.Instance) + }; + currentView.TransitionOptions.TransitionTag = "Transition"; + currentView.TransitionOptions.EnableTransition = true; + + View newView = new View() + { + Name = "newPage", + TransitionOptions = new TransitionOptions(Window.Instance) + }; + newView.TransitionOptions.TransitionTag = "Transition"; + newView.TransitionOptions.EnableTransition = true; + + AlphaFunction alphaFunction = new AlphaFunction(AlphaFunction.BuiltinFunctions.Default); + TimePeriod timePeriod = new TimePeriod(500); + + var testingTarget = new TransitionItem(currentView, newView, timePeriod, alphaFunction); + Assert.IsNotNull(testingTarget, "Should be not null!"); + Assert.IsInstanceOf(testingTarget, "Should be an Instance of TransitionItem!"); + + try + { + testingTarget.ShowSourceAfterFinished = true; + } + catch (Exception e) + { + tlog.Error(tag, "Caught Exception" + e.ToString()); + LogUtils.Write(LogUtils.DEBUG, LogUtils.TAG, "Caught Exception" + e.ToString()); + Assert.Fail("Caught Exception" + e.ToString()); + } + + newView.Dispose(); + currentView.Dispose(); + timePeriod.Dispose(); + alphaFunction.Dispose(); + testingTarget.Dispose(); + tlog.Debug(tag, $"TransitionItemShowSourceAfterFinished END (OK)"); + } + + [Test] + [Category("P1")] + [Description("TransitionItem Assign.")] + [Property("SPEC", "Tizen.NUI.TransitionItem.Assign M")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "MR")] + [Property("AUTHOR", "guowei.wang@samsung.com")] + public void TransitionItemAssign() + { + tlog.Debug(tag, $"TransitionItemAssign START"); + + View currentView = new View() + { + Name = "currentPage", + TransitionOptions = new TransitionOptions(Window.Instance) + }; + currentView.TransitionOptions.TransitionTag = "Transition"; + currentView.TransitionOptions.EnableTransition = true; + + View newView = new View() + { + Name = "newPage", + TransitionOptions = new TransitionOptions(Window.Instance) + }; + newView.TransitionOptions.TransitionTag = "Transition"; + newView.TransitionOptions.EnableTransition = true; + + AlphaFunction alphaFunction = new AlphaFunction(AlphaFunction.BuiltinFunctions.Default); + TimePeriod timePeriod = new TimePeriod(500); + + var testingTarget = new TransitionItem(currentView, newView, timePeriod, alphaFunction); + Assert.IsNotNull(testingTarget, "Should be not null!"); + Assert.IsInstanceOf(testingTarget, "Should be an Instance of TransitionItem!"); + + using (TransitionItem rhs = new TransitionItem(testingTarget)) + { + var result = testingTarget.Assign(rhs); + Assert.IsNotNull(result, "Should be not null!"); + Assert.IsInstanceOf(result, "Should be an Instance of TransitionItem!"); + } + + currentView?.Dispose(); + newView?.Dispose(); + timePeriod?.Dispose(); + alphaFunction?.Dispose(); + testingTarget?.Dispose(); + tlog.Debug(tag, $"TransitionItemAssign END (OK)"); + } + + [Test] + [Category("P1")] + [Description("TransitionItem Dispose.")] + [Property("SPEC", "Tizen.NUI.TransitionItem.Dispose M")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "MR")] + [Property("AUTHOR", "guowei.wang@samsung.com")] + public void TransitionItemDispose() + { + tlog.Debug(tag, $"TransitionItemDispose START"); + + View currentView = new View() + { + Name = "currentPage", + TransitionOptions = new TransitionOptions(Window.Instance) + }; + currentView.TransitionOptions.TransitionTag = "Transition"; + currentView.TransitionOptions.EnableTransition = true; + + View newView = new View() + { + Name = "newPage", + TransitionOptions = new TransitionOptions(Window.Instance) + }; + newView.TransitionOptions.TransitionTag = "Transition"; + newView.TransitionOptions.EnableTransition = true; + + AlphaFunction alphaFunction = new AlphaFunction(AlphaFunction.BuiltinFunctions.Default); + TimePeriod timePeriod = new TimePeriod(500); + + var testingTarget = new TransitionItem(currentView, newView, timePeriod, alphaFunction); + Assert.IsNotNull(testingTarget, "Should be not null!"); + Assert.IsInstanceOf(testingTarget, "Should be an Instance of TransitionItem!"); + + try + { + testingTarget.Dispose(); + } + catch (Exception e) + { + tlog.Error(tag, "Caught Exception" + e.ToString()); + LogUtils.Write(LogUtils.DEBUG, LogUtils.TAG, "Caught Exception" + e.ToString()); + Assert.Fail("Caught Exception" + e.ToString()); + } + + currentView?.Dispose(); + newView?.Dispose(); + timePeriod?.Dispose(); + alphaFunction?.Dispose(); + tlog.Debug(tag, $"TransitionItemDispose END (OK)"); + } + } +} diff --git a/test/Tizen.NUI.Tests/Tizen.NUI.TCT/testcase/internal/Transition/TSTransitionItemBase.cs b/test/Tizen.NUI.Tests/Tizen.NUI.TCT/testcase/internal/Transition/TSTransitionItemBase.cs new file mode 100755 index 0000000..17f1099 --- /dev/null +++ b/test/Tizen.NUI.Tests/Tizen.NUI.TCT/testcase/internal/Transition/TSTransitionItemBase.cs @@ -0,0 +1,385 @@ +using global::System; +using NUnit.Framework; +using NUnit.Framework.TUnit; +using Tizen.NUI.Components; +using Tizen.NUI.BaseComponents; + +namespace Tizen.NUI.Devel.Tests +{ + using tlog = Tizen.Log; + + [TestFixture] + [Description("Internal/Transition/TransitionItemBase")] + class TSTransitionItemBase + { + private const string tag = "NUITEST"; + + [SetUp] + public void Init() + { + tlog.Info(tag, "Init() is called!"); + } + + [TearDown] + public void Destroy() + { + tlog.Info(tag, "Destroy() is called!"); + } + + [Test] + [Category("P1")] + [Description("TransitionItemBase constructor.")] + [Property("SPEC", "Tizen.NUI.TransitionItemBase.TransitionItemBase C")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "CONSTR")] + [Property("AUTHOR", "guowei.wang@samsung.com")] + public void TransitionItemBaseConstructor() + { + tlog.Debug(tag, $"TransitionItemBaseConstructor START"); + + View view = new View() + { + Name = "view", + TransitionOptions = new TransitionOptions(Window.Instance) + }; + view.TransitionOptions.TransitionTag = "Transition"; + view.TransitionOptions.EnableTransition = true; + + TransitionItemBase testingTarget = null; + using (TimePeriod timePeriod = new TimePeriod(500)) + { + using (AlphaFunction alphaFunction = new AlphaFunction(AlphaFunction.BuiltinFunctions.Default)) + { + testingTarget = new TransitionItemBase(view, true, timePeriod, alphaFunction); + } + } + + view.Dispose(); + testingTarget.Dispose(); + tlog.Debug(tag, $"TransitionItemBaseConstructor END (OK)"); + } + + [Test] + [Category("P1")] + [Description("TransitionItemBase Duration.")] + [Property("SPEC", "Tizen.NUI.TransitionItemBase.Duration A")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "PRW")] + [Property("AUTHOR", "guowei.wang@samsung.com")] + public void TransitionItemBaseDuration() + { + tlog.Debug(tag, $"TransitionItemBaseDuration START"); + + View view = new View() + { + Name = "view", + TransitionOptions = new TransitionOptions(Window.Instance) + }; + view.TransitionOptions.TransitionTag = "Transition"; + view.TransitionOptions.EnableTransition = true; + + TransitionItemBase testingTarget = null; + using (TimePeriod timePeriod = new TimePeriod(500)) + { + using (AlphaFunction alphaFunction = new AlphaFunction(AlphaFunction.BuiltinFunctions.Default)) + { + testingTarget = new TransitionItemBase(view, true, timePeriod, alphaFunction); + } + } + + testingTarget.Duration = 300; + Assert.IsTrue(300 == testingTarget.Duration); + + view.Dispose(); + testingTarget.Dispose(); + tlog.Debug(tag, $"TransitionItemBaseDuration END (OK)"); + } + + [Test] + [Category("P1")] + [Description("TransitionItemBase Delay.")] + [Property("SPEC", "Tizen.NUI.TransitionItemBase.Delay A")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "PRW")] + [Property("AUTHOR", "guowei.wang@samsung.com")] + public void TransitionItemBaseDelay() + { + tlog.Debug(tag, $"TransitionItemBaseDelay START"); + + View view = new View() + { + Name = "view", + TransitionOptions = new TransitionOptions(Window.Instance) + }; + view.TransitionOptions.TransitionTag = "Transition"; + view.TransitionOptions.EnableTransition = true; + + TransitionItemBase testingTarget = null; + using (TimePeriod timePeriod = new TimePeriod(500)) + { + using (AlphaFunction alphaFunction = new AlphaFunction(AlphaFunction.BuiltinFunctions.Default)) + { + testingTarget = new TransitionItemBase(view, true, timePeriod, alphaFunction); + } + } + + testingTarget.Delay = 300; + Assert.IsTrue(300 == testingTarget.Delay); + + view.Dispose(); + testingTarget.Dispose(); + tlog.Debug(tag, $"TransitionItemBaseDelay END (OK)"); + } + + [Test] + [Category("P1")] + [Description("TransitionItemBase TimePeriod.")] + [Property("SPEC", "Tizen.NUI.TransitionItemBase.TimePeriod A")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "PW")] + [Property("AUTHOR", "guowei.wang@samsung.com")] + public void TransitionItemBaseTimePeriod() + { + tlog.Debug(tag, $"TransitionItemBaseTimePeriod START"); + + View view = new View() + { + Name = "view", + TransitionOptions = new TransitionOptions(Window.Instance) + }; + view.TransitionOptions.TransitionTag = "Transition"; + view.TransitionOptions.EnableTransition = true; + + TransitionItemBase testingTarget = null; + using (TimePeriod timePeriod = new TimePeriod(500)) + { + using (AlphaFunction alphaFunction = new AlphaFunction(AlphaFunction.BuiltinFunctions.Default)) + { + testingTarget = new TransitionItemBase(view, true, timePeriod, alphaFunction); + } + } + + try + { + using (TimePeriod setValue = new TimePeriod(300)) + { + testingTarget.TimePeriod = setValue; + } + } + catch (Exception e) + { + tlog.Error(tag, "Caught Exception" + e.ToString()); + LogUtils.Write(LogUtils.DEBUG, LogUtils.TAG, "Caught Exception" + e.ToString()); + Assert.Fail("Caught Exception" + e.ToString()); + } + + view.Dispose(); + testingTarget.Dispose(); + tlog.Debug(tag, $"TransitionItemBaseTimePeriod END (OK)"); + } + + [Test] + [Category("P1")] + [Description("TransitionItemBase AlphaFunction.")] + [Property("SPEC", "Tizen.NUI.TransitionItemBase.AlphaFunction A")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "PRW")] + [Property("AUTHOR", "guowei.wang@samsung.com")] + public void TransitionItemBaseAlphaFunction() + { + tlog.Debug(tag, $"TransitionItemBaseAlphaFunction START"); + + View view = new View() + { + Name = "view", + TransitionOptions = new TransitionOptions(Window.Instance) + }; + view.TransitionOptions.TransitionTag = "Transition"; + view.TransitionOptions.EnableTransition = true; + + TransitionItemBase testingTarget = null; + using (TimePeriod timePeriod = new TimePeriod(500)) + { + using (AlphaFunction alphaFunction = new AlphaFunction(AlphaFunction.BuiltinFunctions.Default)) + { + testingTarget = new TransitionItemBase(view, true, timePeriod, alphaFunction); + } + } + + using (AlphaFunction setValue = new AlphaFunction(AlphaFunction.BuiltinFunctions.EaseOut)) + { + testingTarget.AlphaFunction = setValue; + var result = testingTarget.AlphaFunction; + Assert.IsTrue(result.GetBuiltinFunction() == AlphaFunction.BuiltinFunctions.EaseOut); + } + + view.Dispose(); + testingTarget.Dispose(); + tlog.Debug(tag, $"TransitionItemBaseAlphaFunction END (OK)"); + } + + [Test] + [Category("P1")] + [Description("TransitionItemBase TransitionWithChild.")] + [Property("SPEC", "Tizen.NUI.TransitionItemBase.TransitionWithChild A")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "PW")] + [Property("AUTHOR", "guowei.wang@samsung.com")] + public void TransitionItemBaseTransitionWithChild() + { + tlog.Debug(tag, $"TransitionItemBaseTransitionWithChild START"); + + View view = new View() + { + Name = "view", + TransitionOptions = new TransitionOptions(Window.Instance) + }; + view.TransitionOptions.TransitionTag = "Transition"; + view.TransitionOptions.EnableTransition = true; + + TransitionItemBase testingTarget = null; + using (TimePeriod timePeriod = new TimePeriod(500)) + { + using (AlphaFunction alphaFunction = new AlphaFunction(AlphaFunction.BuiltinFunctions.Default)) + { + testingTarget = new TransitionItemBase(view, true, timePeriod, alphaFunction); + } + } + + try + { + testingTarget.TransitionWithChild = true; + } + catch (Exception e) + { + tlog.Error(tag, "Caught Exception" + e.ToString()); + LogUtils.Write(LogUtils.DEBUG, LogUtils.TAG, "Caught Exception" + e.ToString()); + Assert.Fail("Caught Exception" + e.ToString()); + } + + view.Dispose(); + testingTarget.Dispose(); + tlog.Debug(tag, $"TransitionItemBaseTransitionWithChild END (OK)"); + } + + [Test] + [Category("P1")] + [Description("TransitionItemBase DownCast.")] + [Property("SPEC", "Tizen.NUI.TransitionItemBase.DownCast M")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "MR")] + [Property("AUTHOR", "guowei.wang@samsung.com")] + public void TransitionItemBaseDownCast() + { + tlog.Debug(tag, $"TransitionItemBaseDownCast START"); + + View view = new View() + { + Name = "view", + TransitionOptions = new TransitionOptions(Window.Instance) + }; + view.TransitionOptions.TransitionTag = "Transition"; + view.TransitionOptions.EnableTransition = true; + + TransitionItemBase testingTarget = null; + using (TimePeriod timePeriod = new TimePeriod(500)) + { + using (AlphaFunction alphaFunction = new AlphaFunction(AlphaFunction.BuiltinFunctions.Default)) + { + testingTarget = new TransitionItemBase(view, true, timePeriod, alphaFunction); + } + } + + var result = TransitionItemBase.DownCast(testingTarget); + Assert.IsNotNull(result, "Should be not null!"); + Assert.IsInstanceOf(result, "Should be an Instance of TransitionItemBase!"); + + view.Dispose(); + testingTarget.Dispose(); + tlog.Debug(tag, $"TransitionItemBaseDownCast END (OK)"); + } + + [Test] + [Category("P1")] + [Description("TransitionItemBase Assign.")] + [Property("SPEC", "Tizen.NUI.TransitionItemBase.Assign M")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "MR")] + [Property("AUTHOR", "guowei.wang@samsung.com")] + public void TransitionItemBaseAssign() + { + tlog.Debug(tag, $"TransitionItemBaseAssign START"); + + View view = new View() + { + Name = "view", + TransitionOptions = new TransitionOptions(Window.Instance) + }; + view.TransitionOptions.TransitionTag = "Transition"; + view.TransitionOptions.EnableTransition = true; + + TransitionItemBase testingTarget = null; + using (TimePeriod timePeriod = new TimePeriod(500)) + { + using (AlphaFunction alphaFunction = new AlphaFunction(AlphaFunction.BuiltinFunctions.Default)) + { + testingTarget = new TransitionItemBase(view, true, timePeriod, alphaFunction); + } + } + + using (TransitionItemBase rhs = new TransitionItemBase(testingTarget)) + { + var result = testingTarget.Assign(rhs); + Assert.IsNotNull(result, "Should be not null!"); + Assert.IsInstanceOf(result, "Should be an Instance of TransitionItemBase!"); + } + + view.Dispose(); + testingTarget.Dispose(); + tlog.Debug(tag, $"TransitionItemBaseAssign END (OK)"); + } + + [Test] + [Category("P1")] + [Description("TransitionItemBase Dispose.")] + [Property("SPEC", "Tizen.NUI.TransitionItemBase.Dispose M")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "MR")] + [Property("AUTHOR", "guowei.wang@samsung.com")] + public void TransitionItemBaseDispose() + { + tlog.Debug(tag, $"TransitionItemBaseDispose START"); + + View view = new View() + { + Name = "view", + TransitionOptions = new TransitionOptions(Window.Instance) + }; + view.TransitionOptions.TransitionTag = "Transition"; + view.TransitionOptions.EnableTransition = true; + + TransitionItemBase testingTarget = null; + using (TimePeriod timePeriod = new TimePeriod(500)) + { + using (AlphaFunction alphaFunction = new AlphaFunction(AlphaFunction.BuiltinFunctions.Default)) + { + testingTarget = new TransitionItemBase(view, true, timePeriod, alphaFunction); + } + } + + try + { + testingTarget.Dispose(); + } + catch (Exception e) + { + tlog.Error(tag, "Caught Exception" + e.ToString()); + LogUtils.Write(LogUtils.DEBUG, LogUtils.TAG, "Caught Exception" + e.ToString()); + Assert.Fail("Caught Exception" + e.ToString()); + } + + view?.Dispose(); + tlog.Debug(tag, $"TransitionItemBaseDispose END (OK)"); + } + } +} diff --git a/test/Tizen.NUI.Tests/Tizen.NUI.TCT/testcase/internal/Transition/TSTransitionSet.cs b/test/Tizen.NUI.Tests/Tizen.NUI.TCT/testcase/internal/Transition/TSTransitionSet.cs new file mode 100755 index 0000000..fa2ced5 --- /dev/null +++ b/test/Tizen.NUI.Tests/Tizen.NUI.TCT/testcase/internal/Transition/TSTransitionSet.cs @@ -0,0 +1,376 @@ +using global::System; +using NUnit.Framework; +using NUnit.Framework.TUnit; +using Tizen.NUI.Components; +using Tizen.NUI.BaseComponents; + +namespace Tizen.NUI.Devel.Tests +{ + using tlog = Tizen.Log; + + [TestFixture] + [Description("Internal/Transition/TransitionSet")] + class TSTransitionSet + { + private const string tag = "NUITEST"; + + [SetUp] + public void Init() + { + tlog.Info(tag, "Init() is called!"); + } + + [TearDown] + public void Destroy() + { + tlog.Info(tag, "Destroy() is called!"); + } + + [Test] + [Category("P1")] + [Description("TransitionSet constructor.")] + [Property("SPEC", "Tizen.NUI.TransitionSet.TransitionSet C")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "CONSTR")] + [Property("AUTHOR", "guowei.wang@samsung.com")] + public void TransitionSetConstructor() + { + tlog.Debug(tag, $"TransitionSetConstructor START"); + + var testingTarget = new TransitionSet(); + Assert.IsNotNull(testingTarget, "Should be not null!"); + Assert.IsInstanceOf(testingTarget, "Should be an Instance of TransitionSet!"); + + testingTarget.Dispose(); + tlog.Debug(tag, $"TransitionSetConstructor END (OK)"); + } + + [Test] + [Category("P1")] + [Description("TransitionSet DownCast.")] + [Property("SPEC", "Tizen.NUI.TransitionSet.DownCast M")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "MR")] + [Property("AUTHOR", "guowei.wang@samsung.com")] + public void TransitionSetDownCast() + { + tlog.Debug(tag, $"TransitionSetDownCast START"); + + using (TransitionSet transitionSet = new TransitionSet()) + { + var testingTarget = TransitionSet.DownCast(transitionSet); + Assert.IsNotNull(testingTarget, "Should be not null!"); + Assert.IsInstanceOf(testingTarget, "Should be an Instance of TransitionSet!"); + + testingTarget.Dispose(); + } + + tlog.Debug(tag, $"TransitionSetDownCast END (OK)"); + } + + [Test] + [Category("P1")] + [Description("TransitionSet AddTransition.")] + [Property("SPEC", "Tizen.NUI.TransitionSet.AddTransition M")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "MR")] + [Property("AUTHOR", "guowei.wang@samsung.com")] + public void TransitionSetAddTransition() + { + tlog.Debug(tag, $"TransitionSetAddTransition START"); + + View view = new View() + { + Name = "view", + TransitionOptions = new TransitionOptions(Window.Instance) + }; + view.TransitionOptions.TransitionTag = "Transition"; + view.TransitionOptions.EnableTransition = true; + + TransitionItemBase transitionItemBase = null; + using (TimePeriod timePeriod = new TimePeriod(500)) + { + using (AlphaFunction alphaFunction = new AlphaFunction(AlphaFunction.BuiltinFunctions.Default)) + { + transitionItemBase = new TransitionItemBase(view, true, timePeriod, alphaFunction); + } + } + + var testingTarget = new TransitionSet(); + Assert.IsNotNull(testingTarget, "Should be not null!"); + Assert.IsInstanceOf(testingTarget, "Should be an Instance of TransitionSet!"); + + try + { + testingTarget.AddTransition(transitionItemBase); + } + catch (Exception e) + { + tlog.Error(tag, "Caught Exception" + e.ToString()); + LogUtils.Write(LogUtils.DEBUG, LogUtils.TAG, "Caught Exception" + e.ToString()); + Assert.Fail("Caught Exception" + e.ToString()); + } + + view.Dispose(); + transitionItemBase.Dispose(); + testingTarget.Dispose(); + tlog.Debug(tag, $"TransitionSetAddTransition END (OK)"); + } + + [Test] + [Category("P1")] + [Description("TransitionSet GetTransitionAt.")] + [Property("SPEC", "Tizen.NUI.TransitionSet.GetTransitionAt M")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "MR")] + [Property("AUTHOR", "guowei.wang@samsung.com")] + public void TransitionSetGetTransitionAt() + { + tlog.Debug(tag, $"TransitionSetGetTransitionAt START"); + + View view = new View() + { + Name = "view", + TransitionOptions = new TransitionOptions(Window.Instance) + }; + view.TransitionOptions.TransitionTag = "Transition"; + view.TransitionOptions.EnableTransition = true; + + TransitionItemBase transitionItemBase = null; + using (TimePeriod timePeriod = new TimePeriod(500)) + { + using (AlphaFunction alphaFunction = new AlphaFunction(AlphaFunction.BuiltinFunctions.Default)) + { + transitionItemBase = new TransitionItemBase(view, true, timePeriod, alphaFunction); + } + } + + var testingTarget = new TransitionSet(); + Assert.IsNotNull(testingTarget, "Should be not null!"); + Assert.IsInstanceOf(testingTarget, "Should be an Instance of TransitionSet!"); + + testingTarget.AddTransition(transitionItemBase); + + var result = testingTarget.GetTransitionAt(1); + Assert.IsNotNull(result, "Should be not null!"); + Assert.IsInstanceOf(result, "Should be an Instance of TransitionItemBase!"); + + view.Dispose(); + transitionItemBase.Dispose(); + testingTarget.Dispose(); + tlog.Debug(tag, $"TransitionSetGetTransitionAt END (OK)"); + } + + [Test] + [Category("P1")] + [Description("TransitionSet GetTransitionCount.")] + [Property("SPEC", "Tizen.NUI.TransitionSet.GetTransitionCount M")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "MR")] + [Property("AUTHOR", "guowei.wang@samsung.com")] + public void TransitionSetGetTransitionCount() + { + tlog.Debug(tag, $"TransitionSetGetTransitionCount START"); + + View view = new View() + { + Name = "view", + TransitionOptions = new TransitionOptions(Window.Instance) + }; + view.TransitionOptions.TransitionTag = "Transition"; + view.TransitionOptions.EnableTransition = true; + + TransitionItemBase transitionItemBase = null; + using (TimePeriod timePeriod = new TimePeriod(500)) + { + using (AlphaFunction alphaFunction = new AlphaFunction(AlphaFunction.BuiltinFunctions.Default)) + { + transitionItemBase = new TransitionItemBase(view, true, timePeriod, alphaFunction); + } + } + + var testingTarget = new TransitionSet(); + Assert.IsNotNull(testingTarget, "Should be not null!"); + Assert.IsInstanceOf(testingTarget, "Should be an Instance of TransitionSet!"); + + testingTarget.AddTransition(transitionItemBase); + + var result = testingTarget.GetTransitionCount(); + Assert.IsTrue(1 == result); + + view.Dispose(); + transitionItemBase.Dispose(); + testingTarget.Dispose(); + tlog.Debug(tag, $"TransitionSetGetTransitionCount END (OK)"); + } + + [Test] + [Category("P1")] + [Description("TransitionSet Play.")] + [Property("SPEC", "Tizen.NUI.TransitionSet.Play M")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "MR")] + [Property("AUTHOR", "guowei.wang@samsung.com")] + public void TransitionSetPlay() + { + tlog.Debug(tag, $"TransitionSetPlay START"); + + View view = new View() + { + Name = "view", + TransitionOptions = new TransitionOptions(Window.Instance) + }; + view.TransitionOptions.TransitionTag = "Transition"; + view.TransitionOptions.EnableTransition = true; + + TransitionItemBase transitionItemBase = null; + using (TimePeriod timePeriod = new TimePeriod(500)) + { + using (AlphaFunction alphaFunction = new AlphaFunction(AlphaFunction.BuiltinFunctions.Default)) + { + transitionItemBase = new TransitionItemBase(view, true, timePeriod, alphaFunction); + } + } + + var testingTarget = new TransitionSet(); + Assert.IsNotNull(testingTarget, "Should be not null!"); + Assert.IsInstanceOf(testingTarget, "Should be an Instance of TransitionSet!"); + + testingTarget.AddTransition(transitionItemBase); + + try + { + testingTarget.Play(); + } + catch (Exception e) + { + tlog.Error(tag, "Caught Exception" + e.ToString()); + LogUtils.Write(LogUtils.DEBUG, LogUtils.TAG, "Caught Exception" + e.ToString()); + Assert.Fail("Caught Exception" + e.ToString()); + } + + view.Dispose(); + transitionItemBase.Dispose(); + testingTarget.Dispose(); + tlog.Debug(tag, $"TransitionSetPlay END (OK)"); + } + + [Test] + [Category("P1")] + [Description("TransitionSet Assign.")] + [Property("SPEC", "Tizen.NUI.TransitionSet.Assign M")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "MR")] + [Property("AUTHOR", "guowei.wang@samsung.com")] + public void TransitionSetAssign() + { + tlog.Debug(tag, $"TransitionSetAssign START"); + + View view = new View() + { + Name = "view", + TransitionOptions = new TransitionOptions(Window.Instance) + }; + view.TransitionOptions.TransitionTag = "Transition"; + view.TransitionOptions.EnableTransition = true; + + TransitionItemBase transitionItemBase = null; + using (TimePeriod timePeriod = new TimePeriod(500)) + { + using (AlphaFunction alphaFunction = new AlphaFunction(AlphaFunction.BuiltinFunctions.Default)) + { + transitionItemBase = new TransitionItemBase(view, true, timePeriod, alphaFunction); + } + } + + var transitionSet = new TransitionSet(); + Assert.IsNotNull(transitionSet, "Should be not null!"); + Assert.IsInstanceOf(transitionSet, "Should be an Instance of TransitionSet!"); + + transitionSet.AddTransition(transitionItemBase); + + var testingTarget = new TransitionSet(); + var result = transitionSet.Assign(testingTarget); + Assert.IsNotNull(result, "Should be not null!"); + Assert.IsInstanceOf(result, "Should be an Instance of TransitionSet!"); + + view.Dispose(); + transitionItemBase.Dispose(); + testingTarget.Dispose(); + tlog.Debug(tag, $"TransitionSetAssign END (OK)"); + } + + [Test] + [Category("P1")] + [Description("TransitionSet FinishedSignal.")] + [Property("SPEC", "Tizen.NUI.TransitionSet.FinishedSignal M")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "MR")] + [Property("AUTHOR", "guowei.wang@samsung.com")] + public void TransitionSetFinishedSignal() + { + tlog.Debug(tag, $"TransitionSetFinishedSignal START"); + + View view = new View() + { + Name = "view", + TransitionOptions = new TransitionOptions(Window.Instance) + }; + view.TransitionOptions.TransitionTag = "Transition"; + view.TransitionOptions.EnableTransition = true; + + TransitionItemBase transitionItemBase = null; + using (TimePeriod timePeriod = new TimePeriod(500)) + { + using (AlphaFunction alphaFunction = new AlphaFunction(AlphaFunction.BuiltinFunctions.Default)) + { + transitionItemBase = new TransitionItemBase(view, true, timePeriod, alphaFunction); + } + } + + var transitionSet = new TransitionSet(); + Assert.IsNotNull(transitionSet, "Should be not null!"); + Assert.IsInstanceOf(transitionSet, "Should be an Instance of TransitionSet!"); + + transitionSet.AddTransition(transitionItemBase); + + var testingTarget = transitionSet.FinishedSignal(); + Assert.IsNotNull(testingTarget, "Should be not null!"); + Assert.IsInstanceOf(testingTarget, "Should be an Instance of TransitionSet!"); + + view.Dispose(); + transitionItemBase.Dispose(); + tlog.Debug(tag, $"TransitionSetFinishedSignal END (OK)"); + } + + + [Test] + [Category("P1")] + [Description("TransitionSet Dispose.")] + [Property("SPEC", "Tizen.NUI.TransitionSet.Dispose M")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "MR")] + [Property("AUTHOR", "guowei.wang@samsung.com")] + public void TransitionSetDispose() + { + tlog.Debug(tag, $"TransitionSetDispose START"); + + var testingTarget = new TransitionSet(); + Assert.IsNotNull(testingTarget, "Should be not null!"); + Assert.IsInstanceOf(testingTarget, "Should be an Instance of TransitionSet!"); + + try + { + testingTarget.Dispose(); + } + catch (Exception e) + { + tlog.Error(tag, "Caught Exception" + e.ToString()); + LogUtils.Write(LogUtils.DEBUG, LogUtils.TAG, "Caught Exception" + e.ToString()); + Assert.Fail("Caught Exception" + e.ToString()); + } + + tlog.Debug(tag, $"TransitionSetDispose END (OK)"); + } + } +} diff --git a/test/Tizen.NUI.Tests/Tizen.NUI.TCT/testcase/internal/Transition/TSTransitionSetSignal.cs b/test/Tizen.NUI.Tests/Tizen.NUI.TCT/testcase/internal/Transition/TSTransitionSetSignal.cs new file mode 100755 index 0000000..ee164cb --- /dev/null +++ b/test/Tizen.NUI.Tests/Tizen.NUI.TCT/testcase/internal/Transition/TSTransitionSetSignal.cs @@ -0,0 +1,313 @@ +using global::System; +using NUnit.Framework; +using NUnit.Framework.TUnit; +using Tizen.NUI.Components; +using Tizen.NUI.BaseComponents; + +namespace Tizen.NUI.Devel.Tests +{ + using tlog = Tizen.Log; + + [TestFixture] + [Description("Internal/Transition/TransitionSetSignal")] + class TSTransitionSetSignal + { + private const string tag = "NUITEST"; + private global::System.IntPtr OnIntPtrCallback; + private delegate bool dummyCallback(IntPtr transitionSet); + private bool OnDummyCallback(IntPtr data) + { + return false; + } + + [SetUp] + public void Init() + { + tlog.Info(tag, "Init() is called!"); + } + + [TearDown] + public void Destroy() + { + tlog.Info(tag, "Destroy() is called!"); + } + + [Test] + [Category("P1")] + [Description("TransitionSetSignal Empty.")] + [Property("SPEC", "Tizen.NUI.TransitionSetSignal.Empty M")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "MR")] + [Property("AUTHOR", "guowei.wang@samsung.com")] + public void TransitionSetSignalEmpty() + { + tlog.Debug(tag, $"TransitionSetSignalEmpty START"); + + View view = new View() + { + Name = "view", + TransitionOptions = new TransitionOptions(Window.Instance) + }; + view.TransitionOptions.TransitionTag = "Transition"; + view.TransitionOptions.EnableTransition = true; + + TransitionItemBase transitionItemBase = null; + using (TimePeriod timePeriod = new TimePeriod(500)) + { + using (AlphaFunction alphaFunction = new AlphaFunction(AlphaFunction.BuiltinFunctions.Default)) + { + transitionItemBase = new TransitionItemBase(view, true, timePeriod, alphaFunction); + } + } + + var testingTarget = new TransitionSet(); + Assert.IsNotNull(testingTarget, "Should be not null!"); + Assert.IsInstanceOf(testingTarget, "Should be an Instance of TransitionSet!"); + + testingTarget.AddTransition(transitionItemBase); + + var transitionSetSignal = testingTarget.FinishedSignal(); + Assert.IsNotNull(transitionSetSignal, "Should be not null!"); + Assert.IsInstanceOf(transitionSetSignal, "Should be an Instance of TransitionSet!"); + + var result = transitionSetSignal.Empty(); + Assert.IsTrue(result); + + view.Dispose(); + testingTarget.Dispose(); + tlog.Debug(tag, $"TransitionSetSignalEmpty END (OK)"); + } + + [Test] + [Category("P1")] + [Description("TransitionSetSignal GetConnectionCount.")] + [Property("SPEC", "Tizen.NUI.TransitionSetSignal.GetConnectionCount M")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "MR")] + [Property("AUTHOR", "guowei.wang@samsung.com")] + public void TransitionSetSignalGetConnectionCount() + { + tlog.Debug(tag, $"TransitionSetSignalGetConnectionCount START"); + + View view = new View() + { + Name = "view", + TransitionOptions = new TransitionOptions(Window.Instance) + }; + view.TransitionOptions.TransitionTag = "Transition"; + view.TransitionOptions.EnableTransition = true; + + TransitionItemBase transitionItemBase = null; + using (TimePeriod timePeriod = new TimePeriod(500)) + { + using (AlphaFunction alphaFunction = new AlphaFunction(AlphaFunction.BuiltinFunctions.Default)) + { + transitionItemBase = new TransitionItemBase(view, true, timePeriod, alphaFunction); + } + } + + var testingTarget = new TransitionSet(); + Assert.IsNotNull(testingTarget, "Should be not null!"); + Assert.IsInstanceOf(testingTarget, "Should be an Instance of TransitionSet!"); + + testingTarget.AddTransition(transitionItemBase); + + var transitionSetSignal = testingTarget.FinishedSignal(); + Assert.IsNotNull(transitionSetSignal, "Should be not null!"); + Assert.IsInstanceOf(transitionSetSignal, "Should be an Instance of TransitionSet!"); + + var result = transitionSetSignal.GetConnectionCount(); + Assert.IsTrue(0 == result); + + view.Dispose(); + testingTarget.Dispose(); + tlog.Debug(tag, $"TransitionSetSignalGetConnectionCount END (OK)"); + } + + [Test] + [Category("P1")] + [Description("TransitionSetSignal Connect.")] + [Property("SPEC", "Tizen.NUI.TransitionSetSignal.Connect M")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "MR")] + [Property("AUTHOR", "guowei.wang@samsung.com")] + public void TransitionSetSignalConnect() + { + tlog.Debug(tag, $"TransitionSetSignalConnect START"); + + View view = new View() + { + Name = "view", + TransitionOptions = new TransitionOptions(Window.Instance) + }; + view.TransitionOptions.TransitionTag = "Transition"; + view.TransitionOptions.EnableTransition = true; + + TransitionItemBase transitionItemBase = null; + using (TimePeriod timePeriod = new TimePeriod(500)) + { + using (AlphaFunction alphaFunction = new AlphaFunction(AlphaFunction.BuiltinFunctions.Default)) + { + transitionItemBase = new TransitionItemBase(view, true, timePeriod, alphaFunction); + } + } + + var testingTarget = new TransitionSet(); + Assert.IsNotNull(testingTarget, "Should be not null!"); + Assert.IsInstanceOf(testingTarget, "Should be an Instance of TransitionSet!"); + + testingTarget.AddTransition(transitionItemBase); + + var transitionSetSignal = testingTarget.FinishedSignal(); + Assert.IsNotNull(transitionSetSignal, "Should be not null!"); + Assert.IsInstanceOf(transitionSetSignal, "Should be an Instance of TransitionSet!"); + + dummyCallback callback = OnDummyCallback; + transitionSetSignal.Connect(callback); + transitionSetSignal.Disconnect(callback); + + view.Dispose(); + testingTarget.Dispose(); + tlog.Debug(tag, $"TransitionSetSignalConnect END (OK)"); + } + + [Test] + [Category("P1")] + [Description("TransitionSetSignal Connect. With IntPtr")] + [Property("SPEC", "Tizen.NUI.TransitionSetSignal.Connect M")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "MR")] + [Property("AUTHOR", "guowei.wang@samsung.com")] + public void TransitionSetSignalConnectWithIntPtr() + { + tlog.Debug(tag, $"TransitionSetSignalConnectWithIntPtr START"); + + View view = new View() + { + Name = "view", + TransitionOptions = new TransitionOptions(Window.Instance) + }; + view.TransitionOptions.TransitionTag = "Transition"; + view.TransitionOptions.EnableTransition = true; + + TransitionItemBase transitionItemBase = null; + using (TimePeriod timePeriod = new TimePeriod(500)) + { + using (AlphaFunction alphaFunction = new AlphaFunction(AlphaFunction.BuiltinFunctions.Default)) + { + transitionItemBase = new TransitionItemBase(view, true, timePeriod, alphaFunction); + } + } + + var testingTarget = new TransitionSet(); + Assert.IsNotNull(testingTarget, "Should be not null!"); + Assert.IsInstanceOf(testingTarget, "Should be an Instance of TransitionSet!"); + + testingTarget.AddTransition(transitionItemBase); + + var transitionSetSignal = testingTarget.FinishedSignal(); + Assert.IsNotNull(transitionSetSignal, "Should be not null!"); + Assert.IsInstanceOf(transitionSetSignal, "Should be an Instance of TransitionSet!"); + + transitionSetSignal.Connect(OnIntPtrCallback); + transitionSetSignal.Disconnect(OnIntPtrCallback); + + view.Dispose(); + testingTarget.Dispose(); + tlog.Debug(tag, $"TransitionSetSignalConnectWithIntPtr END (OK)"); + } + + [Test] + [Category("P1")] + [Description("TransitionSetSignal Disconnect.")] + [Property("SPEC", "Tizen.NUI.TransitionSetSignal.Disconnect M")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "MR")] + [Property("AUTHOR", "guowei.wang@samsung.com")] + public void TransitionSetSignalDisconnect() + { + tlog.Debug(tag, $"TransitionSetSignalDisconnect START"); + + View view = new View() + { + Name = "view", + TransitionOptions = new TransitionOptions(Window.Instance) + }; + view.TransitionOptions.TransitionTag = "Transition"; + view.TransitionOptions.EnableTransition = true; + + TransitionItemBase transitionItemBase = null; + using (TimePeriod timePeriod = new TimePeriod(500)) + { + using (AlphaFunction alphaFunction = new AlphaFunction(AlphaFunction.BuiltinFunctions.Default)) + { + transitionItemBase = new TransitionItemBase(view, true, timePeriod, alphaFunction); + } + } + + var testingTarget = new TransitionSet(); + Assert.IsNotNull(testingTarget, "Should be not null!"); + Assert.IsInstanceOf(testingTarget, "Should be an Instance of TransitionSet!"); + + testingTarget.AddTransition(transitionItemBase); + + var transitionSetSignal = testingTarget.FinishedSignal(); + Assert.IsNotNull(transitionSetSignal, "Should be not null!"); + Assert.IsInstanceOf(transitionSetSignal, "Should be an Instance of TransitionSet!"); + + dummyCallback callback = OnDummyCallback; + transitionSetSignal.Connect(callback); + transitionSetSignal.Disconnect(callback); + + view.Dispose(); + testingTarget.Dispose(); + tlog.Debug(tag, $"TransitionSetSignalDisconnect END (OK)"); + } + + [Test] + [Category("P1")] + [Description("TransitionSetSignal Disconnect. With IntPtr")] + [Property("SPEC", "Tizen.NUI.TransitionSetSignal.Disconnect M")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "MR")] + [Property("AUTHOR", "guowei.wang@samsung.com")] + public void TransitionSetSignalDisconnectWithIntPtr() + { + tlog.Debug(tag, $"TransitionSetSignalDisconnectWithIntPtr START"); + + View view = new View() + { + Name = "view", + TransitionOptions = new TransitionOptions(Window.Instance) + }; + view.TransitionOptions.TransitionTag = "Transition"; + view.TransitionOptions.EnableTransition = true; + + TransitionItemBase transitionItemBase = null; + using (TimePeriod timePeriod = new TimePeriod(500)) + { + using (AlphaFunction alphaFunction = new AlphaFunction(AlphaFunction.BuiltinFunctions.Default)) + { + transitionItemBase = new TransitionItemBase(view, true, timePeriod, alphaFunction); + } + } + + var testingTarget = new TransitionSet(); + Assert.IsNotNull(testingTarget, "Should be not null!"); + Assert.IsInstanceOf(testingTarget, "Should be an Instance of TransitionSet!"); + + testingTarget.AddTransition(transitionItemBase); + + var transitionSetSignal = testingTarget.FinishedSignal(); + Assert.IsNotNull(transitionSetSignal, "Should be not null!"); + Assert.IsInstanceOf(transitionSetSignal, "Should be an Instance of TransitionSet!"); + + transitionSetSignal.Connect(OnIntPtrCallback); + transitionSetSignal.Disconnect(OnIntPtrCallback); + + view.Dispose(); + testingTarget.Dispose(); + tlog.Debug(tag, $"TransitionSetSignalDisconnectWithIntPtr END (OK)"); + } + } +} diff --git a/test/Tizen.NUI.Tests/Tizen.NUI.TCT/testcase/public/Transition/TSTransition.cs b/test/Tizen.NUI.Tests/Tizen.NUI.TCT/testcase/public/Transition/TSTransition.cs new file mode 100755 index 0000000..e3b821c --- /dev/null +++ b/test/Tizen.NUI.Tests/Tizen.NUI.TCT/testcase/public/Transition/TSTransition.cs @@ -0,0 +1,92 @@ +using global::System; +using NUnit.Framework; +using NUnit.Framework.TUnit; +using Tizen.NUI.Components; +using Tizen.NUI.BaseComponents; +using System.Collections.Generic; +using System.Threading.Tasks; + +namespace Tizen.NUI.Devel.Tests +{ + using tlog = Tizen.Log; + + [TestFixture] + [Description("public/Transition/Transition.cs")] + public class PublicTransitionTest + { + private const string tag = "NUITEST"; + + [SetUp] + public void Init() + { + tlog.Info(tag, "Init() is called!"); + } + + [TearDown] + public void Destroy() + { + tlog.Info(tag, "Destroy() is called!"); + } + + [Test] + [Category("P1")] + [Description("Transition constructor.")] + [Property("SPEC", "Tizen.NUI.Transition.Transition C")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "CONSTR")] + [Property("AUTHOR", "guowei.wang@samsung.com")] + public void TransitionConstructor() + { + tlog.Debug(tag, $"TransitionConstructor START"); + + var testingTarget = new Transition(); + Assert.IsNotNull(testingTarget, "Can't create success object Transition"); + Assert.IsInstanceOf(testingTarget, "Should be an instance of Transition type."); + + testingTarget.Dispose(); + + tlog.Debug(tag, $"TransitionConstructor END (OK)"); + } + + [Test] + [Category("P1")] + [Description("Transition CreateTransition.")] + [Property("SPEC", "Tizen.NUI.Transition.CreateTransition M")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "MR")] + [Property("AUTHOR", "guowei.wang@samsung.com")] + public void TransitionCreateTransition() + { + tlog.Debug(tag, $"TransitionCreateTransition START"); + + var testingTarget = new Transition(); + Assert.IsNotNull(testingTarget, "Can't create success object Transition"); + Assert.IsInstanceOf(testingTarget, "Should be an instance of Transition type."); + + using (View source = new View()) + { + source.Position = new Position(50, 100); + + using (View dest = new View()) + { + dest.Position = new Position(100, 150); + + try + { + var result = testingTarget.CreateTransition(source, dest); + Assert.IsNotNull(result, "Can't create success object TransitionItem"); + Assert.IsInstanceOf(result, "Should be an instance of TransitionItem type."); + } + catch (Exception e) + { + tlog.Debug(tag, e.Message.ToString()); + Assert.Fail("Caught Exception: Failed!"); + } + } + } + + testingTarget.Dispose(); + tlog.Debug(tag, $"TransitionCreateTransition END (OK)"); + } + } +} diff --git a/test/Tizen.NUI.Tests/Tizen.NUI.TCT/testcase/public/Transition/TSTransitionBase.cs b/test/Tizen.NUI.Tests/Tizen.NUI.TCT/testcase/public/Transition/TSTransitionBase.cs new file mode 100755 index 0000000..1797c7c --- /dev/null +++ b/test/Tizen.NUI.Tests/Tizen.NUI.TCT/testcase/public/Transition/TSTransitionBase.cs @@ -0,0 +1,125 @@ +using global::System; +using NUnit.Framework; +using NUnit.Framework.TUnit; +using Tizen.NUI.Components; +using Tizen.NUI.BaseComponents; +using System.Collections.Generic; +using System.Threading.Tasks; + +namespace Tizen.NUI.Devel.Tests +{ + using tlog = Tizen.Log; + + [TestFixture] + [Description("public/Transition/TransitionBase.cs")] + public class PublicTransitionBaseTest + { + private const string tag = "NUITEST"; + + [SetUp] + public void Init() + { + tlog.Info(tag, "Init() is called!"); + } + + [TearDown] + public void Destroy() + { + tlog.Info(tag, "Destroy() is called!"); + } + + [Test] + [Category("P1")] + [Description("TransitionBase constructor.")] + [Property("SPEC", "Tizen.NUI.TransitionBase.TransitionBase C")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "CONSTR")] + [Property("AUTHOR", "guowei.wang@samsung.com")] + public void TransitionBaseConstructor() + { + tlog.Debug(tag, $"TransitionBaseConstructor START"); + + var testingTarget = new TransitionBase(); + Assert.IsNotNull(testingTarget, "Can't create success object TransitionBase"); + Assert.IsInstanceOf(testingTarget, "Should be an instance of TransitionBase type."); + + testingTarget.Dispose(); + + tlog.Debug(tag, $"TransitionBaseConstructor END (OK)"); + } + + [Test] + [Category("P1")] + [Description("TransitionBase AlphaFunction.")] + [Property("SPEC", "Tizen.NUI.TransitionBase.AlphaFunction A")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "PRW")] + [Property("AUTHOR", "guowei.wang@samsung.com")] + public void TransitionBaseAlphaFunction() + { + tlog.Debug(tag, $"TransitionBaseAlphaFunction START"); + + var testingTarget = new TransitionBase(); + Assert.IsNotNull(testingTarget, "Can't create success object TransitionBase"); + Assert.IsInstanceOf(testingTarget, "Should be an instance of TransitionBase type."); + + Assert.IsNotNull(testingTarget.AlphaFunction); + + testingTarget.AlphaFunction = new AlphaFunction(AlphaFunction.BuiltinFunctions.Bounce); + Assert.IsInstanceOf(testingTarget.AlphaFunction, "Should be an instance of TimePeriod type."); + + testingTarget.Dispose(); + tlog.Debug(tag, $"TransitionBaseAlphaFunction END (OK)"); + } + + [Test] + [Category("P1")] + [Description("TransitionBase TimePeriod.")] + [Property("SPEC", "Tizen.NUI.TransitionBase.TimePeriod A")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "PRW")] + [Property("AUTHOR", "guowei.wang@samsung.com")] + public void TransitionBaseTimePeriod() + { + tlog.Debug(tag, $"TransitionBaseTimePeriod START"); + + var testingTarget = new TransitionBase(); + Assert.IsNotNull(testingTarget, "Can't create success object TransitionBase"); + Assert.IsInstanceOf(testingTarget, "Should be an instance of TransitionBase type."); + + Assert.IsNotNull(testingTarget.TimePeriod); + + testingTarget.TimePeriod = new TimePeriod(300); + Assert.IsInstanceOf(testingTarget.TimePeriod, "Should be an instance of TimePeriod type."); + + testingTarget.Dispose(); + tlog.Debug(tag, $"TransitionBaseTimePeriod END (OK)"); + } + + [Test] + [Category("P1")] + [Description("TransitionBase CreateTransition.")] + [Property("SPEC", "Tizen.NUI.TransitionBase.CreateTransition M")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "MR")] + [Property("AUTHOR", "guowei.wang@samsung.com")] + public void TransitionBaseCreateTransition() + { + tlog.Debug(tag, $"TransitionBaseCreateTransition START"); + + var testingTarget = new TransitionBase(); + Assert.IsNotNull(testingTarget, "Can't create success object TransitionBase"); + Assert.IsInstanceOf(testingTarget, "Should be an instance of TransitionBase type."); + + using (View view = new View()) + { + var result = testingTarget.CreateTransition(view, true); + Assert.IsNotNull(result, "Can't create success object TransitionItemBase"); + Assert.IsInstanceOf(result, "Should be an instance of TransitionItemBase type."); + } + + testingTarget.Dispose(); + tlog.Debug(tag, $"TransitionBaseCreateTransition END (OK)"); + } + } +} -- 2.7.4