Merge remote-tracking branch 'origin/master' into tizen
[platform/core/csapi/tizenfx.git] / test / Tizen.NUI.Tests / Tizen.NUI.Devel.Tests / testcase / internal / Transition / TSTransitionItemBase.cs
1 using global::System;
2 using NUnit.Framework;
3 using NUnit.Framework.TUnit;
4 using Tizen.NUI.Components;
5 using Tizen.NUI.BaseComponents;
6
7 namespace Tizen.NUI.Devel.Tests
8 {
9     using tlog = Tizen.Log;
10
11     [TestFixture]
12     [Description("Internal/Transition/TransitionItemBase")]
13     class TSTransitionItemBase
14     {
15         private const string tag = "NUITEST";
16
17         [SetUp]
18         public void Init()
19         {
20             tlog.Info(tag, "Init() is called!");
21         }
22
23         [TearDown]
24         public void Destroy()
25         {
26             tlog.Info(tag, "Destroy() is called!");
27         }
28
29         [Test]
30         [Category("P1")]
31         [Description("TransitionItemBase constructor.")]
32         [Property("SPEC", "Tizen.NUI.TransitionItemBase.TransitionItemBase C")]
33         [Property("SPEC_URL", "-")]
34         [Property("CRITERIA", "CONSTR")]
35         [Property("AUTHOR", "guowei.wang@samsung.com")]
36         public void TransitionItemBaseConstructor()
37         {
38             tlog.Debug(tag, $"TransitionItemBaseConstructor START");
39
40             using (View view = new View())
41             {
42                 var testingTarget = new TransitionItemBase(view.SwigCPtr.Handle, false);
43                 Assert.IsNotNull(testingTarget, "Should be not null!");
44                 Assert.IsInstanceOf<TransitionItemBase>(testingTarget, "Should be an Instance of TransitionItemBase!");
45
46                 testingTarget.Dispose();
47             }
48
49             tlog.Debug(tag, $"TransitionItemBaseConstructor END (OK)");
50         }
51
52         [Test]
53         [Category("P1")]
54         [Description("TransitionItemBase TimePeriod.")]
55         [Property("SPEC", "Tizen.NUI.TransitionItemBase.TimePeriod A")]
56         [Property("SPEC_URL", "-")]
57         [Property("CRITERIA", "PW")]
58         [Property("AUTHOR", "guowei.wang@samsung.com")]
59         public void TransitionItemBaseTimePeriod()
60         {
61             tlog.Debug(tag, $"TransitionItemBaseTimePeriod START");
62
63             using (View view = new View())
64             {
65                 var testingTarget = new TransitionItemBase(view.SwigCPtr.Handle, false);
66                 Assert.IsNotNull(testingTarget, "Should be not null!");
67                 Assert.IsInstanceOf<TransitionItemBase>(testingTarget, "Should be an Instance of TransitionItemBase!");
68
69                 testingTarget.TimePeriod = new TimePeriod(300);
70                 tlog.Debug(tag, "TiemPeriod : " + testingTarget.TimePeriod);
71
72                 testingTarget.Dispose();
73             }
74
75             tlog.Debug(tag, $"TransitionItemBaseTimePeriod END (OK)");
76         }
77
78         //[Test]
79         //[Category("P1")]
80         //[Description("TransitionItemBase AlphaFunction.")]
81         //[Property("SPEC", "Tizen.NUI.TransitionItemBase.AlphaFunction A")]
82         //[Property("SPEC_URL", "-")]
83         //[Property("CRITERIA", "PRW")]
84         //[Property("AUTHOR", "guowei.wang@samsung.com")]
85         //public void TransitionItemBaseAlphaFunction()
86         //{
87         //    tlog.Debug(tag, $"TransitionItemBaseAlphaFunction START");
88
89         //    using (View view = new View())
90         //    {
91         //        var testingTarget = new TransitionItemBase(view.SwigCPtr.Handle, false);
92         //        Assert.IsNotNull(testingTarget, "Should be not null!");
93         //        Assert.IsInstanceOf<TransitionItemBase>(testingTarget, "Should be an Instance of TransitionItemBase!");
94
95         //        testingTarget.AlphaFunction = new AlphaFunction(Tizen.NUI.AlphaFunction.BuiltinFunctions.EaseOut);
96         //        tlog.Debug(tag, "AlphaFunction : " + testingTarget.AlphaFunction.ToString());
97
98         //        testingTarget.Dispose();
99         //    }
100
101         //    tlog.Debug(tag, $"TransitionItemBaseAlphaFunction END (OK)");
102         //}
103
104         [Test]
105         [Category("P1")]
106         [Description("TransitionItemBase TransitionWithChild.")]
107         [Property("SPEC", "Tizen.NUI.TransitionItemBase.TransitionWithChild A")]
108         [Property("SPEC_URL", "-")]
109         [Property("CRITERIA", "PW")]
110         [Property("AUTHOR", "guowei.wang@samsung.com")]
111         public void TransitionItemBaseTransitionWithChild()
112         {
113             tlog.Debug(tag, $"TransitionItemBaseTransitionWithChild START");
114
115             using (View view = new View())
116             {
117                 var testingTarget = new TransitionItemBase(view.SwigCPtr.Handle, false);
118                 Assert.IsNotNull(testingTarget, "Should be not null!");
119                 Assert.IsInstanceOf<TransitionItemBase>(testingTarget, "Should be an Instance of TransitionItemBase!");
120
121                 try
122                 {
123                     testingTarget.TransitionWithChild = false;
124                 }
125                 catch (Exception e)
126                 {
127                     tlog.Debug(tag, e.Message.ToString());
128                     Assert.Fail("Caught Exception : Failed!");
129                 }
130
131                 testingTarget.Dispose();
132             }
133
134             tlog.Debug(tag, $"TransitionItemBaseTransitionWithChild END (OK)");
135         }
136
137         [Test]
138         [Category("P1")]
139         [Description("TransitionItemBase DownCast.")]
140         [Property("SPEC", "Tizen.NUI.TransitionItemBase.DownCast M")]
141         [Property("SPEC_URL", "-")]
142         [Property("CRITERIA", "MR")]
143         [Property("AUTHOR", "guowei.wang@samsung.com")]
144         public void TransitionItemBaseDownCast()
145         {
146             tlog.Debug(tag, $"TransitionItemBaseDownCast START");
147
148             using (View view = new View())
149             {
150                 var testingTarget = new TransitionItemBase(view.SwigCPtr.Handle, false);
151                 Assert.IsNotNull(testingTarget, "Should be not null!");
152                 Assert.IsInstanceOf<TransitionItemBase>(testingTarget, "Should be an Instance of TransitionItemBase!");
153
154                 try
155                 {
156                     TransitionItemBase.DownCast(testingTarget);
157                 }
158                 catch (Exception e)
159                 {
160                     tlog.Error(tag, "Caught Exception" + e.ToString());
161                     LogUtils.Write(LogUtils.DEBUG, LogUtils.TAG, "Caught Exception" + e.ToString());
162                     Assert.Fail("Caught Exception" + e.ToString());
163                 }
164
165                 testingTarget.Dispose();
166             }
167
168             tlog.Debug(tag, $"TransitionItemBaseDownCast END (OK)");
169         }
170
171         [Test]
172         [Category("P1")]
173         [Description("TransitionItemBase Assign.")]
174         [Property("SPEC", "Tizen.NUI.TransitionItemBase.Assign M")]
175         [Property("SPEC_URL", "-")]
176         [Property("CRITERIA", "MR")]
177         [Property("AUTHOR", "guowei.wang@samsung.com")]
178         public void TransitionItemBaseAssign()
179         {
180             tlog.Debug(tag, $"TransitionItemBaseAssign START");
181
182             using (View view = new View())
183             {
184                 var testingTarget = new TransitionItemBase(view.SwigCPtr.Handle, false);
185                 Assert.IsNotNull(testingTarget, "Should be not null!");
186                 Assert.IsInstanceOf<TransitionItemBase>(testingTarget, "Should be an Instance of TransitionItemBase!");
187
188                 try
189                 {
190                     testingTarget.Assign(testingTarget);
191                 }
192                 catch (Exception e)
193                 {
194                     tlog.Error(tag, "Caught Exception" + e.ToString());
195                     LogUtils.Write(LogUtils.DEBUG, LogUtils.TAG, "Caught Exception" + e.ToString());
196                     Assert.Fail("Caught Exception" + e.ToString());
197                 }
198
199                 testingTarget.Dispose();
200             }
201
202             tlog.Debug(tag, $"TransitionItemBaseAssign END (OK)");
203         }
204     }
205 }