3 using NUnit.Framework.TUnit;
4 using Tizen.NUI.Components;
5 using Tizen.NUI.BaseComponents;
7 namespace Tizen.NUI.Devel.Tests
9 using static Tizen.NUI.WatchApplication;
10 using tlog = Tizen.Log;
13 [Description("internal/Application/WatchApplication")]
14 public class InternalWatchApplicationTest
16 private const string tag = "NUITEST";
17 private string resource = Tizen.Applications.Application.Current.DirectoryInfo.Resource;
19 private bool IsWearable()
22 var result = Tizen.System.Information.TryGetValue("tizen.org/feature/profile", out value);
23 if (result && value.Equals("wearable"))
34 tlog.Info(tag, "Init() is called!");
40 tlog.Info(tag, "Destroy() is called!");
44 [Description("WatchApplication new")]
45 [Property("AUTHOR", "guowei.wang@samsung.com")]
46 public void WatchApplicationNew()
48 tlog.Debug(tag, $"WatchApplicationNew START");
52 var testingTarget = Tizen.NUI.WatchApplication.New();
53 Assert.IsNotNull(testingTarget, "should be not null");
54 Assert.IsInstanceOf<WatchApplication>(testingTarget, "should be an instance of testing target class!");
56 testingTarget.Dispose();
57 tlog.Debug(tag, $"WatchApplicationNew END (OK)");
61 tlog.Debug(tag, $"WatchApplicationNew END (OK)");
62 Assert.Pass("Not Supported profile");
67 [Description("WatchApplication new with strings")]
68 [Property("AUTHOR", "guowei.wang@samsung.com")]
69 public void WatchApplicationNewWithStrings()
71 tlog.Debug(tag, $"WatchApplicationNewWithStrings START");
75 var dummy = new string[3];
76 var testingTarget = Tizen.NUI.WatchApplication.New(dummy);
77 Assert.IsNotNull(testingTarget, "should be not null");
78 Assert.IsInstanceOf<WatchApplication>(testingTarget, "should be an instance of testing target class!");
80 testingTarget.Dispose();
81 tlog.Debug(tag, $"WatchApplicationNewWithStrings END (OK)");
85 tlog.Debug(tag, $"WatchApplicationNewWithStrings END (OK)");
86 Assert.Pass("Not Supported profile");
91 [Description("WatchApplication new with strings and stylesheet")]
92 [Property("AUTHOR", "guowei.wang@samsung.com")]
93 public void WatchApplicationNewWithStringsAndStylesheet()
95 tlog.Debug(tag, $"WatchApplicationNewWithStringsAndStylesheet START");
99 var args = new string[] { "Dali-demo" };
100 var stylesheet = resource + "/style/Test_Style_Manager.json";
101 var testingTarget = Tizen.NUI.WatchApplication.New(args, stylesheet);
102 Assert.IsNotNull(testingTarget, "should be not null");
103 Assert.IsInstanceOf<WatchApplication>(testingTarget, "should be an instance of testing target class!");
105 testingTarget.Dispose();
106 tlog.Debug(tag, $"WatchApplicationNewWithStringsAndStylesheet END (OK)");
110 tlog.Debug(tag, $"WatchApplicationNewWithStringsAndStylesheet END (OK)");
111 Assert.Pass("Not Supported profile");
116 [Description("WatchApplication TimeTickEventArgs:Application get")]
117 [Property("AUTHOR", "guowei.wang@samsung.com")]
118 public void WatchApplicationTimeTickEventArgsApplicationGet()
120 tlog.Debug(tag, $"WatchApplicationTimeTickEventArgsApplicationGet START");
124 TimeTickEventArgs dummy = new TimeTickEventArgs();
125 var testingTarget = dummy.Application;
126 Assert.IsNotNull(testingTarget, "should be not null");
127 Assert.IsInstanceOf<Application>(testingTarget, "should be an instance of testing target class!");
129 testingTarget.Dispose();
130 tlog.Debug(tag, $"WatchApplicationTimeTickEventArgsApplicationGet END (OK)");
134 tlog.Debug(tag, $"WatchApplicationTimeTickEventArgsApplicationGet END (OK)");
135 Assert.Pass("Not Supported profile");
140 [Description("WatchApplication TimeTickEventArgs:Application set")]
141 [Property("AUTHOR", "guowei.wang@samsung.com")]
142 public void WatchApplicationTimeTickEventArgsApplicationSet()
144 tlog.Debug(tag, $"WatchApplicationTimeTickEventArgsApplicationSet START");
148 var dummyApplication = new Application();
149 Assert.IsNotNull(dummyApplication, "should be not null");
150 Assert.IsInstanceOf<Application>(dummyApplication, "should be an instance of testing target class!");
152 TimeTickEventArgs testingTarget = new TimeTickEventArgs();
153 testingTarget.Application = dummyApplication;
155 var result = testingTarget.Application;
156 Assert.IsNotNull(result, "should be not null.");
157 Assert.AreEqual(dummyApplication, result, "Retrieved result should be equal to dummyApplication. ");
159 tlog.Debug(tag, $"WatchApplicationTimeTickEventArgsApplicationSet END (OK)");
163 tlog.Debug(tag, $"WatchApplicationTimeTickEventArgsApplicationSet END (OK)");
164 Assert.Pass("Not Supported profile");
169 [Description("WatchApplication TimeTickEventArgs:WatchTime get")]
170 [Property("AUTHOR", "guowei.wang@samsung.com")]
171 public void WatchApplicationTimeTickEventArgsWatchTimeGet()
173 tlog.Debug(tag, $"WatchApplicationTimeTickEventArgsWatchTimeGet START");
177 TimeTickEventArgs dummy = new TimeTickEventArgs();
178 var testingTarget = dummy.WatchTime;
179 Assert.IsNotNull(testingTarget, "should be not null");
180 Assert.IsInstanceOf<WatchTime>(testingTarget, "should be an instance of testing target class!");
182 testingTarget.Dispose();
183 tlog.Debug(tag, $"WatchApplicationTimeTickEventArgsWatchTimeGet END (OK)");
187 tlog.Debug(tag, $"WatchApplicationTimeTickEventArgsWatchTimeGet END (OK)");
188 Assert.Pass("Not Supported profile");
193 [Description("WatchApplication TimeTickEventArgs:WatchTime set")]
194 [Property("AUTHOR", "guowei.wang@samsung.com")]
195 public void WatchApplicationTimeTickEventArgsWatchTimeSet()
197 tlog.Debug(tag, $"WatchApplicationTimeTickEventArgsWatchTimeSet START");
201 var dummyWatchTime = new WatchTime();
202 Assert.IsNotNull(dummyWatchTime, "should be not null");
203 Assert.IsInstanceOf<WatchTime>(dummyWatchTime, "should be an instance of testing target class!");
205 TimeTickEventArgs testingTarget = new TimeTickEventArgs();
206 testingTarget.WatchTime = dummyWatchTime;
208 var result = testingTarget.WatchTime;
209 Assert.IsNotNull(result, "should be not null.");
210 Assert.AreEqual(dummyWatchTime, result, "Retrieved result should be equal to dummyApplication. ");
212 tlog.Debug(tag, $"WatchApplicationTimeTickEventArgsWatchTimeSet END (OK)");
216 tlog.Debug(tag, $"WatchApplicationTimeTickEventArgsWatchTimeSet END (OK)");
217 Assert.Pass("Not Supported profile");
222 [Description("WatchApplication AmbientTickEventArgs:Application get")]
223 [Property("AUTHOR", "guowei.wang@samsung.com")]
224 public void WatchApplicationAmbientTickEventArgsApplicationGet()
226 tlog.Debug(tag, $"WatchApplicationAmbientTickEventArgsApplicationGet START");
230 AmbientTickEventArgs dummy = new AmbientTickEventArgs();
231 var testingTarget = dummy.Application;
232 Assert.IsNotNull(testingTarget, "should be not null");
233 Assert.IsInstanceOf<Application>(testingTarget, "should be an instance of testing target class!");
235 testingTarget.Dispose();
236 tlog.Debug(tag, $"WatchApplicationAmbientTickEventArgsApplicationGet END (OK)");
240 tlog.Debug(tag, $"WatchApplicationAmbientTickEventArgsApplicationGet END (OK)");
241 Assert.Pass("Not Supported profile");
246 [Description("WatchApplication AmbientTickEventArgs:Application set")]
247 [Property("AUTHOR", "guowei.wang@samsung.com")]
248 public void WatchApplicationAmbientTickEventArgsApplicationSet()
250 tlog.Debug(tag, $"WatchApplicationAmbientTickEventArgsApplicationSet START");
254 var application = new Application();
255 Assert.IsNotNull(application, "should be not null");
256 Assert.IsInstanceOf<Application>(application, "should be an instance of testing target class!");
258 AmbientTickEventArgs testingTarget = new AmbientTickEventArgs();
259 testingTarget.Application = application;
261 var result = testingTarget.Application;
262 Assert.IsNotNull(result, "should be not null.");
263 Assert.AreEqual(application, result, "Retrieved result should be equal to dummyApplication. ");
265 application.Dispose();
266 tlog.Debug(tag, $"WatchApplicationAmbientTickEventArgsApplicationSet END (OK)");
270 tlog.Debug(tag, $"WatchApplicationAmbientTickEventArgsApplicationSet END (OK)");
271 Assert.Pass("Not Supported profile");
276 [Description("WatchApplication AmbientTickEventArgs:WatchTime get")]
277 [Property("AUTHOR", "guowei.wang@samsung.com")]
278 public void WatchApplicationAmbientTickEventArgsWatchTimeGet()
280 tlog.Debug(tag, $"WatchApplicationAmbientTickEventArgsWatchTimeGet START");
284 AmbientTickEventArgs dummy = new AmbientTickEventArgs();
285 var testingTarget = dummy.WatchTime;
286 Assert.IsNotNull(testingTarget, "should be not null");
287 Assert.IsInstanceOf<WatchTime>(testingTarget, "should be an instance of testing target class!");
289 testingTarget.Dispose();
290 tlog.Debug(tag, $"WatchApplicationAmbientTickEventArgsWatchTimeGet END (OK)");
294 tlog.Debug(tag, $"WatchApplicationAmbientTickEventArgsWatchTimeGet END (OK)");
295 Assert.Pass("Not Supported profile");
300 [Description("WatchApplication AmbientTickEventArgs:WatchTime set")]
301 [Property("AUTHOR", "guowei.wang@samsung.com")]
302 public void WatchApplicationAmbientTickEventArgsWatchTimeSet()
304 tlog.Debug(tag, $"WatchApplicationAmbientTickEventArgsWatchTimeSet START");
308 var dummyWatchTime = new WatchTime();
309 Assert.IsNotNull(dummyWatchTime, "should be not null");
310 Assert.IsInstanceOf<WatchTime>(dummyWatchTime, "should be an instance of testing target class!");
312 AmbientTickEventArgs testingTarget = new AmbientTickEventArgs();
313 testingTarget.WatchTime = dummyWatchTime;
315 var result = testingTarget.WatchTime;
316 Assert.IsNotNull(result, "should be not null.");
317 Assert.AreEqual(dummyWatchTime, result, "Retrieved result should be equal to dummyApplication. ");
319 dummyWatchTime.Dispose();
320 tlog.Debug(tag, $"WatchApplicationAmbientTickEventArgsWatchTimeSet END (OK)");
324 tlog.Debug(tag, $"WatchApplicationAmbientTickEventArgsWatchTimeSet END (OK)");
325 Assert.Pass("Not Supported profile");
330 [Description("WatchApplication AmbientChangedEventArgs:Application get")]
331 [Property("AUTHOR", "guowei.wang@samsung.com")]
332 public void WatchApplicationAmbientChangedEventArgsApplicationGet()
334 tlog.Debug(tag, $"WatchApplicationAmbientChangedEventArgsApplicationGet START");
338 AmbientChangedEventArgs dummy = new AmbientChangedEventArgs();
339 var testingTarget = dummy.Application;
340 Assert.IsNotNull(testingTarget, "should be not null");
341 Assert.IsInstanceOf<Application>(testingTarget, "should be an instance of testing target class!");
343 testingTarget.Dispose();
344 tlog.Debug(tag, $"WatchApplicationAmbientChangedEventArgsApplicationGet END (OK)");
348 tlog.Debug(tag, $"WatchApplicationAmbientChangedEventArgsApplicationGet END (OK)");
349 Assert.Pass("Not Supported profile");
354 [Description("WatchApplication AmbientChangedEventArgs:Application set")]
355 [Property("AUTHOR", "guowei.wang@samsung.com")]
356 public void WatchApplicationAmbientChangedEventArgsApplicationSet()
358 tlog.Debug(tag, $"WatchApplicationAmbientChangedEventArgsApplicationSet START");
362 var dummyApplication = new Application();
363 Assert.IsNotNull(dummyApplication, "should be not null");
364 Assert.IsInstanceOf<Application>(dummyApplication, "should be an instance of testing target class!");
366 AmbientChangedEventArgs testingTarget = new AmbientChangedEventArgs();
367 testingTarget.Application = dummyApplication;
369 var result = testingTarget.Application;
370 Assert.IsNotNull(result, "should be not null.");
371 Assert.AreEqual(dummyApplication, result, "Retrieved result should be equal to dummyApplication. ");
373 dummyApplication.Dispose();
374 tlog.Debug(tag, $"WatchApplicationAmbientChangedEventArgsApplicationSet END (OK)");
378 tlog.Debug(tag, $"WatchApplicationAmbientChangedEventArgsApplicationSet END (OK)");
379 Assert.Pass("Not Supported profile");
384 [Description("WatchApplication AmbientChangedEventArgs:Changed get")]
385 [Property("AUTHOR", "guowei.wang@samsung.com")]
386 public void WatchApplicationAmbientChangedEventArgsChangedGet()
388 tlog.Debug(tag, $"WatchApplicationAmbientChangedEventArgsChangedGet START");
392 AmbientChangedEventArgs testingTarget = new AmbientChangedEventArgs();
393 var result = testingTarget.Changed;
394 Assert.IsNotNull(result, "should be not null");
396 tlog.Debug(tag, $"WatchApplicationAmbientChangedEventArgsChangedGet END (OK)");
400 tlog.Debug(tag, $"WatchApplicationAmbientChangedEventArgsChangedGet END (OK)");
401 Assert.Pass("Not Supported profile");
406 [Description("WatchApplication AmbientChangedEventArgs:Changed set")]
407 [Property("AUTHOR", "guowei.wang@samsung.com")]
408 public void WatchApplicationAmbientChangedEventArgsChangedSet()
410 tlog.Debug(tag, $"WatchApplicationAmbientChangedEventArgsChangedSet START");
414 AmbientChangedEventArgs testingTarget = new AmbientChangedEventArgs();
415 testingTarget.Changed = true;
417 var result = testingTarget.Changed;
418 Assert.IsNotNull(result, "should be not null.");
419 Assert.AreEqual(true, result, "Retrieved result should be equal to true. ");
420 tlog.Debug(tag, $"WatchApplicationAmbientChangedEventArgsChangedSet END (OK)");
424 tlog.Debug(tag, $"WatchApplicationAmbientChangedEventArgsChangedSet END (OK)");
425 Assert.Pass("Not Supported profile");