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/Application/WatchBoolSignal")]
13 public class InternalWatchBoolSignalTest
15 private const string tag = "NUITEST";
16 private delegate bool dummyCallback(IntPtr application);
17 private bool OnDummyCallback(IntPtr data)
22 internal class MyWatchBoolSignal : WatchBoolSignal
24 public MyWatchBoolSignal(global::System.IntPtr cPtr, bool cMemoryOwn) : base(cPtr, cMemoryOwn)
27 public void OnReleaseSwigCPtr(global::System.Runtime.InteropServices.HandleRef swigCPtr)
29 base.ReleaseSwigCPtr(swigCPtr);
36 tlog.Info(tag, "Init() is called!");
42 tlog.Info(tag, "Destroy() is called!");
47 [Description("WatchBoolSignal constructor.")]
48 [Property("SPEC", "Tizen.NUI.WatchBoolSignal.WatchBoolSignal C")]
49 [Property("SPEC_URL", "-")]
50 [Property("CRITERIA", "CONSTR")]
51 [Property("AUTHOR", "guowei.wang@samsung.com")]
52 public void WatchBoolSignalConstructor()
54 tlog.Debug(tag, $"WatchBoolSignalConstructor START");
56 using (ImageView imageView = new ImageView())
58 var testingTarget = new WatchBoolSignal(imageView.SwigCPtr.Handle, false);
59 Assert.IsNotNull(testingTarget, "should be not null");
60 Assert.IsInstanceOf<WatchBoolSignal>(testingTarget, "should be an instance of testing target class!");
62 testingTarget.Dispose();
65 tlog.Debug(tag, $"WatchBoolSignalConstructor END (OK)");
70 //[Description("WatchApplication ReleaseSwigCPtr.")]
71 //[Property("SPEC", "Tizen.NUI.WatchApplication.ReleaseSwigCPtr M")]
72 //[Property("SPEC_URL", "-")]
73 //[Property("CRITERIA", "MR")]
74 //[Property("AUTHOR", "guowei.wang@samsung.com")]
75 //public void WatchApplicationReleaseSwigCPtr()
77 // tlog.Debug(tag, $"WatchBoolSignalReleaseSwigCPtr START");
79 // using (ImageView imageView = new ImageView())
81 // var testingTarget = new MyWatchBoolSignal(imageView.SwigCPtr.Handle, false);
82 // Assert.IsNotNull(testingTarget, "should be not null");
83 // Assert.IsInstanceOf<WatchBoolSignal>(testingTarget, "should be an instance of testing target class!");
87 // testingTarget.OnReleaseSwigCPtr(imageView.SwigCPtr);
89 // catch (Exception e)
91 // /** Unable to find an entry point named 'CSharp_Dali_delete_WatchBoolSignal' in shared library 'libdali2-csharp-binder.so' */
92 // tlog.Debug(tag, e.Message.ToString());
93 // Assert.Fail("Caught Exception: Failed!");
96 // testingTarget.Dispose();
99 // tlog.Debug(tag, $"WatchBoolSignalReleaseSwigCPtr END (OK)");
104 //[Description("WatchBoolSignal Empty.")]
105 //[Property("SPEC", "Tizen.NUI.WatchBoolSignal.Empty M")]
106 //[Property("SPEC_URL", "-")]
107 //[Property("CRITERIA", "MR")]
108 //[Property("AUTHOR", "guowei.wang@samsung.com")]
109 //public void WatchBoolSignalEmpty()
111 // tlog.Debug(tag, $"WatchBoolSignalEmpty START");
113 // using (ImageView imageView = new ImageView())
115 // var testingTarget = new WatchBoolSignal(imageView.SwigCPtr.Handle, false);
116 // Assert.IsNotNull(testingTarget, "should be not null");
117 // Assert.IsInstanceOf<WatchBoolSignal>(testingTarget, "should be an instance of testing target class!");
121 // /** Unable to find an entry point named 'CSharp_Dali_WatchBoolSignal_Empty' in shared library 'libdali2-csharp-binder.so' */
122 // var result = testingTarget.Empty();
124 // catch (Exception e)
126 // tlog.Debug(tag, e.Message.ToString());
127 // Assert.Fail("Caught Exception: Failed!");
130 // testingTarget.Dispose();
132 // tlog.Debug(tag, $"WatchBoolSignalEmpty END (OK)");
137 //[Description("WatchBoolSignal GetConnectionCount.")]
138 //[Property("SPEC", "Tizen.NUI.WatchBoolSignal.GetConnectionCount M")]
139 //[Property("SPEC_URL", "-")]
140 //[Property("CRITERIA", "MR")]
141 //[Property("AUTHOR", "guowei.wang@samsung.com")]
142 //public void WatchBoolSignalGetConnectionCount()
144 // tlog.Debug(tag, $"WatchBoolSignalGetConnectionCount START");
146 // using (ImageView imageView = new ImageView())
148 // var testingTarget = new WatchBoolSignal(imageView.SwigCPtr.Handle, false);
149 // Assert.IsNotNull(testingTarget, "should be not null");
150 // Assert.IsInstanceOf<WatchBoolSignal>(testingTarget, "should be an instance of testing target class!");
154 // /** Unable to find an entry point named 'CSharp_Dali_WatchBoolSignal_GetConnectionCount' in shared library 'libdali2-csharp-binder.so' */
155 // var result = testingTarget.GetConnectionCount();
156 // Assert.IsTrue(result == 0, "result should be 0");
158 // catch (Exception e)
160 // tlog.Debug(tag, e.Message.ToString());
161 // Assert.Fail("Caught Exception: Failed!");
164 // testingTarget.Dispose();
166 // tlog.Debug(tag, $"WatchBoolSignalGetConnectionCount END (OK)");
171 //[Description("WatchBoolSignal connection.")]
172 //[Property("SPEC", "Tizen.NUI.WatchBoolSignal.Connect M")]
173 //[Property("SPEC_URL", "-")]
174 //[Property("CRITERIA", "MR")]
175 //[Property("AUTHOR", "guowei.wang@samsung.com")]
176 //public void WatchBoolSignalConnection()
178 // tlog.Debug(tag, $"WatchBoolSignalConnection START");
180 // using (ImageView imageView = new ImageView())
182 // var testingTarget = new WatchBoolSignal(imageView.SwigCPtr.Handle, false);
183 // Assert.IsNotNull(testingTarget, "should be not null");
184 // Assert.IsInstanceOf<WatchBoolSignal>(testingTarget, "should be an instance of testing target class!");
186 // dummyCallback callback = OnDummyCallback;
190 // /** Unable to find an entry point named 'CSharp_Dali_WatchBoolSignal_Connect' in shared library 'libdali2-csharp-binder.so' */
191 // testingTarget.Connect(callback);
193 // catch (Exception e)
195 // tlog.Debug(tag, e.Message.ToString());
196 // Assert.Fail("Caught Exception: Failed!");
199 // testingTarget.Dispose();
201 // tlog.Debug(tag, $"WatchBoolSignalConnection END (OK)");
206 //[Description("WatchBoolSignal disconnection.")]
207 //[Property("SPEC", "Tizen.NUI.WatchBoolSignal.Disconnect M")]
208 //[Property("SPEC_URL", "-")]
209 //[Property("CRITERIA", "MR")]
210 //[Property("AUTHOR", "guowei.wang@samsung.com")]
211 //public void WatchBoolSignalDisconnection()
213 // tlog.Debug(tag, $"WatchBoolSignalDisconnection START");
215 // using (ImageView imageView = new ImageView())
217 // var testingTarget = new WatchBoolSignal(imageView.SwigCPtr.Handle, false);
218 // Assert.IsNotNull(testingTarget, "should be not null");
219 // Assert.IsInstanceOf<WatchBoolSignal>(testingTarget, "should be an instance of testing target class!");
221 // dummyCallback callback = OnDummyCallback;
225 // /** Unable to find an entry point named 'CSharp_Dali_WatchBoolSignal_Disconnect' in shared library 'libdali2-csharp-binder.so' */
226 // testingTarget.Connect(callback);
227 // testingTarget.Disconnect(callback);
229 // catch (Exception e)
231 // tlog.Debug(tag, e.Message.ToString());
232 // Assert.Fail("Caught Exception: Failed!");
235 // testingTarget.Dispose();
238 // tlog.Debug(tag, $"WatchBoolSignalDisconnection END (OK)");
243 //[Description("WatchBoolSignal Emit.")]
244 //[Property("SPEC", "Tizen.NUI.WatchBoolSignal.Emit M")]
245 //[Property("SPEC_URL", "-")]
246 //[Property("CRITERIA", "MR")]
247 //[Property("AUTHOR", "guowei.wang@samsung.com")]
248 //public void WatchBoolSignalEmit()
250 // tlog.Debug(tag, $"WatchBoolSignalEmit START");
252 // var currentPid = global::System.Diagnostics.Process.GetCurrentProcess().Id;
253 // var currentTid = global::System.Threading.Thread.CurrentThread.ManagedThreadId;
255 // tlog.Debug(tag, $"thread check! main pid={App.mainPid}, current pid={currentPid}, main tid={App.mainTid}, current tid={currentTid}");
257 // using (ImageView imageView = new ImageView())
259 // var testingTarget = new WatchBoolSignal(imageView.SwigCPtr.Handle, false);
260 // Assert.IsNotNull(testingTarget, "should be not null");
261 // Assert.IsInstanceOf<WatchBoolSignal>(testingTarget, "should be an instance of testing target class!");
263 // Widget widget = new Widget();
264 // var application = new WidgetApplication(widget.GetIntPtr(), false);
268 // /** Unable to find an entry point named 'CSharp_Dali_WatchBoolSignal_Emit' in shared library 'libdali2-csharp-binder.so' */
269 // testingTarget.Emit(application, true);
271 // catch (Exception e)
273 // tlog.Debug(tag, e.Message.ToString());
274 // Assert.Fail("Caught Exception: Failed!");
280 // testingTarget.Dispose();
283 // tlog.Debug(tag, $"WatchBoolSignalEmit END (OK)");