3 using NUnit.Framework.TUnit;
4 using Tizen.NUI.Components;
5 using Tizen.NUI.BaseComponents;
6 using System.Collections.Generic;
8 namespace Tizen.NUI.Devel.Tests
10 using tlog = Tizen.Log;
13 [Description("internal/Window/WindowEffectSignal")]
14 public class InternalWindowEffectSignalTest
16 private const string tag = "NUITEST";
18 private delegate bool dummyCallback(IntPtr signal);
19 private bool OnDummyCallback(IntPtr data)
27 tlog.Info(tag, "Init() is called!");
33 tlog.Info(tag, "Destroy() is called!");
38 [Description("WindowTransitionEffectSignal constructor")]
39 [Property("SPEC", "Tizen.NUI.WindowEffectSignal.WindowTransitionEffectSignal C")]
40 [Property("SPEC_URL", "-")]
41 [Property("CRITERIA", "CONSTR")]
42 [Property("AUTHOR", "guowei.wang@samsung.com")]
43 public void WindowTransitionEffectSignalConstructor()
45 tlog.Debug(tag, $"WindowTransitionEffectSignalConstructor START");
47 var testingTarget = new WindowTransitionEffectSignal(Window.Instance);
48 Assert.IsNotNull(testingTarget, "should be not null");
49 Assert.IsInstanceOf<WindowTransitionEffectSignal>(testingTarget, "should be an instance of WindowTransitionEffectSignal class!");
51 testingTarget.Dispose();
52 tlog.Debug(tag, $"WindowTransitionEffectSignalConstructor END (OK)");
57 [Description("WindowTransitionEffectSignal Empty.")]
58 [Property("SPEC", "Tizen.NUI.WindowTransitionEffectSignal.Empty M")]
59 [Property("SPEC_URL", "-")]
60 [Property("CRITERIA", "MR")]
61 [Property("AUTHOR", "guowei.wang@samsung.com")]
62 public void WindowTransitionEffectSignalEmpty()
64 tlog.Debug(tag, $"WindowTransitionEffectSignalEmpty START");
66 var testingTarget = new WindowTransitionEffectSignal(Window.Instance);
67 Assert.IsNotNull(testingTarget, "Should be not null!");
68 Assert.IsInstanceOf<WindowTransitionEffectSignal>(testingTarget, "Should be an Instance of WindowTransitionEffectSignal!");
72 testingTarget.Empty();
76 tlog.Debug(tag, e.Message.ToString());
77 Assert.Fail("Caught Exception: Failed!");
80 testingTarget.Dispose();
81 tlog.Debug(tag, $"WindowTransitionEffectSignalEmpty END (OK)");
86 [Description("WindowTransitionEffectSignal GetConnectionCount.")]
87 [Property("SPEC", "Tizen.NUI.WindowTransitionEffectSignal.GetConnectionCount M")]
88 [Property("SPEC_URL", "-")]
89 [Property("CRITERIA", "MR")]
90 [Property("AUTHOR", "guowei.wang@samsung.com")]
91 public void WindowTransitionEffectSignalGetConnectionCount()
93 tlog.Debug(tag, $"WindowTransitionEffectSignalGetConnectionCount START");
95 var testingTarget = new WindowTransitionEffectSignal(Window.Instance);
96 Assert.IsNotNull(testingTarget, "Should be not null!");
97 Assert.IsInstanceOf<WindowTransitionEffectSignal>(testingTarget, "Should be an Instance of WindowTransitionEffectSignal!");
101 testingTarget.GetConnectionCount();
105 tlog.Debug(tag, e.Message.ToString());
106 Assert.Fail("Caught Exception: Failed!");
109 testingTarget.Dispose();
111 tlog.Debug(tag, $"WindowTransitionEffectSignalGetConnectionCount END (OK)");
116 [Description("WindowTransitionEffectSignal Connect.")]
117 [Property("SPEC", "Tizen.NUI.WindowTransitionEffectSignal.Connect M")]
118 [Property("SPEC_URL", "-")]
119 [Property("CRITERIA", "MR")]
120 [Property("AUTHOR", "guowei.wang@samsung.com")]
121 public void WindowTransitionEffectSignalConnect()
123 tlog.Debug(tag, $"WindowTransitionEffectSignalConnect START");
125 var testingTarget = new WindowTransitionEffectSignal(Window.Instance);
126 Assert.IsNotNull(testingTarget, "Should be not null!");
127 Assert.IsInstanceOf<WindowTransitionEffectSignal>(testingTarget, "Should be an Instance of WindowTransitionEffectSignal!");
131 dummyCallback callback = OnDummyCallback;
132 testingTarget.Connect(callback);
133 testingTarget.Disconnect(callback);
137 tlog.Debug(tag, e.Message.ToString());
138 Assert.Fail("Caught Exception: Failed!");
141 testingTarget.Dispose();
143 tlog.Debug(tag, $"WindowTransitionEffectSignalConnect END (OK)");
148 [Description("WindowTransitionEffectSignal Emit.")]
149 [Property("SPEC", "Tizen.NUI.WindowTransitionEffectSignal.Emit M")]
150 [Property("SPEC_URL", "-")]
151 [Property("CRITERIA", "MR")]
152 [Property("AUTHOR", "guowei.wang@samsung.com")]
153 public void WindowTransitionEffectSignalEmit()
155 tlog.Debug(tag, $"WindowTransitionEffectSignalEmit START");
156 var currentPid = global::System.Diagnostics.Process.GetCurrentProcess().Id;
157 var currentTid = global::System.Threading.Thread.CurrentThread.ManagedThreadId;
159 tlog.Debug(tag, $"thread check! main pid={App.mainPid}, current pid={currentPid}, main tid={App.mainTid}, current tid={currentTid}");
161 using (Window window = new Window(new Rectangle(0, 0, 2, 2), false))
163 var testingTarget = new WindowTransitionEffectSignal(Window.Instance);
164 Assert.IsNotNull(testingTarget, "Should be not null!");
165 Assert.IsInstanceOf<WindowTransitionEffectSignal>(testingTarget, "Should be an Instance of WindowTransitionEffectSignal!");
169 testingTarget.Emit(window, 1, 1);
173 tlog.Debug(tag, e.Message.ToString());
174 Assert.Fail("Caught Exception: Failed!");
177 testingTarget.Dispose();
180 tlog.Debug(tag, $"WindowTransitionEffectSignalEmit END (OK)");