1 using NUnit.Framework;
2 using NUnit.Framework.TUnit;
5 using Tizen.NUI.BaseComponents;
7 namespace Tizen.NUI.Devel.Tests
9 using tlog = Tizen.Log;
12 [Description("public/Events/Gesture")]
13 class PublicGestureTest
15 private const string tag = "NUITEST";
20 tlog.Info(tag, "Init() is called!");
26 tlog.Info(tag, "Destroy() is called!");
31 [Description("Gesture constructor")]
32 [Property("SPEC", "Tizen.NUI.Gesture.Gesture C")]
33 [Property("SPEC_URL", "-")]
34 [Property("CRITERIA", "CONSTR")]
35 [Property("AUTHOR", "guowei.wang@samsung.com")]
36 public void GestureConstructor()
38 tlog.Debug(tag, $"GestureConstructor START");
40 var longPressGesture = new LongPressGesture(Gesture.StateType.Cancelled);
41 var gesture = new Gesture(longPressGesture);
43 longPressGesture.Dispose();
45 tlog.Debug(tag, $"GestureConstructor END (OK)");
46 Assert.Pass("GestureConstructor");
51 [Description("Gesture type")]
52 [Property("SPEC", "Tizen.NUI.Gesture.type A")]
53 [Property("SPEC_URL", "-")]
54 [Property("CRITERIA", "PRW")]
55 [Property("AUTHOR", "guowei.wang@samsung.com")]
56 public void GestureType()
58 tlog.Debug(tag, $"GestureType START");
61 var longPressGesture = new LongPressGesture(Gesture.StateType.Cancelled);
62 Assert.IsNotNull(longPressGesture, "Can't create success object LongPressGesture");
63 var gesture = new Gesture(longPressGesture);
64 Assert.IsNotNull(gesture, "Can't create success object Gesture");
65 Assert.IsInstanceOf<Gesture>(gesture, "Should be an instance of Gesture type.");
66 Gesture.GestureType type = gesture.Type;
67 Assert.AreEqual(Gesture.GestureType.LongPress, type, "Should be same value");
70 longPressGesture.Dispose();
74 Tizen.Log.Error(tag, "Caught Exception" + e.ToString());
75 Assert.Fail("Caught Exception" + e.ToString());
77 tlog.Debug(tag, $"GestureType END (OK)");
78 Assert.Pass("GestureType");
83 [Description("Gesture state")]
84 [Property("SPEC", "Tizen.NUI.Gesture.state A")]
85 [Property("SPEC_URL", "-")]
86 [Property("CRITERIA", "PRW")]
87 [Property("AUTHOR", "guowei.wang@samsung.com")]
88 public void GestureState()
90 tlog.Debug(tag, $"GestureState START");
93 var longPressGesture = new LongPressGesture(Gesture.StateType.Cancelled);
94 Assert.IsNotNull(longPressGesture, "Can't create success object LongPressGesture");
95 var gesture = new Gesture(longPressGesture);
96 Assert.IsNotNull(gesture, "Can't create success object Gesture");
97 Assert.IsInstanceOf<Gesture>(gesture, "Should be an instance of Gesture type.");
98 Gesture.StateType state = gesture.State;
99 Assert.AreEqual(Gesture.StateType.Cancelled, state, "Should be same value");
102 longPressGesture.Dispose();
107 Tizen.Log.Error(tag, "Caught Exception" + e.ToString());
109 Assert.Fail("Caught Exception" + e.ToString());
111 tlog.Debug(tag, $"GestureState END (OK)");
112 Assert.Pass("GestureState");
117 [Description("Gesture time")]
118 [Property("SPEC", "Tizen.NUI.Gesture.time A")]
119 [Property("SPEC_URL", "-")]
120 [Property("CRITERIA", "PRW")]
121 [Property("AUTHOR", "guowei.wang@samsung.com")]
122 public void GestureTime()
124 tlog.Debug(tag, $"GestureTime START");
127 var longPressGesture = new LongPressGesture(Gesture.StateType.Cancelled);
128 Assert.IsNotNull(longPressGesture, "Can't create success object LongPressGesture");
129 var gesture = new Gesture(longPressGesture);
130 Assert.IsNotNull(gesture, "Can't create success object Gesture");
131 Assert.IsInstanceOf<Gesture>(gesture, "Should be an instance of Gesture type.");
132 uint time = gesture.Time;
133 Assert.GreaterOrEqual(time, 0, "Should be greater or equal 0");
136 longPressGesture.Dispose();
140 Tizen.Log.Error(tag, "Caught Exception" + e.ToString());
142 Assert.Fail("Caught Exception" + e.ToString());
144 tlog.Debug(tag, $"GestureTime END (OK)");
145 Assert.Pass("GestureTime");
151 [Description("Gesture GetGestureFromPtr")]
152 [Property("SPEC", "Tizen.NUI.Gesture.GetGestureFromPtr M")]
153 [Property("SPEC_URL", "-")]
154 [Property("CRITERIA", "MR")]
155 [Property("AUTHOR", "guowei.wang@samsung.com")]
156 public void GetstureGetGestureFromPtr()
158 tlog.Debug(tag, $"GetstureGetGestureFromPtr START");
160 var longPressGesture = new LongPressGesture(Gesture.StateType.Cancelled);
161 var gesture = new Gesture(longPressGesture);
163 Gesture ret = Gesture.GetGestureFromPtr(Gesture.getCPtr(gesture).Handle);
165 Assert.IsNotNull(ret, "Can't create success object Gesture");
166 Assert.IsInstanceOf<Gesture>(ret, "Should be an instance of Gesture type.");
170 longPressGesture.Dispose();
172 tlog.Debug(tag, $"GetstureGetGestureFromPtr END (OK)");
173 Assert.Pass("GetstureGetGestureFromPtr");