3 using NUnit.Framework.TUnit;
4 using Tizen.NUI.Components;
5 using Tizen.NUI.BaseComponents;
7 namespace Tizen.NUI.Devel.Tests.testcase
9 using tlog = Tizen.Log;
12 [Description("public/Common/PropertyNotifySignal")]
13 class PublicPropertyNotifySignalTest
15 private const string tag = "NUITEST";
16 private delegate void dummyCallback();
17 private void OnDummyCallback()
23 tlog.Info(tag, "Init() is called!");
29 tlog.Info(tag, "Destroy() is called!");
34 [Description("PropertyNotifySignal constructor.")]
35 [Property("SPEC", "Tizen.NUI.PropertyNotifySignal.PropertyNotifySignal C")]
36 [Property("SPEC_URL", "-")]
37 [Property("CRITERIA", "CONSTR")]
38 [Property("AUTHOR", "guowei.wang@samsung.com")]
39 public void PropertyNotifySignalConstructor()
41 tlog.Debug(tag, $"PropertyNotifySignalConstructor START");
43 var testingTarget = new PropertyNotifySignal();
44 Assert.IsNotNull(testingTarget, "Should be not null!");
45 Assert.IsInstanceOf<PropertyNotifySignal>(testingTarget, "Should be an Instance of PropertyNotifySignal!");
47 testingTarget.Dispose();
48 tlog.Debug(tag, $"PropertyNotifySignalConstructor END (OK)");
53 [Description("PropertyNotifySignal Empty")]
54 [Property("SPEC", "Tizen.NUI.PropertyNotifySignal.Empty M")]
55 [Property("SPEC_URL", "-")]
56 [Property("CRITERIA", "MR")]
57 [Property("AUTHOR", "guowei.wang@samsung.com")]
58 public void PropertyNotifySignalEmpty()
60 tlog.Debug(tag, $"PropertyNotifySignalEmpty START");
62 var testingTarget = new PropertyNotifySignal();
63 Assert.IsNotNull(testingTarget, "Should be not null!");
64 Assert.IsInstanceOf<PropertyNotifySignal>(testingTarget, "Should be an Instance of PropertyNotifySignal!");
66 Assert.IsTrue(testingTarget.Empty());
68 testingTarget.Dispose();
69 tlog.Debug(tag, $"PropertyNotifySignalEmpty END (OK)");
74 [Description("PropertyNotifySignal GetConnectionCount")]
75 [Property("SPEC", "Tizen.NUI.PropertyNotifySignal.GetConnectionCount M")]
76 [Property("SPEC_URL", "-")]
77 [Property("CRITERIA", "MR")]
78 [Property("AUTHOR", "guowei.wang@samsung.com")]
79 public void PropertyNotifySignalGetConnectionCount()
81 tlog.Debug(tag, $"PropertyNotifySignalGetConnectionCount START");
83 var testingTarget = new PropertyNotifySignal();
84 Assert.IsNotNull(testingTarget, "Should be not null!");
85 Assert.IsInstanceOf<PropertyNotifySignal>(testingTarget, "Should be an Instance of PropertyNotifySignal!");
87 Assert.AreEqual(0, testingTarget.GetConnectionCount(), "Should be zero!");
89 testingTarget.Dispose();
90 tlog.Debug(tag, $"PropertyNotifySignalGetConnectionCount END (OK)");
95 [Description("PropertyNotifySignal Connect")]
96 [Property("SPEC", "Tizen.NUI.PropertyNotifySignal.Connect M")]
97 [Property("SPEC_URL", "-")]
98 [Property("CRITERIA", "MR")]
99 [Property("AUTHOR", "guowei.wang@samsung.com")]
100 public void PropertyNotifySignalConnect()
102 tlog.Debug(tag, $"PropertyNotifySignalConnect START");
104 var testingTarget = new PropertyNotifySignal();
105 Assert.IsNotNull(testingTarget, "Should be not null!");
106 Assert.IsInstanceOf<PropertyNotifySignal>(testingTarget, "Should be an Instance of PropertyNotifySignal!");
108 dummyCallback callback = OnDummyCallback;
109 testingTarget.Connect(callback);
110 testingTarget.Disconnect(callback);
112 testingTarget.Dispose();
113 tlog.Debug(tag, $"PropertyNotifySignalConnect END (OK)");
118 [Description("PropertyNotifySignal Disconnect")]
119 [Property("SPEC", "Tizen.NUI.PropertyNotifySignal.Disconnect M")]
120 [Property("SPEC_URL", "-")]
121 [Property("CRITERIA", "MR")]
122 [Property("AUTHOR", "guowei.wang@samsung.com")]
123 public void PropertyNotifySignalDisconnect()
125 tlog.Debug(tag, $"PropertyNotifySignalDisconnect START");
127 var testingTarget = new PropertyNotifySignal();
128 Assert.IsNotNull(testingTarget, "Should be not null!");
129 Assert.IsInstanceOf<PropertyNotifySignal>(testingTarget, "Should be an Instance of PropertyNotifySignal!");
131 dummyCallback callback = OnDummyCallback;
132 testingTarget.Connect(callback);
133 testingTarget.Disconnect(callback);
135 testingTarget.Dispose();
136 tlog.Debug(tag, $"PropertyNotifySignalDisconnect END (OK)");
141 [Description("PropertyNotifySignal Emit")]
142 [Property("SPEC", "Tizen.NUI.PropertyNotifySignal.Emit M")]
143 [Property("SPEC_URL", "-")]
144 [Property("CRITERIA", "MR")]
145 [Property("AUTHOR", "guowei.wang@samsung.com")]
146 public void PropertyNotifySignalEmit()
148 tlog.Debug(tag, $"PropertyNotifySignalEmit START");
150 var testingTarget = new PropertyNotifySignal();
151 Assert.IsNotNull(testingTarget, "Should be not null!");
152 Assert.IsInstanceOf<PropertyNotifySignal>(testingTarget, "Should be an Instance of PropertyNotifySignal!");
154 View view = new View()
156 Size = new Size(200, 200),
157 BackgroundColor = Color.Red
159 Window.Instance.Add(view);
161 var dummy = view.AddPropertyNotification("PositionX", PropertyCondition.GreaterThan(100.0f));
162 Assert.IsNotNull(dummy, "Should be not null!");
163 Assert.IsInstanceOf<PropertyNotification>(dummy, "Should be an Instance of PropertyNotification!");
165 testingTarget.Emit(dummy);
167 testingTarget.Dispose();
170 tlog.Debug(tag, $"PropertyNotifySignalEmit END (OK)");