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("internal/Common/PinchGestureDetectedSignal")]
13 public class InternalPinchGestureDetectedSignalTest
15 private const string tag = "NUITEST";
17 private delegate bool dummyCallback(IntPtr signal);
18 private bool OnDummyCallback(IntPtr data)
26 tlog.Info(tag, "Init() is called!");
32 tlog.Info(tag, "Destroy() is called!");
37 [Description("PinchGestureDetectedSignal constructor.")]
38 [Property("SPEC", "Tizen.NUI.PinchGestureDetectedSignal.PinchGestureDetectedSignal C")]
39 [Property("SPEC_URL", "-")]
40 [Property("CRITERIA", "CONSTR")]
41 [Property("AUTHOR", "guowei.wang@samsung.com")]
42 public void PinchGestureDetectedSignalConstructor()
44 tlog.Debug(tag, $"PinchGestureDetectedSignalConstructor START");
46 using (View view = new View())
48 var testingTarget = new PinchGestureDetectedSignal(view.SwigCPtr.Handle, false);
49 Assert.IsNotNull(testingTarget, "Should be not null!");
50 Assert.IsInstanceOf<PinchGestureDetectedSignal>(testingTarget, "Should be an Instance of PinchGestureDetectedSignal!");
52 testingTarget.Dispose();
55 tlog.Debug(tag, $"PinchGestureDetectedSignalConstructor END (OK)");
60 [Description("PinchGestureDetectedSignal Empty.")]
61 [Property("SPEC", "Tizen.NUI.PinchGestureDetectedSignal.Empty M")]
62 [Property("SPEC_URL", "-")]
63 [Property("CRITERIA", "MR")]
64 [Property("AUTHOR", "guowei.wang@samsung.com")]
65 public void PinchGestureDetectedSignalEmpty()
67 tlog.Debug(tag, $"PinchGestureDetectedSignalEmpty START");
69 var testingTarget = new PinchGestureDetectedSignal();
70 Assert.IsNotNull(testingTarget, "Should be not null!");
71 Assert.IsInstanceOf<PinchGestureDetectedSignal>(testingTarget, "Should be an Instance of PinchGestureDetectedSignal!");
75 testingTarget.Empty();
79 tlog.Debug(tag, e.Message.ToString());
80 Assert.Fail("Caught Exception: Failed!");
83 testingTarget.Dispose();
85 tlog.Debug(tag, $"PinchGestureDetectedSignalEmpty END (OK)");
90 [Description("PinchGestureDetectedSignal GetConnectionCount.")]
91 [Property("SPEC", "Tizen.NUI.PinchGestureDetectedSignal.GetConnectionCount M")]
92 [Property("SPEC_URL", "-")]
93 [Property("CRITERIA", "MR")]
94 [Property("AUTHOR", "guowei.wang@samsung.com")]
95 public void PinchGestureDetectedSignalGetConnectionCount()
97 tlog.Debug(tag, $"PinchGestureDetectedSignalGetConnectionCount START");
99 var testingTarget = new PinchGestureDetectedSignal();
100 Assert.IsNotNull(testingTarget, "Should be not null!");
101 Assert.IsInstanceOf<PinchGestureDetectedSignal>(testingTarget, "Should be an Instance of PinchGestureDetectedSignal!");
105 testingTarget.GetConnectionCount();
109 tlog.Debug(tag, e.Message.ToString());
110 Assert.Fail("Caught Exception: Failed!");
113 testingTarget.Dispose();
115 tlog.Debug(tag, $"PinchGestureDetectedSignalGetConnectionCount END (OK)");
120 [Description("PinchGestureDetectedSignal Connect.")]
121 [Property("SPEC", "Tizen.NUI.PinchGestureDetectedSignal.Connect M")]
122 [Property("SPEC_URL", "-")]
123 [Property("CRITERIA", "MR")]
124 [Property("AUTHOR", "guowei.wang@samsung.com")]
125 public void PinchGestureDetectedSignalConnect()
127 tlog.Debug(tag, $"PinchGestureDetectedSignalConnect START");
129 var testingTarget = new PinchGestureDetectedSignal();
130 Assert.IsNotNull(testingTarget, "Should be not null!");
131 Assert.IsInstanceOf<PinchGestureDetectedSignal>(testingTarget, "Should be an Instance of PinchGestureDetectedSignal!");
135 dummyCallback callback = OnDummyCallback;
136 testingTarget.Connect(callback);
137 testingTarget.Disconnect(callback);
141 tlog.Debug(tag, e.Message.ToString());
142 Assert.Fail("Caught Exception: Failed!");
145 testingTarget.Dispose();
147 tlog.Debug(tag, $"PinchGestureDetectedSignalConnect END (OK)");
152 [Description("PinchGestureDetectedSignal Emit.")]
153 [Property("SPEC", "Tizen.NUI.PinchGestureDetectedSignal.Emit M")]
154 [Property("SPEC_URL", "-")]
155 [Property("CRITERIA", "MR")]
156 [Property("AUTHOR", "guowei.wang@samsung.com")]
157 public void PinchGestureDetectedSignalEmit()
159 tlog.Debug(tag, $"PinchGestureDetectedSignalEmit START");
160 var currentPid = global::System.Diagnostics.Process.GetCurrentProcess().Id;
161 var currentTid = global::System.Threading.Thread.CurrentThread.ManagedThreadId;
163 tlog.Debug(tag, $"thread check! main pid={App.mainPid}, current pid={currentPid}, main tid={App.mainTid}, current tid={currentTid}");
165 using (View view = new View())
167 var testingTarget = new PinchGestureDetectedSignal();
168 Assert.IsNotNull(testingTarget, "Should be not null!");
169 Assert.IsInstanceOf<PinchGestureDetectedSignal>(testingTarget, "Should be an Instance of PinchGestureDetectedSignal!");
173 testingTarget.Emit(view, new PinchGesture(view.SwigCPtr.Handle, false));
177 tlog.Debug(tag, e.Message.ToString());
178 Assert.Fail("Caught Exception: Failed!");
181 testingTarget.Dispose();
184 tlog.Debug(tag, $"PinchGestureDetectedSignalEmit END (OK)");