3 using NUnit.Framework.TUnit;
4 using Tizen.NUI.Components;
5 using Tizen.NUI.BaseComponents;
6 using System.Threading.Tasks;
8 namespace Tizen.NUI.Devel.Tests
10 using tlog = Tizen.Log;
13 [Description("public/Application/WatchTime")]
14 public class PublicWatchTimeTest
16 private const string tag = "NUITEST";
18 private bool IsWearable()
21 var result = Tizen.System.Information.TryGetValue("tizen.org/feature/profile", out value);
22 if (result && value.Equals("wearable"))
33 tlog.Info(tag, "Init() is called!");
39 tlog.Info(tag, "Destroy() is called!");
44 [Description("WatchTime constructor.")]
45 [Property("SPEC", "Tizen.NUI.WatchTime.WatchTime C")]
46 [Property("SPEC_URL", "-")]
47 [Property("CRITERIA", "CONSTR")]
48 [Property("AUTHOR", "guowei.wang@samsung.com")]
49 public void WatchTimeConstructor()
51 tlog.Debug(tag, $"WatchTimeConstructor START");
55 var testingTarget = new WatchTime();
56 Assert.IsNotNull(testingTarget, "should be not null");
57 Assert.IsInstanceOf<WatchTime>(testingTarget, "Should be an instance of WatchTime type.");
59 testingTarget.Dispose();
60 tlog.Debug(tag, $"WatchTimeConstructor END (OK)");
64 tlog.Debug(tag, $"WatchTimeConstructor END (OK)");
65 Assert.Pass("Not Supported profile");
71 [Description("WatchTime Day.")]
72 [Property("SPEC", "Tizen.NUI.WatchTime.Day A")]
73 [Property("SPEC_URL", "-")]
74 [Property("CRITERIA", "PRO")]
75 [Property("AUTHOR", "guowei.wang@samsung.com")]
76 public void WatchTimeDay()
78 tlog.Debug(tag, $"WatchTimeDay START");
82 var testingTarget = new WatchTime();
83 Assert.IsNotNull(testingTarget, "should be not null");
84 Assert.IsInstanceOf<WatchTime>(testingTarget, "Should be an instance of WatchTime type.");
86 int time = testingTarget.Day;
87 Assert.IsTrue(time > 0.0f);
89 testingTarget.Dispose();
90 tlog.Debug(tag, $"WatchTimeDay END (OK)");
94 tlog.Debug(tag, $"WatchTimeDay END (OK)");
95 Assert.Pass("Not Supported profile");
101 [Description("WatchTime DaylightSavingTimeStatus.")]
102 [Property("SPEC", "Tizen.NUI.WatchTime.DaylightSavingTimeStatus A")]
103 [Property("SPEC_URL", "-")]
104 [Property("CRITERIA", "PRO")]
105 [Property("AUTHOR", "guowei.wang@samsung.com")]
106 public void WatchTimeDaylightSavingTimeStatus()
108 tlog.Debug(tag, $"WatchTimeDaylightSavingTimeStatus START");
112 var testingTarget = new WatchTime();
113 Assert.IsNotNull(testingTarget, "should be not null");
114 Assert.IsInstanceOf<WatchTime>(testingTarget, "Should be an instance of WatchTime type.");
116 bool status = testingTarget.DaylightSavingTimeStatus;
117 Assert.AreEqual(false, status, "Should be the default value");
119 testingTarget.Dispose();
120 tlog.Debug(tag, $"WatchTimeDaylightSavingTimeStatus END (OK)");
124 tlog.Debug(tag, $"WatchTimeDaylightSavingTimeStatus END (OK)");
125 Assert.Pass("Not Supported profile");
131 [Description("WatchTime DayOfWeek.")]
132 [Property("SPEC", "Tizen.NUI.WatchTime.DayOfWeek A")]
133 [Property("SPEC_URL", "-")]
134 [Property("CRITERIA", "PRO")]
135 [Property("AUTHOR", "guowei.wang@samsung.com")]
136 public void WatchTimeDayOfWeek()
138 tlog.Debug(tag, $"WatchTimeDayOfWeek START");
142 var testingTarget = new WatchTime();
143 Assert.IsNotNull(testingTarget, "should be not null");
144 Assert.IsInstanceOf<WatchTime>(testingTarget, "Should be an instance of WatchTime type.");
146 int day = testingTarget.DayOfWeek;
147 Assert.IsTrue(day > 0.0f);
149 testingTarget.Dispose();
150 tlog.Debug(tag, $"WatchTimeDayOfWeek END (OK)");
154 tlog.Debug(tag, $"WatchTimeDayOfWeek END (OK)");
155 Assert.Pass("Not Supported profile");
161 [Description("WatchTime Hour.")]
162 [Property("SPEC", "Tizen.NUI.WatchTime.Hour A")]
163 [Property("SPEC_URL", "-")]
164 [Property("CRITERIA", "PRO")]
165 [Property("AUTHOR", "guowei.wang@samsung.com")]
166 public void WatchTimeHour()
168 tlog.Debug(tag, $"WatchTimeHour START");
172 var testingTarget = new WatchTime();
173 Assert.IsNotNull(testingTarget, "should be not null");
174 Assert.IsInstanceOf<WatchTime>(testingTarget, "Should be an instance of WatchTime type.");
176 int hour = testingTarget.Hour;
177 Assert.IsTrue(hour > 0.0f);
179 testingTarget.Dispose();
180 tlog.Debug(tag, $"WatchTimeHour END (OK)");
184 tlog.Debug(tag, $"WatchTimeHour END (OK)");
185 Assert.Pass("Not Supported profile");
191 [Description("WatchTime Hour24.")]
192 [Property("SPEC", "Tizen.NUI.WatchTime.Hour24 A")]
193 [Property("SPEC_URL", "-")]
194 [Property("CRITERIA", "PRO")]
195 [Property("AUTHOR", "guowei.wang@samsung.com")]
196 public void WatchTimeHour24()
198 tlog.Debug(tag, $"WatchTimeHour24 START");
202 var testingTarget = new WatchTime();
203 Assert.IsNotNull(testingTarget, "should be not null");
204 Assert.IsInstanceOf<WatchTime>(testingTarget, "Should be an instance of WatchTime type.");
206 int hour24 = testingTarget.Hour24;
207 Assert.IsTrue(hour24 >= 0.0f);
209 testingTarget.Dispose();
210 tlog.Debug(tag, $"WatchTimeHour24 END (OK)");
214 tlog.Debug(tag, $"WatchTimeHour24 END (OK)");
215 Assert.Pass("Not Supported profile");
221 [Description("WatchTime Millisecond.")]
222 [Property("SPEC", "Tizen.NUI.WatchTime.Millisecond A")]
223 [Property("SPEC_URL", "-")]
224 [Property("CRITERIA", "PRO")]
225 [Property("AUTHOR", "guowei.wang@samsung.com")]
226 public void WatchTimeMillisecond()
228 tlog.Debug(tag, $"WatchTimeMillisecond START");
232 var testingTarget = new WatchTime();
233 Assert.IsNotNull(testingTarget, "should be not null");
234 Assert.IsInstanceOf<WatchTime>(testingTarget, "Should be an instance of WatchTime type.");
236 int millisecond = testingTarget.Millisecond;
237 Assert.IsTrue(millisecond >= 0.0f);
239 testingTarget.Dispose();
240 tlog.Debug(tag, $"WatchTimeMillisecond END (OK)");
244 tlog.Debug(tag, $"WatchTimeMillisecond END (OK)");
245 Assert.Pass("Not Supported profile");
251 [Description("WatchTime Minute.")]
252 [Property("SPEC", "Tizen.NUI.WatchTime.Minute A")]
253 [Property("SPEC_URL", "-")]
254 [Property("CRITERIA", "PRO")]
255 [Property("AUTHOR", "guowei.wang@samsung.com")]
256 public void WatchTimeMinute()
258 tlog.Debug(tag, $"WatchTimeMinute START");
262 var testingTarget = new WatchTime();
263 Assert.IsNotNull(testingTarget, "should be not null");
264 Assert.IsInstanceOf<WatchTime>(testingTarget, "Should be an instance of WatchTime type.");
266 int minute = testingTarget.Minute;
267 Assert.IsTrue(minute >= 0.0f);
269 testingTarget.Dispose();
270 tlog.Debug(tag, $"WatchTimeMinute END (OK)");
274 tlog.Debug(tag, $"WatchTimeMinute END (OK)");
275 Assert.Pass("Not Supported profile");
281 [Description("WatchTime Month.")]
282 [Property("SPEC", "Tizen.NUI.WatchTime.Month A")]
283 [Property("SPEC_URL", "-")]
284 [Property("CRITERIA", "PRO")]
285 [Property("AUTHOR", "guowei.wang@samsung.com")]
286 public void WatchTimeMonth()
288 tlog.Debug(tag, $"WatchTimeMonth START");
292 var testingTarget = new WatchTime();
293 Assert.IsNotNull(testingTarget, "should be not null");
294 Assert.IsInstanceOf<WatchTime>(testingTarget, "Should be an instance of WatchTime type.");
296 int month = testingTarget.Month;
297 Assert.IsTrue(month > 0.0f);
299 testingTarget.Dispose();
300 tlog.Debug(tag, $"WatchTimeMonth END (OK)");
304 tlog.Debug(tag, $"WatchTimeMonth END (OK)");
305 Assert.Pass("Not Supported profile");
311 [Description("WatchTime Second.")]
312 [Property("SPEC", "Tizen.NUI.WatchTime.Second A")]
313 [Property("SPEC_URL", "-")]
314 [Property("CRITERIA", "PRO")]
315 [Property("AUTHOR", "guowei.wang@samsung.com")]
316 public void WatchTimeSecond()
318 tlog.Debug(tag, $"WatchTimeSecond START");
322 var testingTarget = new WatchTime();
323 Assert.IsNotNull(testingTarget, "should be not null");
324 Assert.IsInstanceOf<WatchTime>(testingTarget, "Should be an instance of WatchTime type.");
326 int second = testingTarget.Second;
327 Assert.IsTrue(second >= 0.0f);
329 testingTarget.Dispose();
330 tlog.Debug(tag, $"WatchTimeSecond END (OK)");
334 tlog.Debug(tag, $"WatchTimeSecond END (OK)");
335 Assert.Pass("Not Supported profile");
341 [Description("WatchTime TimeZone.")]
342 [Property("SPEC", "Tizen.NUI.WatchTime.TimeZone A")]
343 [Property("SPEC_URL", "-")]
344 [Property("CRITERIA", "PRO")]
345 [Property("AUTHOR", "guowei.wang@samsung.com")]
346 public void WatchTimeTimeZone()
348 tlog.Debug(tag, $"WatchTimeTimeZone START");
352 var testingTarget = new WatchTime();
353 Assert.IsNotNull(testingTarget, "should be not null");
354 Assert.IsInstanceOf<WatchTime>(testingTarget, "Should be an instance of WatchTime type.");
356 string zone = testingTarget.TimeZone;
357 Assert.IsNotEmpty(zone, "TimeZone is empty");
359 testingTarget.Dispose();
360 tlog.Debug(tag, $"WatchTimeTimeZone END (OK)");
364 tlog.Debug(tag, $"WatchTimeTimeZone END (OK)");
365 Assert.Pass("Not Supported profile");
371 [Description("WatchTime Year.")]
372 [Property("SPEC", "Tizen.NUI.WatchTime.Year A")]
373 [Property("SPEC_URL", "-")]
374 [Property("CRITERIA", "PRO")]
375 [Property("AUTHOR", "guowei.wang@samsung.com")]
376 public void WatchTimeYear()
378 tlog.Debug(tag, $"WatchTimeYear START");
382 var testingTarget = new WatchTime();
383 Assert.IsNotNull(testingTarget, "should be not null");
384 Assert.IsInstanceOf<WatchTime>(testingTarget, "Should be an instance of WatchTime type.");
386 int year = testingTarget.Year;
387 Assert.IsTrue(year > 0.0f);
389 testingTarget.Dispose();
390 tlog.Debug(tag, $"WatchTimeYear END (OK)");
394 tlog.Debug(tag, $"WatchTimeYear END (OK)");
395 Assert.Pass("Not Supported profile");