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/KeyboardRepeatSettingsChangedSignal")]
13 public class InternalKeyboardRepeatSettingsChangedSignalTest
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("KeyboardRepeatSettingsChangedSignal constructor.")]
38 [Property("SPEC", "Tizen.NUI.KeyboardRepeatSettingsChangedSignal.KeyboardRepeatSettingsChangedSignal C")]
39 [Property("SPEC_URL", "-")]
40 [Property("CRITERIA", "CONSTR")]
41 [Property("AUTHOR", "guowei.wang@samsung.com")]
42 public void KeyboardRepeatSettingsChangedSignalConstructor()
44 tlog.Debug(tag, $"KeyboardRepeatSettingsChangedSignalConstructor START");
46 var testingTarget = new KeyboardRepeatSettingsChangedSignal(Window.Instance);
47 Assert.IsNotNull(testingTarget, "Should be not null!");
48 Assert.IsInstanceOf<KeyboardRepeatSettingsChangedSignal>(testingTarget, "Should be an Instance of KeyboardRepeatSettingsChangedSignal!");
50 testingTarget.Dispose();
51 tlog.Debug(tag, $"KeyboardRepeatSettingsChangedSignalConstructor END (OK)");
56 [Description("KeyboardRepeatSettingsChangedSignal Empty.")]
57 [Property("SPEC", "Tizen.NUI.KeyboardRepeatSettingsChangedSignal.Empty M")]
58 [Property("SPEC_URL", "-")]
59 [Property("CRITERIA", "MR")]
60 [Property("AUTHOR", "guowei.wang@samsung.com")]
61 public void KeyboardRepeatSettingsChangedSignalEmpty()
63 tlog.Debug(tag, $"KeyboardRepeatSettingsChangedSignalEmpty START");
65 var testingTarget = new KeyboardRepeatSettingsChangedSignal(Window.Instance);
66 Assert.IsNotNull(testingTarget, "Should be not null!");
67 Assert.IsInstanceOf<KeyboardRepeatSettingsChangedSignal>(testingTarget, "Should be an Instance of KeyboardRepeatSettingsChangedSignal!");
71 testingTarget.Empty();
75 tlog.Debug(tag, e.Message.ToString());
76 Assert.Fail("Caught Exception: Failed!");
79 testingTarget.Dispose();
80 tlog.Debug(tag, $"KeyboardRepeatSettingsChangedSignalEmpty END (OK)");
85 [Description("KeyboardRepeatSettingsChangedSignal GetConnectionCount.")]
86 [Property("SPEC", "Tizen.NUI.KeyboardRepeatSettingsChangedSignal.GetConnectionCount M")]
87 [Property("SPEC_URL", "-")]
88 [Property("CRITERIA", "MR")]
89 [Property("AUTHOR", "guowei.wang@samsung.com")]
90 public void KeyboardRepeatSettingsChangedSignalGetConnectionCount()
92 tlog.Debug(tag, $"KeyboardRepeatSettingsChangedSignalGetConnectionCount START");
94 var testingTarget = new KeyboardRepeatSettingsChangedSignal(Window.Instance);
95 Assert.IsNotNull(testingTarget, "Should be not null!");
96 Assert.IsInstanceOf<KeyboardRepeatSettingsChangedSignal>(testingTarget, "Should be an Instance of KeyboardRepeatSettingsChangedSignal!");
100 testingTarget.GetConnectionCount();
104 tlog.Debug(tag, e.Message.ToString());
105 Assert.Fail("Caught Exception: Failed!");
108 testingTarget.Dispose();
109 tlog.Debug(tag, $"KeyboardRepeatSettingsChangedSignalGetConnectionCount END (OK)");
114 [Description("KeyboardRepeatSettingsChangedSignal Connect.")]
115 [Property("SPEC", "Tizen.NUI.KeyboardRepeatSettingsChangedSignal.Connect M")]
116 [Property("SPEC_URL", "-")]
117 [Property("CRITERIA", "MR")]
118 [Property("AUTHOR", "guowei.wang@samsung.com")]
119 public void KeyboardRepeatSettingsChangedSignalConnect()
121 tlog.Debug(tag, $"KeyboardRepeatSettingsChangedSignalConnect START");
123 var testingTarget = new KeyboardRepeatSettingsChangedSignal(Window.Instance);
124 Assert.IsNotNull(testingTarget, "Should be not null!");
125 Assert.IsInstanceOf<KeyboardRepeatSettingsChangedSignal>(testingTarget, "Should be an Instance of KeyboardRepeatSettingsChangedSignal!");
129 dummyCallback callback = OnDummyCallback;
130 testingTarget.Connect(callback);
131 testingTarget.Disconnect(callback);
135 tlog.Debug(tag, e.Message.ToString());
136 Assert.Fail("Caught Exception: Failed!");
139 testingTarget.Dispose();
140 tlog.Debug(tag, $"KeyboardRepeatSettingsChangedSignalConnect END (OK)");
145 [Description("KeyboardRepeatSettingsChangedSignal Emit.")]
146 [Property("SPEC", "Tizen.NUI.KeyboardRepeatSettingsChangedSignal.Emit M")]
147 [Property("SPEC_URL", "-")]
148 [Property("CRITERIA", "MR")]
149 [Property("AUTHOR", "guowei.wang@samsung.com")]
151 public void KeyboardRepeatSettingsChangedSignalEmit()
153 tlog.Debug(tag, $"KeyboardRepeatSettingsChangedSignalEmit START");
154 var currentPid = global::System.Diagnostics.Process.GetCurrentProcess().Id;
155 var currentTid = global::System.Threading.Thread.CurrentThread.ManagedThreadId;
157 tlog.Debug(tag, $"thread check! main pid={App.mainPid}, current pid={currentPid}, main tid={App.mainTid}, current tid={currentTid}");
159 var testingTarget = new KeyboardRepeatSettingsChangedSignal(Window.Instance);
160 Assert.IsNotNull(testingTarget, "Should be not null!");
161 Assert.IsInstanceOf<KeyboardRepeatSettingsChangedSignal>(testingTarget, "Should be an Instance of KeyboardRepeatSettingsChangedSignal!");
165 testingTarget.Emit();
169 tlog.Debug(tag, e.Message.ToString());
170 Assert.Fail("Caught Exception: Failed!");
173 testingTarget.Dispose();
174 tlog.Debug(tag, $"KeyboardRepeatSettingsChangedSignalEmit END (OK)");