3 using NUnit.Framework.TUnit;
4 using Tizen.NUI.Components;
5 using Tizen.NUI.BaseComponents;
7 namespace Tizen.NUI.Devel.Tests
9 using tlog = Tizen.Log;
12 [Description("public/Animation/KeyFrames")]
13 public class PublicKeyFramesTest
15 private const string tag = "NUITEST";
20 tlog.Info(tag, "Init() is called!");
26 tlog.Info(tag, "Destroy() is called!");
31 [Description("KeyFrames constructor")]
32 [Property("SPEC", "Tizen.NUI.KeyFrames.KeyFrames C")]
33 [Property("SPEC_URL", "-")]
34 [Property("CRITERIA", "CONSTR")]
35 [Property("AUTHOR", "guowei.wang@samsung.com")]
36 public void KeyFramesConstructor()
38 tlog.Debug(tag, $"KeyFramesConstructor START");
40 var testingTarget = new KeyFrames();
41 Assert.IsNotNull(testingTarget, "should be not null");
42 Assert.IsInstanceOf<KeyFrames>(testingTarget, "should be an instance of KeyFrames class!");
44 testingTarget.Dispose();
45 tlog.Debug(tag, $"KeyFramesConstructor END (OK)");
50 [Description("KeyFrames Add. Add a key frame with object value ")]
51 [Property("SPEC", "Tizen.NUI.KeyFrames.Add M")]
52 [Property("SPEC_URL", "-")]
53 [Property("CRITERIA", "MR")]
54 [Property("AUTHOR", "guowei.wang@samsung.com")]
55 public void KeyFramesAddWithObject()
57 tlog.Debug(tag, $"KeyFramesAddWithObject START");
59 var testingTarget = new KeyFrames();
60 Assert.IsNotNull(testingTarget, "should be not null");
61 Assert.IsInstanceOf<KeyFrames>(testingTarget, "should be an instance of KeyFrames class!");
63 Position pos = new Position(10.0f, 20.0f, 30.0f);
64 testingTarget.Add(0.3f, pos);
66 var result = testingTarget.GetType().ToString();
67 Assert.IsTrue("Vector3" == result);
69 testingTarget.Dispose();
70 tlog.Debug(tag, $"KeyFramesAddWithObject END (OK)");
75 [Description("KeyFrames Add. Add a key frame with object value and alpha function")]
76 [Property("SPEC", "Tizen.NUI.KeyFrames.Add M")]
77 [Property("SPEC_URL", "-")]
78 [Property("CRITERIA", "MR")]
79 [Property("AUTHOR", "guowei.wang@samsung.com")]
80 public void KeyFramesAddWithObjectAndAlphaFunc()
82 tlog.Debug(tag, $"KeyFramesAddWithObjectAndAlphaFunc START");
84 var testingTarget = new KeyFrames();
85 Assert.IsNotNull(testingTarget, "should be not null");
86 Assert.IsInstanceOf<KeyFrames>(testingTarget, "should be an instance of KeyFrames class!");
88 Position pos = new Position(10.0f, 20.0f, 30.0f);
89 AlphaFunction linear = new AlphaFunction(AlphaFunction.BuiltinFunctions.Linear);
92 testingTarget.Add(0.3f, pos, linear);
93 Assert.IsTrue("Vector3" == testingTarget.GetType().ToString());
97 tlog.Error(tag, "Caught Exception" + e.ToString());
98 LogUtils.Write(LogUtils.DEBUG, LogUtils.TAG, "Caught Exception" + e.ToString());
99 Assert.Fail("Caught Exception" + e.ToString());
104 testingTarget.Dispose();
105 tlog.Debug(tag, $"KeyFramesAddWithObjectAndAlphaFunc END (OK)");
110 [Description("KeyFrames GetType")]
111 [Property("SPEC", "Tizen.NUI.KeyFrames.GetType M")]
112 [Property("SPEC_URL", "-")]
113 [Property("CRITERIA", "MR")]
114 [Property("AUTHOR", "guowei.wang@samsung.com")]
115 public void KeyFramesGetType()
117 tlog.Debug(tag, $"KeyFramesGetType START");
119 var testingTarget = new KeyFrames();
120 Assert.IsNotNull(testingTarget, "should be not null");
121 Assert.IsInstanceOf<KeyFrames>(testingTarget, "should be an instance of KeyFrames class!");
123 Color color = Color.Yellow;
124 testingTarget.Add(0.3f, color);
126 var result = testingTarget.GetType().ToString();
127 Assert.IsTrue("Vector4" == result);
129 testingTarget.Dispose();
130 tlog.Debug(tag, $"KeyFramesGetType END (OK)");
135 [Description("KeyFrames Add. Add a key frame with property value ")]
136 [Property("SPEC", "Tizen.NUI.KeyFrames.Add M")]
137 [Property("SPEC_URL", "-")]
138 [Property("CRITERIA", "MR")]
139 [Property("AUTHOR", "guowei.wang@samsung.com")]
140 public void KeyFramesAddWithPropertyValue()
142 tlog.Debug(tag, $"KeyFramesAddWithPropertyValue START");
144 var testingTarget = new KeyFrames();
145 Assert.IsNotNull(testingTarget, "should be not null");
146 Assert.IsInstanceOf<KeyFrames>(testingTarget, "should be an instance of KeyFrames class!");
148 PropertyValue dummy = new PropertyValue(true);
149 testingTarget.Add(0.3f, dummy);
151 var result = testingTarget.GetType().ToString();
152 Assert.IsTrue("Boolean" == result);
155 testingTarget.Dispose();
156 tlog.Debug(tag, $"KeyFramesAddWithPropertyValue END (OK)");
161 [Description("KeyFrames Add. Add a key frame with object property and alpha function")]
162 [Property("SPEC", "Tizen.NUI.KeyFrames.Add M")]
163 [Property("SPEC_URL", "-")]
164 [Property("CRITERIA", "MR")]
165 [Property("AUTHOR", "guowei.wang@samsung.com")]
166 public void KeyFramesAddWithPropertyValueAndAlphaFunc()
168 tlog.Debug(tag, $"KeyFramesAddWithPropertyValueAndAlphaFunc START");
170 var testingTarget = new KeyFrames();
171 Assert.IsNotNull(testingTarget, "should be not null");
172 Assert.IsInstanceOf<KeyFrames>(testingTarget, "should be an instance of KeyFrames class!");
174 PropertyValue dummy = new PropertyValue(true);
175 AlphaFunction ease = new AlphaFunction(AlphaFunction.BuiltinFunctions.EaseOut);
178 testingTarget.Add(0.3f, dummy, ease);
179 Assert.IsTrue("Boolean" == testingTarget.GetType().ToString());
183 tlog.Error(tag, "Caught Exception" + e.ToString());
184 LogUtils.Write(LogUtils.DEBUG, LogUtils.TAG, "Caught Exception" + e.ToString());
185 Assert.Fail("Caught Exception" + e.ToString());
190 testingTarget.Dispose();
191 tlog.Debug(tag, $"KeyFramesAddWithPropertyValueAndAlphaFunc END (OK)");