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";
16 private LongPressGesture longPressGesture;
21 tlog.Info(tag, "Init() is called!");
22 longPressGesture = new LongPressGesture(Gesture.StateType.Started);
28 longPressGesture?.Dispose();
29 tlog.Info(tag, "Destroy() is called!");
34 [Description("Gesture constructor")]
35 [Property("SPEC", "Tizen.NUI.Gesture.Gesture C")]
36 [Property("SPEC_URL", "-")]
37 [Property("CRITERIA", "CONSTR")]
38 [Property("AUTHOR", "guowei.wang@samsung.com")]
39 public void GestureConstructor()
41 tlog.Debug(tag, $"GestureConstructor START");
43 var testingTarget = new Gesture(longPressGesture);
44 Assert.IsNotNull(testingTarget, "Can't create success object Gesture");
45 Assert.IsInstanceOf<Gesture>(testingTarget, "Should be an instance of Gesture type.");
47 testingTarget.Dispose();
48 tlog.Debug(tag, $"GestureConstructor END (OK)");
49 Assert.Pass("GestureConstructor");
54 [Description("Gesture type")]
55 [Property("SPEC", "Tizen.NUI.Gesture.type A")]
56 [Property("SPEC_URL", "-")]
57 [Property("CRITERIA", "PRW")]
58 [Property("AUTHOR", "guowei.wang@samsung.com")]
59 public void GestureType()
61 tlog.Debug(tag, $"GestureType START");
63 var testingTarget = new Gesture(longPressGesture);
64 Assert.IsNotNull(testingTarget, "Can't create success object Gesture");
65 Assert.IsInstanceOf<Gesture>(testingTarget, "Should be an instance of Gesture type.");
69 var type = testingTarget.Type;
70 tlog.Debug(tag, "type : " + type);
74 tlog.Debug(tag, "Caught Exception" + e.ToString());
75 Assert.Fail("Caught Exception" + e.ToString());
78 testingTarget.Dispose();
79 tlog.Debug(tag, $"GestureType END (OK)");
80 Assert.Pass("GestureType");
85 [Description("Gesture state")]
86 [Property("SPEC", "Tizen.NUI.Gesture.state A")]
87 [Property("SPEC_URL", "-")]
88 [Property("CRITERIA", "PRW")]
89 [Property("AUTHOR", "guowei.wang@samsung.com")]
90 public void GestureState()
92 tlog.Debug(tag, $"GestureState START");
94 var testingTarget = new Gesture(longPressGesture);
95 Assert.IsNotNull(testingTarget, "Can't create success object Gesture");
96 Assert.IsInstanceOf<Gesture>(testingTarget, "Should be an instance of Gesture type.");
100 var state = testingTarget.State;
101 tlog.Debug(tag, "state : " + state);
105 tlog.Debug(tag, "Caught Exception" + e.ToString());
106 Assert.Fail("Caught Exception" + e.ToString());
109 testingTarget.Dispose();
110 tlog.Debug(tag, $"GestureState END (OK)");
111 Assert.Pass("GestureState");
116 [Description("Gesture time")]
117 [Property("SPEC", "Tizen.NUI.Gesture.time A")]
118 [Property("SPEC_URL", "-")]
119 [Property("CRITERIA", "PRW")]
120 [Property("AUTHOR", "guowei.wang@samsung.com")]
121 public void GestureTime()
123 tlog.Debug(tag, $"GestureTime START");
125 var testingTarget = new Gesture(longPressGesture);
126 Assert.IsNotNull(testingTarget, "Can't create success object Gesture");
127 Assert.IsInstanceOf<Gesture>(testingTarget, "Should be an instance of Gesture type.");
131 var time = testingTarget.Time;
132 tlog.Debug(tag, "time : " + time);
136 tlog.Debug(tag, "Caught Exception" + e.ToString());
137 Assert.Fail("Caught Exception" + e.ToString());
140 testingTarget.Dispose();
141 tlog.Debug(tag, $"GestureTime END (OK)");
142 Assert.Pass("GestureTime");
148 [Description("Gesture GetGestureFromPtr")]
149 [Property("SPEC", "Tizen.NUI.Gesture.GetGestureFromPtr M")]
150 [Property("SPEC_URL", "-")]
151 [Property("CRITERIA", "MR")]
152 [Property("AUTHOR", "guowei.wang@samsung.com")]
153 public void GetstureGetGestureFromPtr()
155 tlog.Debug(tag, $"GetstureGetGestureFromPtr START");
157 var testingTarget = Gesture.GetGestureFromPtr(longPressGesture.SwigCPtr.Handle);
158 Assert.IsNotNull(testingTarget, "Can't create success object Gesture");
159 Assert.IsInstanceOf<Gesture>(testingTarget, "Should be an instance of Gesture type.");
161 testingTarget.Dispose();
163 tlog.Debug(tag, $"GetstureGetGestureFromPtr END (OK)");
164 Assert.Pass("GetstureGetGestureFromPtr");