1 using System.Threading;
2 using System.Threading.Tasks;
6 // /opt/usr/data/settings/Ringtones/ringtone_sdk.mp3
7 namespace SystemSettingsUnitTest
10 public static class SystemSettingsTestInput
14 private const int nStringDataSize = 100;
25 static string[,] string_data = new string[5, 100];
27 public static void InitStringValue()
29 string[,] init_data = new string[,] {
31 "/opt/usr/data/settings/Ringtones/ringtone_sdk.mp3",
32 "/opt/usr/data/settings/Wallpapers/home_003.png",
33 "/opt/usr/data/settings/Wallpapers/home_003.png",
36 "/opt/usr/data/settings/Ringtones/Ringtone.ogg",
37 "/opt/usr/data/settings/Wallpaper/BG_preview_02.png",
38 "/opt/usr/data/settings/Wallpaper/BG_preview_02.png",
41 "/opt/usr/data/settings/Ringtones/ringtone_sdk.mp3",
42 "/opt/usr/data/settings/Wallpapers/home_003.png",
43 "/opt/usr/data/settings/Wallpapers/home_003.png",
46 "/opt/usr/data/settings/Ringtones/ringtone_sdk.mp3",
47 "/opt/usr/data/settings/Wallpapers/home_003.png",
48 "/opt/usr/data/settings/Wallpapers/home_003.png",
52 for (int i = 0; i < 4; i++)
54 for (int j = 0; j < 3; j++)
56 string_data[i, j] = init_data[i, j];
60 string_data[(int)eProfileValue.PROFILE_MOBILE, (int)Tizen.System.SystemSettingsKeys.SoundNotification] = "/opt/usr/data/settings/Alerts/General notification_sdk.wav";
61 string_data[(int)eProfileValue.PROFILE_WEARABLE, (int)Tizen.System.SystemSettingsKeys.SoundNotification] = "/opt/usr/data/settings/Alerts/Notification.ogg";
62 string_data[(int)eProfileValue.PROFILE_TV, (int)Tizen.System.SystemSettingsKeys.SoundNotification] = "/opt/usr/data/settings/Alerts/General notification_sdk.wav";
63 string_data[(int)eProfileValue.PROFILE_COMMON, (int)Tizen.System.SystemSettingsKeys.SoundNotification] = "/opt/usr/data/settings/Alerts/General notification_sdk.wav";
65 string_data[(int)eProfileValue.PROFILE_MOBILE, (int)Tizen.System.SystemSettingsKeys.EmailAlertRingtone] = "/opt/usr/data/settings/Alerts/General notification_sdk.wav";
66 string_data[(int)eProfileValue.PROFILE_WEARABLE, (int)Tizen.System.SystemSettingsKeys.EmailAlertRingtone] = "/opt/usr/data/settings/Alerts/Notification.ogg";
67 string_data[(int)eProfileValue.PROFILE_TV, (int)Tizen.System.SystemSettingsKeys.EmailAlertRingtone] = "/opt/usr/data/settings/Alerts/General notification_sdk.wav";
68 string_data[(int)eProfileValue.PROFILE_COMMON, (int)Tizen.System.SystemSettingsKeys.EmailAlertRingtone] = "/opt/usr/data/settings/Alerts/General notification_sdk.wav";
71 static bool isStarted = false;
73 public static string GetStringValue(int enum_val)
82 eProfileValue profile_val = eProfileValue.PROFILE_MOBILE;
83 Information.TryGetValue<string>("tizen.org/feature/profile", out strProfile);
84 if (string.Compare(strProfile, "mobile") == 0)
86 profile_val = eProfileValue.PROFILE_MOBILE;
88 else if (string.Compare(strProfile, "wearable") == 0)
90 profile_val = eProfileValue.PROFILE_WEARABLE;
92 else if (string.Compare(strProfile, "tv") == 0)
94 profile_val = eProfileValue.PROFILE_TV;
96 else if (string.Compare(strProfile, "common") == 0)
98 profile_val = eProfileValue.PROFILE_COMMON;
100 return string_data[(int)profile_val, enum_val];
106 //[Description("Tizen.System.SystemSettings Tests")]
107 public static class SystemSettingsTests
110 public static void Init()
112 //LogUtils.Write(LogUtils.DEBUG, LogUtils.TAG, "Preconditions for each TEST");
116 public static void Destroy()
118 //LogUtils.Write(LogUtils.DEBUG, LogUtils.TAG, "Postconditions for each TEST");
125 // IncomingCallRingtone
128 //[Description("Test if set/get for SystemSettings:IncomingCallRingtone is working properly")]
129 //[Property("SPEC", "Tizen.System.SystemSettings.IncomingCallRingtone A")]
130 //[Property("SPEC_URL", "-")]
131 //[Property("CRITERIA", "PRW")]
132 //[Property("AUTHOR", "Aditya Aswani, a.aswani@samsung.com")]
133 public static void IncomingCallRingtone_READ_WRITE()
136 LogUtils.StartTest();
138 Assert.IsInstanceOf<string>(Tizen.System.SystemSettings.IncomingCallRingtone, "IncomingCallRingtone_READ_WRITE: IncomingCallRingtone not an instance of string");
139 string preValue = Tizen.System.SystemSettings.IncomingCallRingtone;
140 var setValue = SystemSettingsTestInput.GetStringValue((int)Tizen.System.SystemSettingsKeys.IncomingCallRingtone);
142 Tizen.System.SystemSettings.IncomingCallRingtone = setValue;
143 var getValue = Tizen.System.SystemSettings.IncomingCallRingtone;
144 Assert.IsTrue(setValue.CompareTo(getValue) == 0, "IncomingCallRingtone_READ_WRITE: Set value and get value of the property should be same.");
145 Tizen.System.SystemSettings.IncomingCallRingtone = preValue;
147 } catch (NotSupportedException) {
148 bool isSupport = true;
149 Information.TryGetValue<bool>("tizen.org/feature/systemsetting.incoming_call", out isSupport);
150 Assert.IsTrue(isSupport == false, "Invalid NotSupportedException");
151 Tizen.Log.Debug("CS-SYSTEM-SETTINGS", ">>>>>> NotSupport(tizen.org/feature/systemsetting.incoming_call)");
152 LogUtils.NotSupport();
156 private static bool s_incomingCallRingtoneCallbackCalled = false;
157 private static readonly string s_incomingCallRingtoneValue = SystemSettingsTestInput.GetStringValue((int) Tizen.System.SystemSettingsKeys.IncomingCallRingtone);
160 //[Description("Check if callback to SystemSettings:IncomingCallRingtoneChanged event is called")]
161 //[Property("SPEC", "Tizen.System.SystemSettings.IncomingCallRingtoneChanged E")]
162 //[Property("SPEC_URL", "-")]
163 //[Property("CRITERIA", "EVL")]
164 //[Property("AUTHOR", "Aditya Aswani, a.aswani@samsung.com")]
165 public static async Task IncomingCallRingtoneChanged_CHECK_EVENT()
168 LogUtils.StartTest();
170 Tizen.System.SystemSettings.IncomingCallRingtoneChanged += OnIncomingCallRingtoneChanged;
171 string preValue = Tizen.System.SystemSettings.IncomingCallRingtone;
172 Tizen.System.SystemSettings.IncomingCallRingtone = s_incomingCallRingtoneValue;
173 await Task.Delay(2000);
174 Assert.IsTrue(s_incomingCallRingtoneCallbackCalled, "IncomingCallRingtoneChanged_CHECK_EVENT: EventHandler added. Not getting called");
175 s_incomingCallRingtoneCallbackCalled = false;
176 Tizen.System.SystemSettings.IncomingCallRingtoneChanged -= OnIncomingCallRingtoneChanged;
177 Tizen.System.SystemSettings.IncomingCallRingtone = s_incomingCallRingtoneValue;
178 await Task.Delay(2000);
179 Assert.IsFalse(s_incomingCallRingtoneCallbackCalled, "IncomingCallRingtoneChanged_CHECK_EVENT: EventHandler removed. Still getting called");
180 Tizen.System.SystemSettings.IncomingCallRingtone = preValue;
182 } catch (NotSupportedException) {
183 bool isSupport = true;
184 Information.TryGetValue<bool>("tizen.org/feature/systemsetting.incoming_call", out isSupport);
185 Assert.IsTrue(isSupport == false, "Invalid NotSupportedException");
186 Tizen.Log.Debug("CS-SYSTEM-SETTINGS", ">>>>>> NotSupport(tizen.org/feature/systemsetting.incoming_call)");
187 LogUtils.NotSupport();
190 private static void OnIncomingCallRingtoneChanged(object sender, Tizen.System.IncomingCallRingtoneChangedEventArgs e)
192 s_incomingCallRingtoneCallbackCalled = true;
193 Assert.IsInstanceOf<string>(e.Value, "OnIncomingCallRingtoneChanged: IncomingCallRingtone not an instance of string");
194 Assert.IsTrue(s_incomingCallRingtoneValue.CompareTo(e.Value) == 0, "OnIncomingCallRingtoneChanged: The callback should receive the latest value for the property.");
197 // WallpaperHomeScreen
200 //[Description("Test if set/get for SystemSettings:WallpaperHomeScreen is working properly")]
201 //[Property("SPEC", "Tizen.System.SystemSettings.WallpaperHomeScreen A")]
202 //[Property("SPEC_URL", "-")]
203 //[Property("CRITERIA", "PRW")]
204 //[Property("AUTHOR", "Aditya Aswani, a.aswani@samsung.com")]
205 public static void WallpaperHomeScreen_READ_WRITE()
208 LogUtils.StartTest();
210 Assert.IsInstanceOf<string>(Tizen.System.SystemSettings.WallpaperHomeScreen, "WallpaperHomeScreen_READ_WRITE: WallpaperHomeScreen not an instance of string");
211 string preValue = Tizen.System.SystemSettings.WallpaperHomeScreen;
212 var setValue = SystemSettingsTestInput.GetStringValue((int)Tizen.System.SystemSettingsKeys.WallpaperHomeScreen);
214 Tizen.System.SystemSettings.WallpaperHomeScreen = setValue;
215 var getValue = Tizen.System.SystemSettings.WallpaperHomeScreen;
216 Assert.IsTrue(setValue.CompareTo(getValue) == 0, "WallpaperHomeScreen_READ_WRITE: Set value and get value of the property should be same.");
219 Information.TryGetValue<string>("tizen.org/feature/profile", out strProfile);
220 if (string.Compare(strProfile, "mobile") == 0)
221 Tizen.System.SystemSettings.WallpaperHomeScreen = preValue;
224 } catch (NotSupportedException) {
225 bool isSupport = true;
226 Information.TryGetValue<bool>("tizen.org/feature/systemsetting.home_screen", out isSupport);
227 Assert.IsTrue(isSupport == false, "Invalid NotSupportedException");
228 Tizen.Log.Debug("CS-SYSTEM-SETTINGS", ">>>>>> NotSupport(tizen.org/feature/systemsetting.home_screen)");
229 LogUtils.NotSupport();
233 private static bool s_wallpaperHomeScreenCallbackCalled = false;
234 private static readonly string s_wallpaperHomeScreenValue = SystemSettingsTestInput.GetStringValue((int)Tizen.System.SystemSettingsKeys.WallpaperHomeScreen);
237 //[Description("Check if callback to SystemSettings:WallpaperHomeScreenChanged event is called")]
238 //[Property("SPEC", "Tizen.System.SystemSettings.WallpaperHomeScreenChanged E")]
239 //[Property("SPEC_URL", "-")]
240 //[Property("CRITERIA", "EVL")]
241 //[Property("AUTHOR", "Aditya Aswani, a.aswani@samsung.com")]
242 public static async Task WallpaperHomeScreenChanged_CHECK_EVENT()
245 LogUtils.StartTest();
247 Tizen.System.SystemSettings.WallpaperHomeScreenChanged += OnWallpaperHomeScreenChanged;
248 string preValue = Tizen.System.SystemSettings.WallpaperHomeScreen;
249 Tizen.System.SystemSettings.WallpaperHomeScreen = s_wallpaperHomeScreenValue;
250 await Task.Delay(2000);
251 Assert.IsTrue(s_wallpaperHomeScreenCallbackCalled, "WallpaperHomeScreenChanged_CHECK_EVENT: EventHandler added. Not getting called");
252 s_wallpaperHomeScreenCallbackCalled = false;
253 Tizen.System.SystemSettings.WallpaperHomeScreenChanged -= OnWallpaperHomeScreenChanged;
254 Tizen.System.SystemSettings.WallpaperHomeScreen = s_wallpaperHomeScreenValue;
255 await Task.Delay(2000);
256 Assert.IsFalse(s_wallpaperHomeScreenCallbackCalled, "WallpaperHomeScreenChanged_CHECK_EVENT: EventHandler removed. Still getting called");
259 Information.TryGetValue<string>("tizen.org/feature/profile", out strProfile);
260 if (string.Compare(strProfile, "mobile") == 0)
261 Tizen.System.SystemSettings.WallpaperHomeScreen = preValue;
263 } catch (NotSupportedException) {
264 bool isSupport = true;
265 Information.TryGetValue<bool>("tizen.org/feature/systemsetting.home_screen", out isSupport);
266 Assert.IsTrue(isSupport == false, "Invalid NotSupportedException");
267 Tizen.Log.Debug("CS-SYSTEM-SETTINGS", ">>>>>> NotSupport(tizen.org/feature/systemsetting.home_screen)");
268 LogUtils.NotSupport();
271 private static void OnWallpaperHomeScreenChanged(object sender, Tizen.System.WallpaperHomeScreenChangedEventArgs e)
273 s_wallpaperHomeScreenCallbackCalled = true;
274 Assert.IsInstanceOf<string>(e.Value, "OnWallpaperHomeScreenChanged: WallpaperHomeScreen not an instance of string");
275 Assert.IsTrue(s_wallpaperHomeScreenValue.CompareTo(e.Value) == 0, "OnWallpaperHomeScreenChanged: The callback should receive the latest value for the property.");
278 //WallpaperLockScreen
281 //[Description("Test if set/get for SystemSettings:WallpaperLockScreen is working properly")]
282 //[Property("SPEC", "Tizen.System.SystemSettings.WallpaperLockScreen A")]
283 //[Property("SPEC_URL", "-")]
284 //[Property("CRITERIA", "PRW")]
285 //[Property("AUTHOR", "Aditya Aswani, a.aswani@samsung.com")]
286 public static void WallpaperLockScreen_READ_WRITE()
289 LogUtils.StartTest();
291 Assert.IsInstanceOf<string>(Tizen.System.SystemSettings.WallpaperLockScreen, "WallpaperLockScreen_READ_WRITE: WallpaperLockScreen not an instance of string");
292 string preValue = Tizen.System.SystemSettings.WallpaperLockScreen;
293 var setValue = SystemSettingsTestInput.GetStringValue((int)Tizen.System.SystemSettingsKeys.WallpaperLockScreen);
294 Tizen.System.SystemSettings.WallpaperLockScreen = setValue;
295 var getValue = Tizen.System.SystemSettings.WallpaperLockScreen;
296 Assert.IsTrue(setValue.CompareTo(getValue) == 0, "WallpaperLockScreen_READ_WRITE: Set value and get value of the property should be same.");
299 Information.TryGetValue<string>("tizen.org/feature/profile", out strProfile);
300 if (string.Compare(strProfile, "mobile") == 0)
301 Tizen.System.SystemSettings.WallpaperLockScreen = preValue;
305 } catch (NotSupportedException) {
306 bool isSupport = true;
307 Information.TryGetValue<bool>("tizen.org/feature/systemsetting.lock_screen", out isSupport);
308 Assert.IsTrue(isSupport == false, "Invalid NotSupportedException");
309 Tizen.Log.Debug("CS-SYSTEM-SETTINGS", ">>>>>> NotSupport(tizen.org/feature/systemsetting.lock_screen)");
310 LogUtils.NotSupport();
314 private static bool s_wallpaperLockScreenCallbackCalled = false;
315 private static readonly string s_wallpaperLockScreenValue = SystemSettingsTestInput.GetStringValue((int)Tizen.System.SystemSettingsKeys.WallpaperLockScreen);
317 //[Description("Check if callback to SystemSettings:WallpaperLockScreenChanged event is called")]
318 //[Property("SPEC", "Tizen.System.SystemSettings.WallpaperLockScreenChanged E")]
319 //[Property("SPEC_URL", "-")]
320 //[Property("CRITERIA", "EVL")]
321 //[Property("AUTHOR", "Aditya Aswani, a.aswani@samsung.com")]
322 public static async Task WallpaperLockScreenChanged_CHECK_EVENT()
325 LogUtils.StartTest();
327 Tizen.System.SystemSettings.WallpaperLockScreenChanged += OnWallpaperLockScreenChanged;
328 string preValue = Tizen.System.SystemSettings.WallpaperLockScreen;
329 Tizen.System.SystemSettings.WallpaperLockScreen = s_wallpaperLockScreenValue;
330 await Task.Delay(2000);
331 Assert.IsTrue(s_wallpaperLockScreenCallbackCalled, "WallpaperLockScreenChanged_CHECK_EVENT: EventHandler added. Not getting called");
332 s_wallpaperLockScreenCallbackCalled = false;
333 Tizen.System.SystemSettings.WallpaperLockScreenChanged -= OnWallpaperLockScreenChanged;
334 Tizen.System.SystemSettings.WallpaperLockScreen = s_wallpaperLockScreenValue;
335 await Task.Delay(2000);
336 Assert.IsFalse(s_wallpaperLockScreenCallbackCalled, "WallpaperLockScreenChanged_CHECK_EVENT: EventHandler removed. Still getting called");
339 Information.TryGetValue<string>("tizen.org/feature/profile", out strProfile);
340 if (string.Compare(strProfile, "mobile") == 0)
341 Tizen.System.SystemSettings.WallpaperLockScreen = preValue;
344 } catch (NotSupportedException) {
345 bool isSupport = true;
346 Information.TryGetValue<bool>("tizen.org/feature/systemsetting.lock_screen", out isSupport);
347 Assert.IsTrue(isSupport == false, "Invalid NotSupportedException");
348 Tizen.Log.Debug("CS-SYSTEM-SETTINGS", ">>>>>> NotSupport(tizen.org/feature/systemsetting.lock_screen)");
349 LogUtils.NotSupport();
352 private static void OnWallpaperLockScreenChanged(object sender, Tizen.System.WallpaperLockScreenChangedEventArgs e)
354 s_wallpaperLockScreenCallbackCalled = true;
355 Assert.IsInstanceOf<string>(e.Value, "OnWallpaperLockScreenChanged: WallpaperLockScreen not an instance of string");
356 Assert.IsTrue(s_wallpaperLockScreenValue.CompareTo(e.Value) == 0, "OnWallpaperLockScreenChanged: The callback should receive the latest value for the property.");
362 //[Description("Test if set/get for SystemSettings:FontSize is working properly")]
363 //[Property("SPEC", "Tizen.System.SystemSettings.FontSize A")]
364 //[Property("SPEC_URL", "-")]
365 //[Property("CRITERIA", "PRE")]
366 //[Property("AUTHOR", "Aditya Aswani, a.aswani@samsung.com")]
367 public static void FontSize_READ_WRITE_ALL()
369 LogUtils.StartTest();
371 Assert.IsInstanceOf<Tizen.System.SystemSettingsFontSize>(Tizen.System.SystemSettings.FontSize, "FontSize_READ_WRITE_ALL: FontSize not an instance of SystemSettingsFontSize");
373 SystemSettingsFontSize preValue = Tizen.System.SystemSettings.FontSize;
374 Tizen.System.SystemSettings.FontSize = Tizen.System.SystemSettingsFontSize.Small;
375 var getValue = Tizen.System.SystemSettings.FontSize;
376 Assert.IsTrue(getValue == Tizen.System.SystemSettingsFontSize.Small, "FontSize_READ_WRITE_ALL: Set value and get value of the property should be same.");
379 Tizen.System.SystemSettings.FontSize = Tizen.System.SystemSettingsFontSize.Normal;
380 getValue = Tizen.System.SystemSettings.FontSize;
381 Assert.IsTrue(getValue == Tizen.System.SystemSettingsFontSize.Normal, "FontSize_READ_WRITE_ALL: Set value and get value of the property should be same.");
384 Tizen.System.SystemSettings.FontSize = Tizen.System.SystemSettingsFontSize.Large;
385 getValue = Tizen.System.SystemSettings.FontSize;
386 Assert.IsTrue(getValue == Tizen.System.SystemSettingsFontSize.Large, "FontSize_READ_WRITE_ALL: Set value and get value of the property should be same.");
389 Tizen.System.SystemSettings.FontSize = Tizen.System.SystemSettingsFontSize.Huge;
390 getValue = Tizen.System.SystemSettings.FontSize;
391 Assert.IsTrue(getValue == Tizen.System.SystemSettingsFontSize.Huge, "FontSize_READ_WRITE_ALL: Set value and get value of the property should be same.");
394 Tizen.System.SystemSettings.FontSize = Tizen.System.SystemSettingsFontSize.Giant;
395 getValue = Tizen.System.SystemSettings.FontSize;
396 Assert.IsTrue(getValue == Tizen.System.SystemSettingsFontSize.Giant, "FontSize_READ_WRITE_ALL: Set value and get value of the property should be same.");
397 Tizen.System.SystemSettings.FontSize = preValue;
401 private static bool s_fontSizeSmallCallbackCalled = false;
402 private static SystemSettingsFontSize preFontValue;
405 //[Description("Check if callback to SystemSettings:FontSizeChanged event is called")]
406 //[Property("SPEC", "Tizen.System.SystemSettings.FontSizeChanged E")]
407 //[Property("SPEC_URL", "-")]
408 //[Property("CRITERIA", "EVL")]
409 //[Property("AUTHOR", "Aditya Aswani, a.aswani@samsung.com")]
410 public static async Task FontSizeChanged_CHECK_EVENT_SMALL()
412 LogUtils.StartTest();
414 Tizen.System.SystemSettings.FontSizeChanged += OnFontSizeChangedSmall;
415 //SystemSettingsFontSize preValue = Tizen.System.SystemSettings.FontSize;
416 preFontValue = Tizen.System.SystemSettings.FontSize;
417 Tizen.System.SystemSettings.FontSize = Tizen.System.SystemSettingsFontSize.Small;
418 await Task.Delay(2000);
419 Tizen.System.SystemSettings.FontSizeChanged -= OnFontSizeChangedSmall;
420 Assert.IsTrue(s_fontSizeSmallCallbackCalled, "FontSizeChanged_CHECK_EVENT_SMALL: EventHandler added. Not getting called");
421 s_fontSizeSmallCallbackCalled = false;
422 Tizen.System.SystemSettings.FontSize = Tizen.System.SystemSettingsFontSize.Small;
423 await Task.Delay(2000);
424 Assert.IsFalse(s_fontSizeSmallCallbackCalled, "FontSizeChanged_CHECK_EVENT_SMALL: EventHandler removed. Still getting called");
425 //Tizen.System.SystemSettings.FontSize = preValue;
428 private static void OnFontSizeChangedSmall(object sender, Tizen.System.FontSizeChangedEventArgs e)
430 s_fontSizeSmallCallbackCalled = true;
431 Assert.IsInstanceOf<Tizen.System.SystemSettingsFontSize>(e.Value, "OnFontSizeChangedSmall: FontSize not an instance of SystemSettingsFontSize");
432 Assert.IsTrue(e.Value == Tizen.System.SystemSettingsFontSize.Small, "OnFontSizeChangedSmall: The callback should receive the latest value for the property.");
435 private static bool s_fontSizeNormalCallbackCalled = false;
438 //[Description("Check if callback to SystemSettings:FontSizeChanged event is called")]
439 //[Property("SPEC", "Tizen.System.SystemSettings.FontSizeChanged E")]
440 //[Property("SPEC_URL", "-")]
441 //[Property("CRITERIA", "EVL")]
442 //[Property("AUTHOR", "Aditya Aswani, a.aswani@samsung.com")]
443 public static async Task FontSizeChanged_CHECK_EVENT_NORMAL()
445 LogUtils.StartTest();
447 Tizen.System.SystemSettings.FontSizeChanged += OnFontSizeChangedNormal;
448 await Task.Delay(2000);
449 //SystemSettingsFontSize preValue = Tizen.System.SystemSettings.FontSize;
450 Tizen.System.SystemSettings.FontSize = Tizen.System.SystemSettingsFontSize.Normal;
451 await Task.Delay(2000);
452 Tizen.System.SystemSettings.FontSizeChanged -= OnFontSizeChangedNormal;
453 await Task.Delay(2000);
454 Assert.IsTrue(s_fontSizeNormalCallbackCalled, "FontSizeChanged_CHECK_EVENT_NORMAL: EventHandler added. Not getting called");
455 s_fontSizeNormalCallbackCalled = false;
456 Tizen.System.SystemSettings.FontSize = Tizen.System.SystemSettingsFontSize.Normal;
457 await Task.Delay(2000);
458 Assert.IsFalse(s_fontSizeNormalCallbackCalled, "FontSizeChanged_CHECK_EVENT_NORMAL: EventHandler removed. Still getting called");
459 //Tizen.System.SystemSettings.FontSize = preValue;
462 private static void OnFontSizeChangedNormal(object sender, Tizen.System.FontSizeChangedEventArgs e)
464 s_fontSizeNormalCallbackCalled = true;
465 // string format = string.Format("Current Tizen.System.SystemSettings.FontSize : {0} , actual value {1}", Tizen.System.SystemSettings.FontSize, e.Value);
466 // Tizen.Log.Debug("CS-SYSTEM-SETTINGS", format);
468 Assert.IsInstanceOf<Tizen.System.SystemSettingsFontSize>(e.Value, "OnFontSizeChangedNormal: FontSize not an instance of SystemSettingsFontSize");
469 Assert.IsTrue(e.Value == Tizen.System.SystemSettingsFontSize.Normal, "OnFontSizeChangedNormal: The callback should receive the latest value for the property.");
472 private static bool s_fontSizeLargeCallbackCalled = false;
475 //[Description("Check if callback to SystemSettings:FontSizeChanged event is called")]
476 //[Property("SPEC", "Tizen.System.SystemSettings.FontSizeChanged E")]
477 //[Property("SPEC_URL", "-")]
478 //[Property("CRITERIA", "EVL")]
479 //[Property("AUTHOR", "Aditya Aswani, a.aswani@samsung.com")]
480 public static async Task FontSizeChanged_CHECK_EVENT_LARGE()
482 LogUtils.StartTest();
484 Tizen.System.SystemSettings.FontSizeChanged += OnFontSizeChangedLarge;
485 await Task.Delay(2000);
486 //SystemSettingsFontSize preValue = Tizen.System.SystemSettings.FontSize;
487 Tizen.System.SystemSettings.FontSize = Tizen.System.SystemSettingsFontSize.Large;
488 await Task.Delay(2000);
489 Tizen.System.SystemSettings.FontSizeChanged -= OnFontSizeChangedLarge;
490 await Task.Delay(2000);
491 Assert.IsTrue(s_fontSizeLargeCallbackCalled, "FontSizeChanged_CHECK_EVENT_LARGE: EventHandler added. Not getting called");
492 s_fontSizeLargeCallbackCalled = false;
493 Tizen.System.SystemSettings.FontSize = Tizen.System.SystemSettingsFontSize.Large;
494 await Task.Delay(2000);
495 Assert.IsFalse(s_fontSizeLargeCallbackCalled, "FontSizeChanged_CHECK_EVENT_LARGE: EventHandler removed. Still getting called");
496 //Tizen.System.SystemSettings.FontSize = preValue;
499 private static void OnFontSizeChangedLarge(object sender, Tizen.System.FontSizeChangedEventArgs e)
501 s_fontSizeLargeCallbackCalled = true;
502 //string format = string.Format("Current Tizen.System.SystemSettings.FontSize : {0} , actual value {1}", Tizen.System.SystemSettings.FontSize, e.Value);
503 //Tizen.Log.Debug("CS-SYSTEM-SETTINGS", format);
505 Assert.IsInstanceOf<Tizen.System.SystemSettingsFontSize>(e.Value, "OnFontSizeChangedLarge: FontSizeChanged not an instance of SystemSettingsFontSize");
506 Assert.IsTrue(e.Value == Tizen.System.SystemSettingsFontSize.Large, "OnFontSizeChangedLarge: The callback should receive the latest value for the property.");
509 private static bool s_fontSizeHugeCallbackCalled = false;
512 //[Description("Check if callback to SystemSettings:FontSizeChanged event is called")]
513 //[Property("SPEC", "Tizen.System.SystemSettings.FontSizeChanged E")]
514 //[Property("SPEC_URL", "-")]
515 //[Property("CRITERIA", "EVL")]
516 //[Property("AUTHOR", "Aditya Aswani, a.aswani@samsung.com")]
517 public static async Task FontSizeChanged_CHECK_EVENT_HUGE()
519 LogUtils.StartTest();
521 Tizen.System.SystemSettings.FontSizeChanged += OnFontSizeChangedHuge;
522 await Task.Delay(2000);
523 //SystemSettingsFontSize preValue = Tizen.System.SystemSettings.FontSize;
524 Tizen.System.SystemSettings.FontSize = Tizen.System.SystemSettingsFontSize.Huge;
525 await Task.Delay(2000);
526 Tizen.System.SystemSettings.FontSizeChanged -= OnFontSizeChangedHuge;
527 await Task.Delay(2000);
528 Assert.IsTrue(s_fontSizeHugeCallbackCalled, "FontSizeChanged_CHECK_EVENT_HUGE: EventHandler added. Not getting called");
529 s_fontSizeHugeCallbackCalled = false;
530 Tizen.System.SystemSettings.FontSize = Tizen.System.SystemSettingsFontSize.Huge;
531 await Task.Delay(2000);
532 Assert.IsFalse(s_fontSizeHugeCallbackCalled, "FontSizeChanged_CHECK_EVENT_HUGE: EventHandler removed. Still getting called");
533 //Tizen.System.SystemSettings.FontSize = preValue;
536 private static void OnFontSizeChangedHuge(object sender, Tizen.System.FontSizeChangedEventArgs e)
538 s_fontSizeHugeCallbackCalled = true;
539 //string format = string.Format("Current Tizen.System.SystemSettings.FontSize : {0} , actual value {1}", Tizen.System.SystemSettings.FontSize, e.Value);
540 //Tizen.Log.Debug("CS-SYSTEM-SETTINSG", format);
542 Assert.IsInstanceOf<Tizen.System.SystemSettingsFontSize>(e.Value, "OnFontSizeChangedHuge: FontSize not an instance of SystemSettingsFontSize");
543 Assert.IsTrue(e.Value == Tizen.System.SystemSettingsFontSize.Huge, "OnFontSizeChangedHuge: The callback should receive the latest value for the property.");
546 private static bool s_fontSizeGiantCallbackCalled = false;
549 //[Description("Check if callback to SystemSettings:FontSizeChanged event is called")]
550 //[Property("SPEC", "Tizen.System.SystemSettings.FontSizeChanged E")]
551 //[Property("SPEC_URL", "-")]
552 //[Property("CRITERIA", "EVL")]
553 //[Property("AUTHOR", "Aditya Aswani, a.aswani@samsung.com")]
554 public static async Task FontSizeChanged_CHECK_EVENT_GIANT()
556 LogUtils.StartTest();
558 Tizen.System.SystemSettings.FontSizeChanged += OnFontSizeChangedGiant;
559 await Task.Delay(2000);
560 //SystemSettingsFontSize preValue = Tizen.System.SystemSettings.FontSize;
561 Tizen.System.SystemSettings.FontSize = Tizen.System.SystemSettingsFontSize.Giant;
562 await Task.Delay(2000);
563 Tizen.System.SystemSettings.FontSizeChanged -= OnFontSizeChangedGiant;
564 await Task.Delay(2000);
565 Assert.IsTrue(s_fontSizeGiantCallbackCalled, "FontSizeChanged_CHECK_EVENT_GIANT: EventHandler added. Not getting called");
566 s_fontSizeGiantCallbackCalled = false;
567 Tizen.System.SystemSettings.FontSize = Tizen.System.SystemSettingsFontSize.Giant;
568 await Task.Delay(2000);
569 Assert.IsFalse(s_fontSizeGiantCallbackCalled, "FontSizeChanged_CHECK_EVENT_GIANT: EventHandler removed. Still getting called");
570 //Tizen.System.SystemSettings.FontSize = preValue;
571 Tizen.System.SystemSettings.FontSize = preFontValue;
574 private static void OnFontSizeChangedGiant(object sender, Tizen.System.FontSizeChangedEventArgs e)
576 s_fontSizeGiantCallbackCalled = true;
577 //string format = string.Format("Current Tizen.System.SystemSettings.FontSize : {0} , actual value {1}", Tizen.System.SystemSettings.FontSize, e.Value);
578 //Tizen.Log.Debug("CS-SYSTEM-SETTINGS", format);
580 Assert.IsInstanceOf<Tizen.System.SystemSettingsFontSize>(e.Value, "OnFontSizeChangedGiant: FontSize not an instance of SystemSettingsFontSize");
581 Assert.IsTrue(e.Value == Tizen.System.SystemSettingsFontSize.Giant, "OnFontSizeChangedGiant: The callback should receive the latest value for the property.");
587 //[Description("Test if set/get for SystemSettings:FontType is working properly")]
588 //[Property("SPEC", "Tizen.System.SystemSettings.FontType A")]
589 //[Property("SPEC_URL", "-")]
590 //[Property("CRITERIA", "PRW")]
591 //[Property("AUTHOR", "Aditya Aswani, a.aswani@samsung.com")]
592 public static void FontType_READ_WRITE()
594 LogUtils.StartTest();
596 Assert.IsInstanceOf<string>(Tizen.System.SystemSettings.FontType, "FontType_READ_WRITE: FontType not an instance of string");
597 string setValue = "BreezeSans";
598 string preValue = Tizen.System.SystemSettings.FontType;
600 Tizen.System.SystemSettings.FontType = setValue;
601 var getValue = Tizen.System.SystemSettings.FontType;
602 Assert.IsTrue(getValue.CompareTo(setValue) == 0, "FontType_READ_WRITE: Set value and get value of the property should be same.");
607 Information.TryGetValue<string>("tizen.org/feature/profile", out strProfile);
608 if (string.Compare(strProfile, "mobile") == 0)
609 Tizen.System.SystemSettings.FontType = preValue;
615 private static bool s_fontTypeCallbackCalled = false;
616 private static readonly string s_fontTypeValue = "BreezeSans";
619 //[Description("Check if callback to SystemSettings:FontTypeChanged event is called")]
620 //[Property("SPEC", "Tizen.System.SystemSettings.FontTypeChanged E")]
621 //[Property("SPEC_URL", "-")]
622 //[Property("CRITERIA", "EVL")]
623 //[Property("AUTHOR", "Aditya Aswani, a.aswani@samsung.com")]
624 public static async Task FontTypeChanged_CHECK_EVENT()
626 LogUtils.StartTest();
628 Tizen.System.SystemSettings.FontTypeChanged += OnFontTypeChanged;
629 string preValue = Tizen.System.SystemSettings.FontType;
630 Tizen.System.SystemSettings.FontType = s_fontTypeValue;
631 await Task.Delay(2000);
632 Assert.IsTrue(s_fontTypeCallbackCalled, "FontTypeChanged_CHECK_EVENT: EventHandler added. Not getting called");
633 s_fontTypeCallbackCalled = false;
634 Tizen.System.SystemSettings.FontTypeChanged -= OnFontTypeChanged;
635 Tizen.System.SystemSettings.FontType = s_fontTypeValue;
636 await Task.Delay(2000);
637 Assert.IsFalse(s_fontTypeCallbackCalled, "FontTypeChanged_CHECK_EVENT: EventHandler removed. Still getting called");
638 Tizen.System.SystemSettings.FontType = preValue;
641 private static void OnFontTypeChanged(object sender, Tizen.System.FontTypeChangedEventArgs e)
643 s_fontTypeCallbackCalled = true;
644 Assert.IsInstanceOf<string>(e.Value, "OnFontTypeChanged: FontType not an instance of string");
645 Assert.IsTrue(s_fontTypeValue.CompareTo(e.Value) == 0, "OnFontTypeChanged: The callback should receive the latest value for the property.");
651 //[Description("Test if set/get for SystemSettings:MotionActivationEnabled is working properly")]
652 //[Property("SPEC", "Tizen.System.SystemSettings.MotionActivationEnabled A")]
653 //[Property("SPEC_URL", "-")]
654 //[Property("CRITERIA", "PRW")]
655 //[Property("AUTHOR", "Aditya Aswani, a.aswani@samsung.com")]
656 public static void MotionActivationEnabled_READ_WRITE()
658 LogUtils.StartTest();
660 bool preValue = Tizen.System.SystemSettings.MotionActivationEnabled;
661 Assert.IsInstanceOf<bool>(Tizen.System.SystemSettings.MotionActivationEnabled, "MotionActivationEnabled_READ_WRITE: MotionActivationEnabled not an instance of bool");
662 Tizen.System.SystemSettings.MotionActivationEnabled = true;
663 Assert.IsTrue(Tizen.System.SystemSettings.MotionActivationEnabled, "MotionActivation_READ_WRITE: Set value and get value of the property should be same.");
664 Tizen.System.SystemSettings.MotionActivationEnabled = false;
665 Assert.IsFalse(Tizen.System.SystemSettings.MotionActivationEnabled, "MotionActivation_READ_WRITE: Set value and get value of the property should be same.");
666 Tizen.System.SystemSettings.MotionActivationEnabled = preValue;
670 private static bool s_motionActivationCallbackCalled = false;
671 private static bool s_motionActivationValue = !Tizen.System.SystemSettings.MotionActivationEnabled;
674 //[Description("Check if callback to SystemSettings:MotionActivationSettingChanged event is called")]
675 //[Property("SPEC", "Tizen.System.SystemSettings.MotionActivationSettingChanged E")]
676 //[Property("SPEC_URL", "-")]
677 //[Property("CRITERIA", "EVL")]
678 //[Property("AUTHOR", "Aditya Aswani, a.aswani@samsung.com")]
679 public static async Task MotionActivationSettingChanged_CHECK_EVENT()
681 LogUtils.StartTest();
683 Tizen.System.SystemSettings.MotionActivationSettingChanged += OnMotionActivationChanged;
684 bool preValue = Tizen.System.SystemSettings.MotionActivationEnabled;
685 Tizen.System.SystemSettings.MotionActivationEnabled = s_motionActivationValue;
686 await Task.Delay(2000);
687 Assert.IsTrue(s_motionActivationCallbackCalled, "MotionActivationSettingChanged_CHECK_EVENT: EventHandler added. Not getting called");
688 s_motionActivationCallbackCalled = false;
689 s_motionActivationValue = !s_motionActivationValue;
690 Tizen.System.SystemSettings.MotionActivationEnabled = s_motionActivationValue;
691 await Task.Delay(2000);
692 Assert.IsTrue(s_motionActivationCallbackCalled, "MotionActivationSettingChanged_CHECK_EVENT: EventHandler added. Not getting called");
693 s_motionActivationCallbackCalled = false;
695 Tizen.System.SystemSettings.MotionActivationSettingChanged -= OnMotionActivationChanged;
696 Tizen.System.SystemSettings.MotionActivationEnabled = s_motionActivationValue;
697 await Task.Delay(2000);
698 Assert.IsFalse(s_motionActivationCallbackCalled, "MotionActivationSettingChanged_CHECK_EVENT: EventHandler removed. Still getting called");
699 Tizen.System.SystemSettings.MotionActivationEnabled = preValue;
702 private static void OnMotionActivationChanged(object sender, Tizen.System.MotionActivationSettingChangedEventArgs e)
704 s_motionActivationCallbackCalled = true;
705 Assert.IsInstanceOf<bool>(e.Value, "OnMotionActivationChanged: MotionActivationEnabled not an instance of bool");
706 Assert.IsTrue(e.Value == s_motionActivationValue, "OnMotionActivationChanged: The callback should receive the latest value for the property.");
709 // EmailAlertRingtone
712 //[Description("Test if set/get for SystemSettings:EmailAlertRingtone is working properly")]
713 //[Property("SPEC", "Tizen.System.SystemSettings.EmailAlertRingtone A")]
714 //[Property("SPEC_URL", "-")]
715 //[Property("CRITERIA", "PRW")]
716 //[Property("AUTHOR", "Aditya Aswani, a.aswani@samsung.com")]
717 public static void EmailAlertRingtone_READ_WRITE()
720 LogUtils.StartTest();
722 Assert.IsInstanceOf<string>(Tizen.System.SystemSettings.EmailAlertRingtone, "EmailAlertRingtone_READ_WRITE: EmailAlertRingtone not an instance of string");
723 var setValue = SystemSettingsTestInput.GetStringValue((int)Tizen.System.SystemSettingsKeys.EmailAlertRingtone);
724 string preValue = Tizen.System.SystemSettings.EmailAlertRingtone;
725 Tizen.System.SystemSettings.EmailAlertRingtone = setValue;
726 var getValue = Tizen.System.SystemSettings.EmailAlertRingtone;
727 Assert.IsTrue(setValue.CompareTo(getValue) == 0, "EmailAlertRingtone_READ_WRITE: Set value and get value of the property should be same.");
728 Tizen.System.SystemSettings.EmailAlertRingtone = preValue;
730 } catch (NotSupportedException) {
731 bool isSupport = true;
732 Information.TryGetValue<bool>("tizen.org/feature/systemsetting.notification_email", out isSupport);
733 Assert.IsTrue(isSupport == false, "Invalid NotSupportedException");
734 Tizen.Log.Debug("CS-SYSTEM-SETTINGS", ">>>>>> NotSupport(tizen.org/feature/systemsetting.notification_email)");
735 LogUtils.NotSupport();
740 private static bool s_emailAlertRingtoneCallbackCalled = false;
741 private static readonly string s_emailAlertRingtoneValue = SystemSettingsTestInput.GetStringValue((int)Tizen.System.SystemSettingsKeys.EmailAlertRingtone);
744 //[Description("Check if callback to SystemSettings:EmailAlertRingtoneChanged event is called")]
745 //[Property("SPEC", "Tizen.System.SystemSettings.EmailAlertRingtoneChanged E")]
746 //[Property("SPEC_URL", "-")]
747 //[Property("CRITERIA", "EVL")]
748 //[Property("AUTHOR", "Aditya Aswani, a.aswani@samsung.com")]
749 public static async Task EmailAlertRingtoneChanged_CHECK_EVENT()
752 LogUtils.StartTest();
754 Tizen.System.SystemSettings.EmailAlertRingtoneChanged += OnEmailAlertRingtoneChanged;
755 string preValue = Tizen.System.SystemSettings.EmailAlertRingtone;
756 Tizen.System.SystemSettings.EmailAlertRingtone = s_emailAlertRingtoneValue;
757 await Task.Delay(2000);
758 Assert.IsTrue(s_emailAlertRingtoneCallbackCalled, "EmailAlertRingtoneChanged_CHECK_EVENT: EventHandler added. Not getting called");
759 s_emailAlertRingtoneCallbackCalled = false;
760 Tizen.System.SystemSettings.EmailAlertRingtoneChanged -= OnEmailAlertRingtoneChanged;
761 Tizen.System.SystemSettings.EmailAlertRingtone = s_emailAlertRingtoneValue;
762 await Task.Delay(2000);
763 Assert.IsFalse(s_emailAlertRingtoneCallbackCalled, "EmailAlertRingtoneChanged_CHECK_EVENT: EventHandler removed. Still getting called");
764 Tizen.System.SystemSettings.EmailAlertRingtone = preValue;
766 } catch (NotSupportedException) {
767 bool isSupport = true;
768 Information.TryGetValue<bool>("tizen.org/feature/systemsetting.notification_email", out isSupport);
769 Assert.IsTrue(isSupport == false, "Invalid NotSupportedException");
770 Tizen.Log.Debug("CS-SYSTEM-SETTINGS", ">>>>>> NotSupport(tizen.org/feature/systemsetting.notification_email)");
771 LogUtils.NotSupport();
774 private static void OnEmailAlertRingtoneChanged(object sender, Tizen.System.EmailAlertRingtoneChangedEventArgs e)
776 s_emailAlertRingtoneCallbackCalled = true;
777 Assert.IsInstanceOf<string>(e.Value, "OnEmailAlertRingtoneChanged: EmailAlertRingtone not an instance of string");
778 Assert.IsTrue(s_emailAlertRingtoneValue.CompareTo(e.Value) == 0, "OnEmailAlertRingtoneChanged: The callback should receive the latest value for the property.");
781 // Data3GNetworkEnabled
784 //[Description("Test if set/get for SystemSettings:Data3GNetworkEnabled is working properly")]
785 //[Property("SPEC", "Tizen.System.SystemSettings.Data3GNetworkEnabled A")]
786 //[Property("SPEC_URL", "-")]
787 //[Property("CRITERIA", "PRW")]
788 //[Property("AUTHOR", "Aditya Aswani, a.aswani@samsung.com")]
789 public static void Data3GNetworkEnabled_READ_WRITE()
791 LogUtils.StartTest();
793 bool preValue = Tizen.System.SystemSettings.Data3GNetworkEnabled;
794 Assert.IsInstanceOf<bool>(Tizen.System.SystemSettings.Data3GNetworkEnabled, "Data3GNetworkEnabled_READ_WRITE: Data3GNetworkEnabled not an instance of bool");
795 Tizen.System.SystemSettings.Data3GNetworkEnabled = true;
796 Assert.IsTrue(Tizen.System.SystemSettings.Data3GNetworkEnabled, "Data3GNetworkEnabled_READ_WRITE: Set value and get value of the property should be same");
797 Tizen.System.SystemSettings.Data3GNetworkEnabled = false;
798 Assert.IsFalse(Tizen.System.SystemSettings.Data3GNetworkEnabled, "Data3GNetworkEnabled_READ_WRITE: Set value and get value of the property should be same");
799 Tizen.System.SystemSettings.Data3GNetworkEnabled = preValue;
803 private static bool s_data3GNetworkCallbackCalled = false;
804 private static bool s_data3GNetworkSettingValue = !Tizen.System.SystemSettings.Data3GNetworkEnabled;
807 //[Description("Check if callback to SystemSettings:Data3GNetworkSettingChanged event is called")]
808 //[Property("SPEC", "Tizen.System.SystemSettings.Data3GNetworkSettingChanged E")]
809 //[Property("SPEC_URL", "-")]
810 //[Property("CRITERIA", "EVL")]
811 //[Property("AUTHOR", "Aditya Aswani, a.aswani@samsung.com")]
812 public static async Task Data3GNetworkSettingChanged_CHECK_EVENT()
814 LogUtils.StartTest();
816 Tizen.System.SystemSettings.Data3GNetworkSettingChanged += OnData3GNetworkSettingChanged;
817 bool preValue = Tizen.System.SystemSettings.Data3GNetworkEnabled;
818 Tizen.System.SystemSettings.Data3GNetworkEnabled = s_data3GNetworkSettingValue;
819 await Task.Delay(2000);
820 Assert.IsTrue(s_data3GNetworkCallbackCalled, "Data3GNetworkSettingChanged_CHECK_EVENT: EventHandler added. Not getting called");
822 s_data3GNetworkSettingValue = !s_data3GNetworkSettingValue;
823 s_data3GNetworkCallbackCalled = false;
824 Tizen.System.SystemSettings.Data3GNetworkEnabled = s_data3GNetworkSettingValue;
825 await Task.Delay(2000);
826 Assert.IsTrue(s_data3GNetworkCallbackCalled, "Data3GNetworkSettingChanged_CHECK_EVENT: EventHandler added. Not getting called");
827 s_data3GNetworkCallbackCalled = false;
829 Tizen.System.SystemSettings.Data3GNetworkSettingChanged -= OnData3GNetworkSettingChanged;
830 Tizen.System.SystemSettings.Data3GNetworkEnabled = s_data3GNetworkSettingValue;
831 await Task.Delay(2000);
832 Assert.IsFalse(s_data3GNetworkCallbackCalled, "Data3GNetworkSettingChanged_CHECK_EVENT: EventHandler removed. Still getting called");
833 Tizen.System.SystemSettings.Data3GNetworkEnabled = preValue;
836 private static void OnData3GNetworkSettingChanged(object sender, Tizen.System.Data3GNetworkSettingChangedEventArgs e)
838 s_data3GNetworkCallbackCalled = true;
839 Assert.IsInstanceOf<bool>(e.Value, "OnData3GNetworkSettingChanged: Data3GNetworkEnabled not an instance of bool");
840 Assert.IsTrue(e.Value == s_data3GNetworkSettingValue, "OnData3GNetworkSettingChanged: The callback should receive the latest value for the property.");
846 //[Description("Test if set/get for SystemSettings:LockscreenApp is working properly")]
847 //[Property("SPEC", "Tizen.System.SystemSettings.LockscreenApp A")]
848 //[Property("SPEC_URL", "-")]
849 //[Property("CRITERIA", "PRW")]
850 //[Property("AUTHOR", "Aditya Aswani, a.aswani@samsung.com")]
851 public static void LockscreenApp_READ_WRITE()
854 LogUtils.StartTest();
856 Assert.IsInstanceOf<string>(Tizen.System.SystemSettings.LockScreenApp, "LockscreenApp_READ_WRITE: LockscreenApp not an instance of string");
857 var setValue = "org.tizen.lockscreen";
858 string preValue = Tizen.System.SystemSettings.LockScreenApp;
859 Tizen.System.SystemSettings.LockScreenApp = setValue;
860 var getValue = Tizen.System.SystemSettings.LockScreenApp;
861 Assert.IsTrue(setValue.CompareTo(getValue) == 0, "LockscreenApp_READ_WRITE: Set value and get value of the property should be same.");
862 Tizen.System.SystemSettings.LockScreenApp = preValue;
864 } catch (NotSupportedException) {
865 bool isSupport = true;
866 Information.TryGetValue<bool>("tizen.org/feature/systemsetting.lock_screen", out isSupport);
867 Assert.IsTrue(isSupport == false, "Invalid NotSupportedException");
868 Tizen.Log.Debug("CS-SYSTEM-SETTINGS", ">>>>>> NotSupport(tizen.org/feature/systemsetting.lock_screen)");
869 LogUtils.NotSupport();
873 private static bool s_lockScreenAppCallbackCalled = false;
874 private static readonly string s_lockscreenAppValue = "org.tizen.lockscreen";
877 //[Description("Check if callback to SystemSettings:LockscreenAppChanged event is called")]
878 //[Property("SPEC", "Tizen.System.SystemSettings.LockscreenAppChanged E")]
879 //[Property("SPEC_URL", "-")]
880 //[Property("CRITERIA", "EVL")]
881 //[Property("AUTHOR", "Aditya Aswani, a.aswani@samsung.com")]
882 public static async Task LockscreenAppChanged_CHECK_EVENT()
885 LogUtils.StartTest();
887 Tizen.System.SystemSettings.LockScreenAppChanged += OnLockscreenAppChanged;
888 string preValue = Tizen.System.SystemSettings.LockScreenApp;
889 Tizen.System.SystemSettings.LockScreenApp = s_lockscreenAppValue;
890 await Task.Delay(2000);
891 Assert.IsTrue(s_lockScreenAppCallbackCalled, "LockscreenAppChanged_CHECK_EVENT: EventHandler added. Not getting called");
892 s_lockScreenAppCallbackCalled = false;
893 Tizen.System.SystemSettings.LockScreenAppChanged -= OnLockscreenAppChanged;
894 Tizen.System.SystemSettings.LockScreenApp = s_lockscreenAppValue;
895 await Task.Delay(2000);
896 Assert.IsFalse(s_lockScreenAppCallbackCalled, "LockscreenAppChanged_CHECK_EVENT: EventHandler removed. Still getting called");
897 Tizen.System.SystemSettings.LockScreenApp = preValue;
899 } catch (NotSupportedException) {
900 bool isSupport = true;
901 Information.TryGetValue<bool>("tizen.org/feature/systemsetting.lock_screen", out isSupport);
902 Assert.IsTrue(isSupport == false, "Invalid NotSupportedException");
903 Tizen.Log.Debug("CS-SYSTEM-SETTINGS", ">>>>>> NotSupport(tizen.org/feature/systemsetting.lock_screen)");
904 LogUtils.NotSupport();
907 private static void OnLockscreenAppChanged(object sender, Tizen.System.LockScreenAppChangedEventArgs e)
909 s_lockScreenAppCallbackCalled = true;
910 Assert.IsInstanceOf<string>(e.Value, "OnLockscreenAppChanged: LockscreenApp not an instance of string");
911 Assert.IsTrue(s_lockscreenAppValue.CompareTo(e.Value) == 0, "OnLockscreenAppChanged: The callback should receive the latest value for the property.");
917 //[Description("Test if get for SystemSettings:DefaultFontType is working properly")]
918 //[Property("SPEC", "Tizen.System.SystemSettings.DefaultFontType A")]
919 //[Property("SPEC_URL", "-")]
920 //[Property("CRITERIA", "PRO")]
921 //[Property("AUTHOR", "Aditya Aswani, a.aswani@samsung.com")]
922 public static void DefaultFontType_READ_ONLY()
924 LogUtils.StartTest();
926 Assert.IsNotNull(Tizen.System.SystemSettings.DefaultFontType, "DefaultFontType_READ_ONLY: DefaultFontType is null");
927 Assert.IsInstanceOf<string>(Tizen.System.SystemSettings.DefaultFontType, "DefaultFontType_READ_ONLY: DefaultFontType not an instance of string");
934 //[Description("Test if set/get for SystemSettings:LocaleCountry is working properly")]
935 //[Property("SPEC", "Tizen.System.SystemSettings.LocaleCountry A")]
936 //[Property("SPEC_URL", "-")]
937 //[Property("CRITERIA", "PRW")]
938 //[Property("AUTHOR", "Aditya Aswani, a.aswani@samsung.com")]
939 public static void LocaleCountry_READ_WRITE()
941 LogUtils.StartTest();
943 Assert.IsInstanceOf<string>(Tizen.System.SystemSettings.LocaleCountry, "LocaleCountry_READ_WRITE: LocaleCountry not an instance of string");
944 var setValue = "en_US";
945 string preValue = Tizen.System.SystemSettings.LocaleCountry;
946 Tizen.System.SystemSettings.LocaleCountry = setValue;
947 var getValue = Tizen.System.SystemSettings.LocaleCountry;
948 Assert.IsTrue(setValue.CompareTo(getValue) == 0, "LocaleCountry_READ_WRITE: Set value and get value of the property should be same.");
949 Tizen.System.SystemSettings.LocaleCountry = preValue;
953 private static bool s_localeCountryCallbackCalled = false;
954 private static readonly string s_localeCountryValue = "en_US";
957 //[Description("Check if callback to SystemSettings:LocaleCountryChanged event is called")]
958 //[Property("SPEC", "Tizen.System.SystemSettings.LocaleCountryChanged E")]
959 //[Property("SPEC_URL", "-")]
960 //[Property("CRITERIA", "EVL")]
961 //[Property("AUTHOR", "Aditya Aswani, a.aswani@samsung.com")]
962 public static async Task LocaleCountryChanged_CHECK_EVENT()
964 LogUtils.StartTest();
966 Tizen.System.SystemSettings.LocaleCountryChanged += OnLocaleCountryChanged;
967 string preValue = Tizen.System.SystemSettings.LocaleCountry;
968 Tizen.System.SystemSettings.LocaleCountry = s_localeCountryValue;
969 await Task.Delay(2000);
970 Assert.IsTrue(s_localeCountryCallbackCalled, "LocaleCountryChanged_CHECK_EVENT: EventHandler added. Not getting called");
971 s_localeCountryCallbackCalled = false;
972 Tizen.System.SystemSettings.LocaleCountryChanged -= OnLocaleCountryChanged;
973 Tizen.System.SystemSettings.LocaleCountry = s_localeCountryValue;
974 await Task.Delay(2000);
975 Assert.IsFalse(s_localeCountryCallbackCalled, "LocaleCountryChanged_CHECK_EVENT: EventHandler removed. Still getting called");
976 Tizen.System.SystemSettings.LocaleCountry = preValue;
979 private static void OnLocaleCountryChanged(object sender, Tizen.System.LocaleCountryChangedEventArgs e)
981 s_localeCountryCallbackCalled = true;
982 Assert.IsInstanceOf<string>(e.Value, "OnLocaleCountryChanged: LocaleCountry not an instance of string");
983 Assert.IsTrue(s_localeCountryValue.CompareTo(e.Value) == 0, "OnLocaleCountryChanged: The callback should receive the latest value for the property.");
989 //[Description("Test if set/get for SystemSettings:LocaleLanguage is working properly")]
990 //[Property("SPEC", "Tizen.System.SystemSettings.LocaleLanguage A")]
991 //[Property("SPEC_URL", "-")]
992 //[Property("CRITERIA", "PRW")]
993 //[Property("AUTHOR", "Aditya Aswani, a.aswani@samsung.com")]
994 public static void LocaleLanguage_READ_WRITE()
996 LogUtils.StartTest();
998 Assert.IsInstanceOf<string>(Tizen.System.SystemSettings.LocaleLanguage, "LocaleLanguage_READ_WRITE: LocaleLanguage not an instance of string");
999 var setValue = "en_US";
1000 string preValue = Tizen.System.SystemSettings.LocaleLanguage;
1001 Tizen.System.SystemSettings.LocaleLanguage = setValue;
1002 var getValue = Tizen.System.SystemSettings.LocaleLanguage;
1003 Assert.IsTrue(setValue.CompareTo(getValue) == 0, "LocaleLanguage_READ_WRITE: Set value and get value of the property should be same.");
1004 Tizen.System.SystemSettings.LocaleLanguage = preValue;
1008 private static bool s_localeLanguageCallbackCalled = false;
1009 private static readonly string s_localeLanguageValue = "en_US";
1012 //[Description("Check if callback to SystemSettings:LocaleLanguageChanged event is called")]
1013 //[Property("SPEC", "Tizen.System.SystemSettings.LocaleLanguageChanged E")]
1014 //[Property("SPEC_URL", "-")]
1015 //[Property("CRITERIA", "EVL")]
1016 //[Property("AUTHOR", "Aditya Aswani, a.aswani@samsung.com")]
1017 public static async Task LocaleLanguageChanged_CHECK_EVENT()
1019 LogUtils.StartTest();
1021 Tizen.System.SystemSettings.LocaleLanguageChanged += OnLocaleLanguageChanged;
1022 string preValue = Tizen.System.SystemSettings.LocaleLanguage;
1023 Tizen.System.SystemSettings.LocaleLanguage = s_localeLanguageValue;
1024 await Task.Delay(2000);
1025 Assert.IsTrue(s_localeLanguageCallbackCalled, "LocaleLanguageChanged_CHECK_EVENT: EventHandler added. Not getting called");
1026 s_localeLanguageCallbackCalled = false;
1027 Tizen.System.SystemSettings.LocaleLanguageChanged -= OnLocaleLanguageChanged;
1028 Tizen.System.SystemSettings.LocaleLanguage = s_localeLanguageValue;
1029 await Task.Delay(2000);
1030 Assert.IsFalse(s_localeLanguageCallbackCalled, "LocaleLanguageChanged_CHECK_EVENT: EventHandler removed. Still getting called");
1031 Tizen.System.SystemSettings.LocaleLanguage = preValue;
1034 private static void OnLocaleLanguageChanged(object sender, Tizen.System.LocaleLanguageChangedEventArgs e)
1036 s_localeLanguageCallbackCalled = true;
1037 Assert.IsInstanceOf<string>(e.Value, "OnLocaleLanguageChanged: LocaleLanguage not an instance of string");
1038 Assert.IsTrue(s_localeLanguageValue.CompareTo(e.Value) == 0, "OnLocaleLanguageChanged: The callback should receive the latest value for the property.");
1041 // LocaleTimeformat24Hour
1044 //[Description("Test if set/get for SystemSettings:LocaleTimeFormat24HourEnabled is working properly")]
1045 //[Property("SPEC", "Tizen.System.SystemSettings.LocaleTimeFormat24HourEnabled A")]
1046 //[Property("SPEC_URL", "-")]
1047 //[Property("CRITERIA", "PRW")]
1048 //[Property("AUTHOR", "Aditya Aswani, a.aswani@samsung.com")]
1049 public static void LocaleTimeFormat24HourEnabled_READ_WRITE()
1051 LogUtils.StartTest();
1053 bool preValue = Tizen.System.SystemSettings.LocaleTimeFormat24HourEnabled;
1054 Assert.IsInstanceOf<bool>(Tizen.System.SystemSettings.LocaleTimeFormat24HourEnabled, "LocaleTimeFormat24HourEnabled_READ_WRITE: LocaleTimeFormat24HourEnabled not an instance of bool");
1055 Tizen.System.SystemSettings.LocaleTimeFormat24HourEnabled = true;
1056 Assert.IsTrue(Tizen.System.SystemSettings.LocaleTimeFormat24HourEnabled, "LocaleTimeformat24Hour_READ_WRITE: Set value and get value of the property should be same.");
1057 Tizen.System.SystemSettings.LocaleTimeFormat24HourEnabled = false;
1058 Assert.IsFalse(Tizen.System.SystemSettings.LocaleTimeFormat24HourEnabled, "LocaleTimeformat24Hour_READ_WRITE: Set value and get value of the property should be same.");
1059 Tizen.System.SystemSettings.LocaleTimeFormat24HourEnabled = preValue;
1063 private static bool s_timeFormatCallbackCalled = false;
1064 private static bool s_localeTimeformat24HourValue = !Tizen.System.SystemSettings.LocaleTimeFormat24HourEnabled;
1067 //[Description("Check if callback to SystemSettings:LocaleTimeFormat24HourSettingChanged event is called")]
1068 //[Property("SPEC", "Tizen.System.SystemSettings.LocaleTimeFormat24HourSettingChanged E")]
1069 //[Property("SPEC_URL", "-")]
1070 //[Property("CRITERIA", "EVL")]
1071 //[Property("AUTHOR", "Aditya Aswani, a.aswani@samsung.com")]
1072 public static async Task LocaleTimeFormat24HourSettingChanged_CHECK_EVENT()
1074 LogUtils.StartTest();
1076 Tizen.System.SystemSettings.LocaleTimeFormat24HourSettingChanged += OnLocaleTimeformat24HourChanged;
1077 bool preValue = Tizen.System.SystemSettings.LocaleTimeFormat24HourEnabled;
1078 Tizen.System.SystemSettings.LocaleTimeFormat24HourEnabled = s_localeTimeformat24HourValue;
1079 await Task.Delay(2000);
1080 Assert.IsTrue(s_timeFormatCallbackCalled, "LocaleTimeFormat24HourSettingChanged_CHECK_EVENT: EventHandler added. Not getting called");
1081 s_timeFormatCallbackCalled = false;
1083 s_localeTimeformat24HourValue = !s_localeTimeformat24HourValue;
1084 Tizen.System.SystemSettings.LocaleTimeFormat24HourEnabled = s_localeTimeformat24HourValue;
1085 await Task.Delay(2000);
1086 Assert.IsTrue(s_timeFormatCallbackCalled, "LocaleTimeFormat24HourSettingChanged_CHECK_EVENT: EventHandler added. Not getting called");
1087 s_timeFormatCallbackCalled = false;
1089 Tizen.System.SystemSettings.LocaleTimeFormat24HourSettingChanged -= OnLocaleTimeformat24HourChanged;
1090 Tizen.System.SystemSettings.LocaleTimeFormat24HourEnabled = s_localeTimeformat24HourValue;
1091 await Task.Delay(2000);
1092 Assert.IsFalse(s_timeFormatCallbackCalled, "LocaleTimeFormat24HourSettingChanged_CHECK_EVENT: EventHandler removed. Still getting called");
1093 Tizen.System.SystemSettings.LocaleTimeFormat24HourEnabled = preValue;
1097 private static void OnLocaleTimeformat24HourChanged(object sender, Tizen.System.LocaleTimeFormat24HourSettingChangedEventArgs e)
1099 s_timeFormatCallbackCalled = true;
1100 Assert.IsInstanceOf<bool>(e.Value, "OnLocaleTimeformat24HourChanged: LocaleTimeFormat24HourEnabled not an instance of bool");
1101 Assert.IsTrue(e.Value == s_localeTimeformat24HourValue, "OnLocaleTimeformat24HourChanged: The callback should receive the latest value for the property.");
1107 //[Description("Test if set/get for SystemSettings:LocaleTimeZone is working properly")]
1108 //[Property("SPEC", "Tizen.System.SystemSettings.LocaleTimeZone A")]
1109 //[Property("SPEC_URL", "-")]
1110 //[Property("CRITERIA", "PRW")]
1111 //[Property("AUTHOR", "Aditya Aswani, a.aswani@samsung.com")]
1112 public static void LocaleTimeZone_READ_WRITE()
1114 LogUtils.StartTest();
1116 Assert.IsInstanceOf<string>(Tizen.System.SystemSettings.LocaleTimeZone, "LocaleTimeZone_READ_WRITE: LocaleTimeZone not an instance of string");
1117 //var setValue = "Pacific/Tahiti";
1118 var setValue = "Asia/Seoul";
1119 string preValue = Tizen.System.SystemSettings.LocaleTimeZone;
1120 Tizen.System.SystemSettings.LocaleTimeZone = setValue;
1121 var getValue = Tizen.System.SystemSettings.LocaleTimeZone;
1122 Assert.IsTrue(setValue.CompareTo(getValue) == 0, "LocaleTimezone_READ_WRITE: Set value and get value of the property should be same.");
1123 Tizen.System.SystemSettings.LocaleTimeZone = preValue;
1127 private static bool s_localeTimeZoneCallbackCalled = false;
1128 private static readonly string s_localeTimeZoneValue = "Asia/Seoul";
1131 //[Description("Check if callback to SystemSettings:LocaleTimeZoneChanged event is called")]
1132 //[Property("SPEC", "Tizen.System.SystemSettings.LocaleTimeZoneChanged E")]
1133 //[Property("SPEC_URL", "-")]
1134 //[Property("CRITERIA", "EVL")]
1135 //[Property("AUTHOR", "Aditya Aswani, a.aswani@samsung.com")]
1136 public static async Task LocaleTimeZoneChanged_CHECK_EVENT()
1138 LogUtils.StartTest();
1140 Tizen.System.SystemSettings.LocaleTimeZoneChanged += OnLocaleTimeZoneChanged;
1141 string preValue = Tizen.System.SystemSettings.LocaleTimeZone;
1142 Tizen.System.SystemSettings.LocaleTimeZone = s_localeTimeZoneValue;
1143 await Task.Delay(2000);
1144 Assert.IsTrue(s_localeTimeZoneCallbackCalled, "LocaleTimeZoneChanged_CHECK_EVENT: EventHandler added. Not getting called");
1145 s_localeTimeZoneCallbackCalled = false;
1147 Tizen.System.SystemSettings.LocaleTimeZoneChanged -= OnLocaleTimeZoneChanged;
1148 Tizen.System.SystemSettings.LocaleTimeZone = s_localeTimeZoneValue;
1149 await Task.Delay(2000);
1150 Assert.IsFalse(s_localeTimeZoneCallbackCalled, "LocaleTimeZoneChanged_CHECK_EVENT: EventHandler removed. Still getting called");
1151 Tizen.System.SystemSettings.LocaleTimeZone = preValue;
1154 private static void OnLocaleTimeZoneChanged(object sender, Tizen.System.LocaleTimeZoneChangedEventArgs e)
1156 s_localeTimeZoneCallbackCalled = true;
1157 Assert.IsInstanceOf<string>(e.Value, "OnLocaleTimeZoneChanged: LocaleTimeZone not an instance of string");
1158 Assert.IsTrue(s_localeTimeZoneValue.CompareTo(e.Value) == 0, "OnLocaleTimezoneChanged: The callback should receive the latest value for the property.");
1164 //[Description("Test if get for SystemSettings:SoundLockEnabled is working properly")]
1165 //[Property("SPEC", "Tizen.System.SystemSettings.SoundLockEnabled A")]
1166 //[Property("SPEC_URL", "-")]
1167 //[Property("CRITERIA", "PRO")]
1168 //[Property("AUTHOR", "Aditya Aswani, a.aswani@samsung.com")]
1169 public static void SoundLockEnabled_READ_ONLY()
1171 LogUtils.StartTest();
1173 Assert.IsInstanceOf<bool>(Tizen.System.SystemSettings.SoundLockEnabled, "SoundLockEnabled_READ_ONLY: SoundLockEnabled not an instance of bool");
1180 //[Description("Test if get for SystemSettings:SoundSilentModeEnabled is working properly")]
1181 //[Property("SPEC", "Tizen.System.SystemSettings.SoundSilentModeEnabled A")]
1182 //[Property("SPEC_URL", "-")]
1183 //[Property("CRITERIA", "PRO")]
1184 //[Property("AUTHOR", "Aditya Aswani, a.aswani@samsung.com")]
1185 public static void SoundSilentModeEnabled_READ_ONLY()
1187 LogUtils.StartTest();
1189 Assert.IsInstanceOf<bool>(Tizen.System.SystemSettings.SoundSilentModeEnabled, "SoundSilentModeEnabled_READ_ONLY: SoundSilentModeEnabled not an instance of bool");
1196 //[Description("Test if get for SystemSettings:SoundTouchEnabled is working properly")]
1197 //[Property("SPEC", "Tizen.System.SystemSettings.SoundTouchEnabled A")]
1198 //[Property("SPEC_URL", "-")]
1199 //[Property("CRITERIA", "PRO")]
1200 //[Property("AUTHOR", "Aditya Aswani, a.aswani@samsung.com")]
1201 public static void SoundTouchEnabled_READ_ONLY()
1203 LogUtils.StartTest();
1205 Assert.IsInstanceOf<bool>(Tizen.System.SystemSettings.SoundTouchEnabled, "SoundTouchEnabled_READ_ONLY: SoundTouchEnabled not an instance of bool");
1209 // DisplayScreenRotationAuto
1212 //[Description("Test if get for SystemSettings:DisplayScreenRotationAutoEnabled is working properly")]
1213 //[Property("SPEC", "Tizen.System.SystemSettings.DisplayScreenRotationAutoEnabled A")]
1214 //[Property("SPEC_URL", "-")]
1215 //[Property("CRITERIA", "PRO")]
1216 //[Property("AUTHOR", "Aditya Aswani, a.aswani@samsung.com")]
1217 public static void DisplayScreenRotationAutoEnabled_READ_ONLY()
1219 LogUtils.StartTest();
1221 Assert.IsInstanceOf<bool>(Tizen.System.SystemSettings.DisplayScreenRotationAutoEnabled, "DisplayScreenRotationAutoEnabled_READ_ONLY: DisplayScreenRotationAutoEnabled not an instance of bool");
1228 //[Description("Test if get for SystemSettings:DeviceName is working properly")]
1229 //[Property("SPEC", "Tizen.System.SystemSettings.DeviceName A")]
1230 //[Property("SPEC_URL", "-")]
1231 //[Property("CRITERIA", "PRO")]
1232 //[Property("AUTHOR", "Aditya Aswani, a.aswani@samsung.com")]
1233 public static void DeviceName_READ_ONLY()
1235 LogUtils.StartTest();
1237 Assert.IsNotNull(Tizen.System.SystemSettings.DeviceName, "DeviceName_READ_ONLY: DeviceName is null");
1238 Assert.IsInstanceOf<string>(Tizen.System.SystemSettings.DeviceName, "DeviceName_READ_ONLY: DeviceName not an instance of string");
1239 Assert.IsFalse(Tizen.System.SystemSettings.DeviceName.CompareTo("") == 0, "DeviceName_READ_ONLY: Device name is empty");
1246 //[Description("Test if get for SystemSettings:MotionEnabled is working properly")]
1247 //[Property("SPEC", "Tizen.System.SystemSettings.MotionEnabled A")]
1248 //[Property("SPEC_URL", "-")]
1249 //[Property("CRITERIA", "PRO")]
1250 //[Property("AUTHOR", "Aditya Aswani, a.aswani@samsung.com")]
1251 public static void MotionEnabled_READ_ONLY()
1253 LogUtils.StartTest();
1255 Assert.IsInstanceOf<bool>(Tizen.System.SystemSettings.MotionEnabled, "MotionEnabled_READ_ONLY: MotionEnabled not an instance of bool");
1259 // NetworkWifiNotification
1262 //[Description("Test if get for SystemSettings:NetworkWifiNotificationEnabled is working properly")]
1263 //[Property("SPEC", "Tizen.System.SystemSettings.NetworkWifiNotificationEnabled A")]
1264 //[Property("SPEC_URL", "-")]
1265 //[Property("CRITERIA", "PRO")]
1266 //[Property("AUTHOR", "Aditya Aswani, a.aswani@samsung.com")]
1267 public static void NetworkWifiNotificationEnabled_READ_ONLY()
1272 LogUtils.StartTest();
1273 Assert.IsInstanceOf<bool>(Tizen.System.SystemSettings.NetworkWifiNotificationEnabled, "NetworkWifiNotificationEnabled_READ_ONLY: NetworkWifiNotificationEnabled not an instance of bool");
1275 } catch (NotSupportedException) {
1276 bool isSupport = true;
1277 Information.TryGetValue<bool>("tizen.org/feature/network.wifi", out isSupport);
1278 Assert.IsTrue(isSupport == false, "Invalid NotSupportedException");
1279 Tizen.Log.Debug("CS-SYSTEM-SETTINGS", ">>>>>> NotSupport(tizen.org/feature/systemsetting.wifi)");
1280 LogUtils.NotSupport();
1284 // NetworkFlightMode
1287 //[Description("Test if get for SystemSettings:NetworkFlightModeEnabled is working properly")]
1288 //[Property("SPEC", "Tizen.System.SystemSettings.NetworkFlightModeEnabled A")]
1289 //[Property("SPEC_URL", "-")]
1290 //[Property("CRITERIA", "PRO")]
1291 //[Property("AUTHOR", "Aditya Aswani, a.aswani@samsung.com")]
1292 public static void NetworkFlightModeEnabled_READ_ONLY()
1294 LogUtils.StartTest();
1296 Assert.IsInstanceOf<bool>(Tizen.System.SystemSettings.NetworkFlightModeEnabled, "NetworkFlightModeEnabled_READ_ONLY: NetworkFlightModeEnabled not an instance of bool");
1300 // ScreenBacklightTime
1303 //[Description("Test if set/get for SystemSettings:ScreenBacklightTime is working properly")]
1304 //[Property("SPEC", "Tizen.System.SystemSettings.ScreenBacklightTime A")]
1305 //[Property("SPEC_URL", "-")]
1306 //[Property("CRITERIA", "PRW")]
1307 //[Property("AUTHOR", "Aditya Aswani, a.aswani@samsung.com")]
1308 public static void ScreenBacklightTime_READ_WRITE_ALL()
1310 LogUtils.StartTest();
1312 Assert.IsInstanceOf<int>(Tizen.System.SystemSettings.ScreenBacklightTime, "ScreenBacklightTime_READ_WRITE_ALL: ScreenBacklightTime not an instance of int");
1314 int preValue = Tizen.System.SystemSettings.ScreenBacklightTime;
1315 Tizen.System.SystemSettings.ScreenBacklightTime = setValue;
1316 var getValue = Tizen.System.SystemSettings.ScreenBacklightTime;
1317 Assert.IsTrue(setValue == getValue, "ScreenBacklightTime_READ_WRITE_ALL: Set value and get value of the property should be same.");
1320 Tizen.System.SystemSettings.ScreenBacklightTime = setValue;
1321 getValue = Tizen.System.SystemSettings.ScreenBacklightTime;
1322 Assert.IsTrue(setValue == getValue, "ScreenBacklightTime_READ_WRITE_ALL: Set value and get value of the property should be same.");
1325 Tizen.System.SystemSettings.ScreenBacklightTime = setValue;
1326 getValue = Tizen.System.SystemSettings.ScreenBacklightTime;
1327 Assert.IsTrue(setValue == getValue, "ScreenBacklightTime_READ_WRITE_ALL: Set value and get value of the property should be same.");
1330 Tizen.System.SystemSettings.ScreenBacklightTime = setValue;
1331 getValue = Tizen.System.SystemSettings.ScreenBacklightTime;
1332 Assert.IsTrue(setValue == getValue, "ScreenBacklightTime_READ_WRITE_ALL: Set value and get value of the property should be same.");
1335 Tizen.System.SystemSettings.ScreenBacklightTime = setValue;
1336 getValue = Tizen.System.SystemSettings.ScreenBacklightTime;
1337 Assert.IsTrue(setValue == getValue, "ScreenBacklightTime_READ_WRITE_ALL: Set value and get value of the property should be same.");
1340 Tizen.System.SystemSettings.ScreenBacklightTime = setValue;
1341 getValue = Tizen.System.SystemSettings.ScreenBacklightTime;
1342 Assert.IsTrue(setValue == getValue, "ScreenBacklightTime_READ_WRITE_ALL: Set value and get value of the property should be same.");
1343 Tizen.System.SystemSettings.ScreenBacklightTime = preValue;
1346 private static bool s_screenBacklightTime15CallbackCalled = false;
1349 //[Description("Check if callback to SystemSettings:ScreenBacklightTimeChanged event is called")]
1350 //[Property("SPEC", "Tizen.System.SystemSettings.ScreenBacklightTimeChanged E")]
1351 //[Property("SPEC_URL", "-")]
1352 //[Property("CRITERIA", "EVL")]
1353 //[Property("AUTHOR", "Aditya Aswani, a.aswani@samsung.com")]
1354 public static async Task ScreenBacklightTimeChanged_CHECK_EVENT_15()
1356 LogUtils.StartTest();
1358 Tizen.System.SystemSettings.ScreenBacklightTimeChanged += OnScreenBacklightTime15Changed;
1359 int preValue = Tizen.System.SystemSettings.ScreenBacklightTime;
1360 Tizen.System.SystemSettings.ScreenBacklightTime = 15;
1361 await Task.Delay(2000);
1362 Tizen.System.SystemSettings.ScreenBacklightTimeChanged -= OnScreenBacklightTime15Changed;
1363 Assert.IsTrue(s_screenBacklightTime15CallbackCalled, "ScreenBacklightTimeChanged_CHECK_EVENT_15: EventHandler added. Not getting called");
1364 s_screenBacklightTime15CallbackCalled = false;
1365 Tizen.System.SystemSettings.ScreenBacklightTime = preValue;
1368 private static void OnScreenBacklightTime15Changed(object sender, Tizen.System.ScreenBacklightTimeChangedEventArgs e)
1370 s_screenBacklightTime15CallbackCalled = true;
1371 Assert.IsInstanceOf<int>(e.Value, "OnScreenBacklightTime15Changed: ScreenBacklightTime not an instance of int");
1372 Assert.IsTrue(e.Value == 15, "OnScreenBacklightTime15Changed: The callback should receive the latest value for the property.");
1375 private static bool s_screenBacklightTime30CallbackCalled = false;
1378 //[Description("Check if callback to SystemSettings:ScreenBacklightTimeChanged event is called")]
1379 //[Property("SPEC", "Tizen.System.SystemSettings.ScreenBacklightTimeChanged E")]
1380 //[Property("SPEC_URL", "-")]
1381 //[Property("CRITERIA", "EVL")]
1382 //[Property("AUTHOR", "Aditya Aswani, a.aswani@samsung.com")]
1383 public static async Task ScreenBacklightTimeChanged_CHECK_EVENT_30()
1385 LogUtils.StartTest();
1387 Tizen.System.SystemSettings.ScreenBacklightTimeChanged += OnScreenBacklightTime30Changed;
1388 int preValue = Tizen.System.SystemSettings.ScreenBacklightTime;
1389 Tizen.System.SystemSettings.ScreenBacklightTime = 30;
1390 await Task.Delay(2000);
1391 Tizen.System.SystemSettings.ScreenBacklightTimeChanged -= OnScreenBacklightTime30Changed;
1392 Assert.IsTrue(s_screenBacklightTime30CallbackCalled, "ScreenBacklightTimeChanged_CHECK_EVENT_30: EventHandler added. Not getting called");
1393 s_screenBacklightTime30CallbackCalled = false;
1394 Tizen.System.SystemSettings.ScreenBacklightTime = preValue;
1397 private static void OnScreenBacklightTime30Changed(object sender, Tizen.System.ScreenBacklightTimeChangedEventArgs e)
1399 s_screenBacklightTime30CallbackCalled = true;
1400 Assert.IsInstanceOf<int>(e.Value, "OnScreenBacklightTime30Changed: ScreenBacklightTime not an instance of int");
1401 Assert.IsTrue(e.Value == 30, "OnScreenBacklightTime30Changed: The callback should receive the latest value for the property.");
1404 private static bool s_screenBacklightTime60CallbackCalled = false;
1407 //[Description("Check if callback to SystemSettings:ScreenBacklightTimeChanged event is called")]
1408 //[Property("SPEC", "Tizen.System.SystemSettings.ScreenBacklightTimeChanged E")]
1409 //[Property("SPEC_URL", "-")]
1410 //[Property("CRITERIA", "EVL")]
1411 //[Property("AUTHOR", "Aditya Aswani, a.aswani@samsung.com")]
1412 public static async Task ScreenBacklightTimeChanged_CHECK_EVENT_60()
1414 LogUtils.StartTest();
1416 Tizen.System.SystemSettings.ScreenBacklightTimeChanged += OnScreenBacklightTime60Changed;
1417 int preValue = Tizen.System.SystemSettings.ScreenBacklightTime;
1418 Tizen.System.SystemSettings.ScreenBacklightTime = 60;
1419 await Task.Delay(2000);
1420 Tizen.System.SystemSettings.ScreenBacklightTimeChanged -= OnScreenBacklightTime60Changed;
1421 Assert.IsTrue(s_screenBacklightTime60CallbackCalled, "ScreenBacklightTimeChanged_CHECK_EVENT_60: EventHandler added. Not getting called");
1422 s_screenBacklightTime60CallbackCalled = false;
1423 Tizen.System.SystemSettings.ScreenBacklightTime = preValue;
1426 private static void OnScreenBacklightTime60Changed(object sender, Tizen.System.ScreenBacklightTimeChangedEventArgs e)
1428 s_screenBacklightTime60CallbackCalled = true;
1429 Assert.IsInstanceOf<int>(e.Value, "OnScreenBacklightTime60Changed: ScreenBacklightTime not an instance of int");
1430 Assert.IsTrue(e.Value == 60, "OnScreenBacklightTime60Changed: The callback should receive the latest value for the property.");
1433 private static bool s_screenBacklightTime120CallbackCalled = false;
1436 //[Description("Check if callback to SystemSettings:ScreenBacklightTimeChanged event is called")]
1437 //[Property("SPEC", "Tizen.System.SystemSettings.ScreenBacklightTimeChanged E")]
1438 //[Property("SPEC_URL", "-")]
1439 //[Property("CRITERIA", "EVL")]
1440 //[Property("AUTHOR", "Aditya Aswani, a.aswani@samsung.com")]
1441 public static async Task ScreenBacklightTimeChanged_CHECK_EVENT_120()
1443 LogUtils.StartTest();
1445 Tizen.System.SystemSettings.ScreenBacklightTimeChanged += OnScreenBacklightTime120Changed;
1446 int preValue = Tizen.System.SystemSettings.ScreenBacklightTime;
1447 Tizen.System.SystemSettings.ScreenBacklightTime = 120;
1448 await Task.Delay(2000);
1449 Tizen.System.SystemSettings.ScreenBacklightTimeChanged -= OnScreenBacklightTime120Changed;
1450 Assert.IsTrue(s_screenBacklightTime120CallbackCalled, "ScreenBacklightTimeChanged_CHECK_EVENT_120: EventHandler added. Not getting called");
1451 s_screenBacklightTime120CallbackCalled = false;
1452 Tizen.System.SystemSettings.ScreenBacklightTime = preValue;
1455 private static void OnScreenBacklightTime120Changed(object sender, Tizen.System.ScreenBacklightTimeChangedEventArgs e)
1457 s_screenBacklightTime120CallbackCalled = true;
1458 Assert.IsInstanceOf<int>(e.Value, "OnScreenBacklightTime120Changed: ScreenBacklightTime not an instance of int");
1459 Assert.IsTrue(e.Value == 120, "OnScreenBacklightTime120Changed: The callback should receive the latest value for the property.");
1462 private static bool s_screenBacklightTime300CallbackCalled = false;
1465 //[Description("Check if callback to SystemSettings:ScreenBacklightTimeChanged event is called")]
1466 //[Property("SPEC", "Tizen.System.SystemSettings.ScreenBacklightTimeChanged E")]
1467 //[Property("SPEC_URL", "-")]
1468 //[Property("CRITERIA", "EVL")]
1469 //[Property("AUTHOR", "Aditya Aswani, a.aswani@samsung.com")]
1470 public static async Task ScreenBacklightTimeChanged_CHECK_EVENT_300()
1472 LogUtils.StartTest();
1474 Tizen.System.SystemSettings.ScreenBacklightTimeChanged += OnScreenBacklightTime300Changed;
1475 int preValue = Tizen.System.SystemSettings.ScreenBacklightTime;
1476 Tizen.System.SystemSettings.ScreenBacklightTime = 300;
1477 await Task.Delay(2000);
1478 Tizen.System.SystemSettings.ScreenBacklightTimeChanged -= OnScreenBacklightTime300Changed;
1479 Assert.IsTrue(s_screenBacklightTime300CallbackCalled, "ScreenBacklightTimeChanged_CHECK_EVENT_300: EventHandler added. Not getting called");
1480 s_screenBacklightTime300CallbackCalled = false;
1481 Tizen.System.SystemSettings.ScreenBacklightTime = preValue;
1484 private static void OnScreenBacklightTime300Changed(object sender, Tizen.System.ScreenBacklightTimeChangedEventArgs e)
1486 s_screenBacklightTime300CallbackCalled = true;
1487 Assert.IsInstanceOf<int>(e.Value, "OnScreenBacklightTime300Changed: ScreenBacklightTime not an instance of int");
1488 Assert.IsTrue(e.Value == 300, "OnScreenBacklightTime300Changed: The callback should receive the latest value for the property.");
1491 private static bool s_screenBacklightTime600CallbackCalled = false;
1494 //[Description("Check if callback to SystemSettings:ScreenBacklightTimeChanged event is called")]
1495 //[Property("SPEC", "Tizen.System.SystemSettings.ScreenBacklightTimeChanged E")]
1496 //[Property("SPEC_URL", "-")]
1497 //[Property("CRITERIA", "EVL")]
1498 //[Property("AUTHOR", "Aditya Aswani, a.aswani@samsung.com")]
1499 public static async Task ScreenBacklightTimeChanged_CHECK_EVENT_600()
1501 LogUtils.StartTest();
1503 Tizen.System.SystemSettings.ScreenBacklightTimeChanged += OnScreenBacklightTime600Changed;
1504 int preValue = Tizen.System.SystemSettings.ScreenBacklightTime;
1505 Tizen.System.SystemSettings.ScreenBacklightTime = 600;
1506 await Task.Delay(2000);
1507 Tizen.System.SystemSettings.ScreenBacklightTimeChanged -= OnScreenBacklightTime600Changed;
1508 Assert.IsTrue(s_screenBacklightTime600CallbackCalled, "ScreenBacklightTimeChanged_CHECK_EVENT_600: EventHandler added. Not getting called");
1509 s_screenBacklightTime600CallbackCalled = false;
1510 Tizen.System.SystemSettings.ScreenBacklightTime = preValue;
1513 private static void OnScreenBacklightTime600Changed(object sender, Tizen.System.ScreenBacklightTimeChangedEventArgs e)
1515 s_screenBacklightTime600CallbackCalled = true;
1516 Assert.IsInstanceOf<int>(e.Value, "OnScreenBacklightTime600Changed: ScreenBacklightTime not an instance of int");
1517 Assert.IsTrue(e.Value == 600, "OnScreenBacklightTime600Changed; The callback should receive the latest value for the property.");
1520 // SoundNotification
1523 //[Description("Test if set/get for SystemSettings:SoundNotification is working properly")]
1524 //[Property("SPEC", "Tizen.System.SystemSettings.SoundNotification A")]
1525 //[Property("SPEC_URL", "-")]
1526 //[Property("CRITERIA", "PRW")]
1527 //[Property("AUTHOR", "Aditya Aswani, a.aswani@samsung.com")]
1528 public static void SoundNotification_READ_WRITE()
1531 LogUtils.StartTest();
1533 Assert.IsInstanceOf<string>(Tizen.System.SystemSettings.SoundNotification, "SoundNotification_READ_WRITE: SoundNotification not an instance of string");
1534 var setValue = SystemSettingsTestInput.GetStringValue((int)Tizen.System.SystemSettingsKeys.SoundNotification);
1535 string preValue = Tizen.System.SystemSettings.SoundNotification;
1536 Tizen.System.SystemSettings.SoundNotification = setValue;
1537 var getValue = Tizen.System.SystemSettings.SoundNotification;
1538 Assert.IsTrue(setValue.CompareTo(getValue) == 0, "SoundNotification_READ_WRITE: Set value and get value of the property should be same.");
1539 Tizen.System.SystemSettings.SoundNotification = preValue;
1541 } catch (NotSupportedException) {
1542 bool isSupport = true;
1543 Information.TryGetValue<bool>("tizen.org/feature/systemsetting.incoming_call", out isSupport);
1544 Assert.IsTrue(isSupport == false, "Invalid NotSupportedException");
1545 Tizen.Log.Debug("CS-SYSTEM-SETTINGS", ">>>>>> NotSupport(tizen.org/feature/systemsetting.incoming_call)");
1546 LogUtils.NotSupport();
1550 private static bool s_soundNotificationCallbackCalled = false;
1551 private static readonly string s_soundNotificationValue = SystemSettingsTestInput.GetStringValue((int)Tizen.System.SystemSettingsKeys.SoundNotification);
1554 //[Description("Check if callback to SystemSettings:SoundNotificationChanged event is called")]
1555 //[Property("SPEC", "Tizen.System.SystemSettings.SoundNotificationChanged E")]
1556 //[Property("SPEC_URL", "-")]
1557 //[Property("CRITERIA", "EVL")]
1558 //[Property("AUTHOR", "Aditya Aswani, a.aswani@samsung.com")]
1559 public static async Task SoundNotificationChanged_CHECK_EVENT()
1562 LogUtils.StartTest();
1564 Tizen.System.SystemSettings.SoundNotificationChanged += OnSoundNotificationChanged;
1565 string preValue = Tizen.System.SystemSettings.SoundNotification;
1566 Tizen.System.SystemSettings.SoundNotification = s_soundNotificationValue;
1567 await Task.Delay(2000);
1568 Assert.IsTrue(s_soundNotificationCallbackCalled, "SoundNotificationChanged_CHECK_EVENT: EventHandler added. Not getting called");
1570 s_soundNotificationCallbackCalled = false;
1571 Tizen.System.SystemSettings.SoundNotificationChanged -= OnSoundNotificationChanged;
1572 Tizen.System.SystemSettings.SoundNotification = s_soundNotificationValue;
1573 await Task.Delay(2000);
1574 Assert.IsFalse(s_soundNotificationCallbackCalled, "SoundNotificationChanged_CHECK_EVENT: EventHandler removed. Still getting called");
1575 Tizen.System.SystemSettings.SoundNotification = preValue;
1577 } catch (NotSupportedException) {
1578 bool isSupport = true;
1579 Information.TryGetValue<bool>("tizen.org/feature/systemsetting.incoming_call", out isSupport);
1580 Assert.IsTrue(isSupport == false, "Invalid NotSupportedException");
1581 Tizen.Log.Debug("CS-SYSTEM-SETTINGS", ">>>>>> NotSupport(tizen.org/feature/systemsetting.incoming_call)");
1582 LogUtils.NotSupport();
1585 private static void OnSoundNotificationChanged(object sender, Tizen.System.SoundNotificationChangedEventArgs e)
1587 s_soundNotificationCallbackCalled = true;
1588 Assert.IsInstanceOf<string>(e.Value, "OnSoundNotificationChanged: SoundNotification not an instance of string");
1589 Assert.IsTrue(s_soundNotificationValue.CompareTo(e.Value) == 0, "OnSoundNotificationChanged: The callback should receive the latest value for the property.");
1592 // SoundNotificationRepetitionPeriod
1595 //[Description("Test if set/get for SystemSettings:SoundNotificationRepetitionPeriod is working properly")]
1596 //[Property("SPEC", "Tizen.System.SystemSettings.SoundNotificationRepetitionPeriod A")]
1597 //[Property("SPEC_URL", "-")]
1598 //[Property("CRITERIA", "PRW")]
1599 //[Property("AUTHOR", "Aditya Aswani, a.aswani@samsung.com")]
1600 public static void SoundNotificationRepetitionPeriod_READ_WRITE()
1602 LogUtils.StartTest();
1604 Assert.IsInstanceOf<int>(Tizen.System.SystemSettings.SoundNotificationRepetitionPeriod, "SoundNotificationRepetitionPeriod_READ_WRITE: SoundNotificationRepetitionPeriod not an instance of int");
1606 int preValue = Tizen.System.SystemSettings.SoundNotificationRepetitionPeriod;
1607 Tizen.System.SystemSettings.SoundNotificationRepetitionPeriod = setValue;
1608 var getValue = Tizen.System.SystemSettings.SoundNotificationRepetitionPeriod;
1609 Assert.IsTrue(setValue.CompareTo(getValue) == 0, "SoundNotificationRepetitionPeriod_READ_WRITE: Set value and get value of the property should be same.");
1610 Tizen.System.SystemSettings.SoundNotificationRepetitionPeriod = preValue;
1614 private static bool s_soundNotificationRepetitionPeriodCallbackCalled = false;
1615 private static readonly int s_soundNotificationRepetitionPeriodValue = 300;
1618 //[Description("Check if callback to SystemSettings:SoundNotificationRepetitionPeriodChanged event is called")]
1619 //[Property("SPEC", "Tizen.System.SystemSettings.SoundNotificationRepetitionPeriodChanged E")]
1620 //[Property("SPEC_URL", "-")]
1621 //[Property("CRITERIA", "EVL")]
1622 //[Property("AUTHOR", "Aditya Aswani, a.aswani@samsung.com")]
1623 public static async Task SoundNotificationRepetitionPeriodChanged_CHECK_EVENT()
1625 LogUtils.StartTest();
1627 Tizen.System.SystemSettings.SoundNotificationRepetitionPeriodChanged += OnSoundNotificationRepetitionPeriodChanged;
1628 int preValue = Tizen.System.SystemSettings.SoundNotificationRepetitionPeriod;
1629 Tizen.System.SystemSettings.SoundNotificationRepetitionPeriod = s_soundNotificationRepetitionPeriodValue;
1630 await Task.Delay(2000);
1631 Assert.IsTrue(s_soundNotificationRepetitionPeriodCallbackCalled, "SoundNotificationRepetitionPeriodChanged_CHECK_EVENT: EventHandler added. Not getting called");
1632 s_soundNotificationRepetitionPeriodCallbackCalled = false;
1634 Tizen.System.SystemSettings.SoundNotificationRepetitionPeriodChanged -= OnSoundNotificationRepetitionPeriodChanged;
1635 Tizen.System.SystemSettings.SoundNotificationRepetitionPeriod = s_soundNotificationRepetitionPeriodValue;
1636 await Task.Delay(2000);
1637 Assert.IsFalse(s_soundNotificationRepetitionPeriodCallbackCalled, "SoundNotificationRepetitionPeriodChanged_CHECK_EVENT: EventHandler removed. Still getting called");
1638 Tizen.System.SystemSettings.SoundNotificationRepetitionPeriod = preValue;
1641 private static void OnSoundNotificationRepetitionPeriodChanged(object sender, Tizen.System.SoundNotificationRepetitionPeriodChangedEventArgs e)
1643 s_soundNotificationRepetitionPeriodCallbackCalled = true;
1644 Assert.IsInstanceOf<int>(e.Value, "OnSoundNotificationRepetitionPeriodChanged: SoundNotificationRepetitionPeriod not an instance of int");
1645 Assert.IsTrue(s_soundNotificationRepetitionPeriodValue.CompareTo(e.Value) == 0, "OnSoundNotificationRepetitionPeriodChanged: The callback should receive the latest value for the property.");
1651 //[Description("Test if set/get for SystemSettings:LockState is working properly")]
1652 //[Property("SPEC", "Tizen.System.SystemSettings.LockState A")]
1653 //[Property("SPEC_URL", "-")]
1654 //[Property("CRITERIA", "PRE")]
1655 //[Property("AUTHOR", "Aditya Aswani, a.aswani@samsung.com")]
1656 public static void LockState_READ_WRITE_ALL()
1658 LogUtils.StartTest();
1660 Assert.IsInstanceOf<Tizen.System.SystemSettingsIdleLockState>(Tizen.System.SystemSettings.LockState, "LockState_READ_WRITE_ALL: LockState not an instance of SystemSettingsIdleLockState");
1661 SystemSettingsIdleLockState preValue = Tizen.System.SystemSettings.LockState;
1662 var setValue = Tizen.System.SystemSettingsIdleLockState.Unlock;
1663 Tizen.System.SystemSettings.LockState = setValue;
1664 var getValue = Tizen.System.SystemSettings.LockState;
1665 Assert.IsTrue(setValue == getValue, "LockState_READ_WRITE_ALL: Set value and get value of the property should be same.");
1667 setValue = Tizen.System.SystemSettingsIdleLockState.Lock;
1668 Tizen.System.SystemSettings.LockState = setValue;
1669 getValue = Tizen.System.SystemSettings.LockState;
1670 Assert.IsTrue(setValue == getValue, "LockState_READ_WRITE_ALL: Set value and get value of the property should be same.");
1672 setValue = Tizen.System.SystemSettingsIdleLockState.LaunchingLock;
1673 Tizen.System.SystemSettings.LockState = setValue;
1674 getValue = Tizen.System.SystemSettings.LockState;
1675 Assert.IsTrue(setValue == getValue, "LockState_READ_WRITE_ALL: Set value and get value of the property should be same.");
1676 Tizen.System.SystemSettings.LockState = preValue;
1680 private static bool s_lockStateLockCallbackCalled = false;
1683 //[Description("Check if callback to SystemSettings:LockStateChanged event is called")]
1684 //[Property("SPEC", "Tizen.System.SystemSettings.LockStateChanged E")]
1685 //[Property("SPEC_URL", "-")]
1686 //[Property("CRITERIA", "EVL")]
1687 //[Property("AUTHOR", "Aditya Aswani, a.aswani@samsung.com")]
1688 public static async Task LockStateChanged_CHECK_EVENT_LOCK()
1690 LogUtils.StartTest();
1692 Tizen.System.SystemSettings.LockStateChanged += OnLockStateChangedLock;
1693 SystemSettingsIdleLockState preValue = Tizen.System.SystemSettings.LockState;
1694 Tizen.System.SystemSettings.LockState = Tizen.System.SystemSettingsIdleLockState.Lock;
1695 await Task.Delay(2000);
1696 Assert.IsTrue(s_lockStateLockCallbackCalled, "LockStateChanged_CHECK_EVENT_LOCK: EventHandler added. Not getting called");
1697 Tizen.System.SystemSettings.LockStateChanged -= OnLockStateChangedLock;
1698 s_lockStateLockCallbackCalled = false;
1699 Tizen.System.SystemSettings.LockState = preValue;
1702 private static void OnLockStateChangedLock(object sender, Tizen.System.LockStateChangedEventArgs e)
1704 s_lockStateLockCallbackCalled = true;
1705 Assert.IsInstanceOf<Tizen.System.SystemSettingsIdleLockState>(e.Value, "OnLockStateChangedLock: LockState not an instance of SystemSettingsIdleLockState");
1706 Assert.IsTrue(e.Value == Tizen.System.SystemSettingsIdleLockState.Lock, "OnLockStateChangedLock: The callback should receive the latest value for the property.");
1709 private static bool s_lockStateUnlockCallbackCalled = false;
1712 //[Description("Check if callback to SystemSettings:LockStateChanged event is called")]
1713 //[Property("SPEC", "Tizen.System.SystemSettings.LockStateChanged E")]
1714 //[Property("SPEC_URL", "-")]
1715 //[Property("CRITERIA", "EVL")]
1716 //[Property("AUTHOR", "Aditya Aswani, a.aswani@samsung.com")]
1717 public static async Task LockStateChanged_CHECK_EVENT_UNLOCK()
1719 LogUtils.StartTest();
1721 Tizen.System.SystemSettings.LockStateChanged += OnLockStateChangedUnlock;
1722 SystemSettingsIdleLockState preValue = Tizen.System.SystemSettings.LockState;
1723 Tizen.System.SystemSettings.LockState = Tizen.System.SystemSettingsIdleLockState.Unlock;
1724 await Task.Delay(2000);
1725 Tizen.System.SystemSettings.LockStateChanged -= OnLockStateChangedUnlock;
1726 Assert.IsTrue(s_lockStateUnlockCallbackCalled, "LockStateChanged_CHECK_EVENT_UNLOCK: EventHandler added. Not getting called");
1727 s_lockStateLockCallbackCalled = false;
1728 Tizen.System.SystemSettings.LockState = preValue;
1731 private static void OnLockStateChangedUnlock(object sender, Tizen.System.LockStateChangedEventArgs e)
1733 s_lockStateUnlockCallbackCalled = true;
1734 Assert.IsInstanceOf<Tizen.System.SystemSettingsIdleLockState>(e.Value, "OnLockStateChangedUnlock: LockState not an instance of SystemSettingsIdleLockState");
1735 Assert.IsTrue(e.Value == Tizen.System.SystemSettingsIdleLockState.Unlock, "OnLockStateChangedUnlock: The callback should receive the latest value for the property.");
1738 private static bool s_lockStateLaunchingLockCallbackCalled = false;
1741 //[Description("Check if callback to SystemSettings:LockStateChanged event is called")]
1742 //[Property("SPEC", "Tizen.System.SystemSettings.LockStateChanged E")]
1743 //[Property("SPEC_URL", "-")]
1744 //[Property("CRITERIA", "EVL")]
1745 //[Property("AUTHOR", "Aditya Aswani, a.aswani@samsung.com")]
1746 public static async Task LockStateChanged_CHECK_EVENT_LAUNCHING_LOCK()
1748 LogUtils.StartTest();
1750 Tizen.System.SystemSettings.LockStateChanged += OnLockStateChangedLaunchingLock;
1751 SystemSettingsIdleLockState preValue = Tizen.System.SystemSettings.LockState;
1752 Tizen.System.SystemSettings.LockState = Tizen.System.SystemSettingsIdleLockState.LaunchingLock;
1753 await Task.Delay(2000);
1754 Tizen.System.SystemSettings.LockStateChanged -= OnLockStateChangedLaunchingLock;
1755 Assert.IsTrue(s_lockStateLaunchingLockCallbackCalled, "LockStateChanged_CHECK_EVENT_LAUNCHING_LOCK: EventHandler added. Not getting called");
1756 s_lockStateLockCallbackCalled = false;
1757 Tizen.System.SystemSettings.LockState = preValue;
1760 private static void OnLockStateChangedLaunchingLock(object sender, Tizen.System.LockStateChangedEventArgs e)
1762 s_lockStateLaunchingLockCallbackCalled = true;
1763 Assert.IsInstanceOf<Tizen.System.SystemSettingsIdleLockState>(e.Value, "OnLockStateChangedLaunchingLock: LockState not an instance of SystemSettingsIdleLockState");
1764 Assert.IsTrue(e.Value == Tizen.System.SystemSettingsIdleLockState.LaunchingLock, "OnLockStateChangedLaunchingLock: The callback should receive the latest value for the property.");
1770 //[Description("Test if get for SystemSettings:Time is working properly")]
1771 //[Property("SPEC", "Tizen.System.SystemSettings.Time A")]
1772 //[Property("SPEC_URL", "-")]
1773 //[Property("CRITERIA", "PRO")]
1774 //[Property("AUTHOR", "Aditya Aswani, a.aswani@samsung.com")]
1775 public static void Time_READ_ONLY()
1777 LogUtils.StartTest();
1779 Assert.IsInstanceOf<int>(Tizen.System.SystemSettings.Time, "Time_READ_ONLY: Time not an instance of int");
1780 var readValue = Tizen.System.SystemSettings.Time;
1781 Assert.NotNull(readValue, "Should be readable");
1785 // UsbDebuggingEnabled
1788 //[Description("Test if get for SystemSettings:UsbDebuggingEnabled is working properly")]
1789 //[Property("SPEC", "Tizen.System.SystemSettings.UsbDebuggingEnabled A")]
1790 //[Property("SPEC_URL", "-")]
1791 //[Property("CRITERIA", "PRW")]
1792 //[Property("AUTHOR", "Aditya Aswani, a.aswani@samsung.com")]
1793 public static void UsbDebuggingEnabled_READ_WRITE()
1795 LogUtils.StartTest();
1797 bool setValue = true;
1798 bool preValue = Tizen.System.SystemSettings.UsbDebuggingEnabled;
1799 Tizen.System.SystemSettings.UsbDebuggingEnabled = setValue;
1800 Assert.IsTrue(Tizen.System.SystemSettings.UsbDebuggingEnabled, "UsbDebuggingEnabled_READ_WRITE: Set value and get value of the property should be same.");
1801 Tizen.System.SystemSettings.UsbDebuggingEnabled = preValue;
1805 public static async void TestAllAsync()
1808 LogUtils.initWriteResult();
1809 IncomingCallRingtone_READ_WRITE();
1810 await IncomingCallRingtoneChanged_CHECK_EVENT();
1811 WallpaperHomeScreen_READ_WRITE();
1812 await WallpaperHomeScreenChanged_CHECK_EVENT();
1813 WallpaperLockScreen_READ_WRITE();
1814 await WallpaperLockScreenChanged_CHECK_EVENT();
1815 FontSize_READ_WRITE_ALL();
1816 await FontSizeChanged_CHECK_EVENT_SMALL();
1817 await FontSizeChanged_CHECK_EVENT_NORMAL();
1818 await FontSizeChanged_CHECK_EVENT_LARGE();
1819 await FontSizeChanged_CHECK_EVENT_HUGE();
1820 await FontSizeChanged_CHECK_EVENT_GIANT();
1821 FontType_READ_WRITE();
1822 await FontTypeChanged_CHECK_EVENT();
1823 MotionActivationEnabled_READ_WRITE();
1824 await MotionActivationSettingChanged_CHECK_EVENT();
1825 EmailAlertRingtone_READ_WRITE();
1826 await EmailAlertRingtoneChanged_CHECK_EVENT();
1827 Data3GNetworkEnabled_READ_WRITE();
1828 await Data3GNetworkSettingChanged_CHECK_EVENT();
1829 LockscreenApp_READ_WRITE();
1830 await LockscreenAppChanged_CHECK_EVENT();
1831 DefaultFontType_READ_ONLY();
1832 LocaleCountry_READ_WRITE();
1833 await LocaleCountryChanged_CHECK_EVENT();
1834 LocaleLanguage_READ_WRITE();
1835 await LocaleLanguageChanged_CHECK_EVENT();
1836 LocaleTimeFormat24HourEnabled_READ_WRITE();
1837 await LocaleTimeFormat24HourSettingChanged_CHECK_EVENT();
1838 LocaleTimeZone_READ_WRITE();
1839 await LocaleTimeZoneChanged_CHECK_EVENT();
1840 SoundLockEnabled_READ_ONLY();
1841 SoundSilentModeEnabled_READ_ONLY();
1842 SoundTouchEnabled_READ_ONLY();
1843 DisplayScreenRotationAutoEnabled_READ_ONLY();
1844 DeviceName_READ_ONLY();
1845 MotionEnabled_READ_ONLY();
1846 NetworkWifiNotificationEnabled_READ_ONLY();
1847 NetworkFlightModeEnabled_READ_ONLY();
1849 SoundNotification_READ_WRITE();
1850 await SoundNotificationChanged_CHECK_EVENT();
1851 SoundNotificationRepetitionPeriod_READ_WRITE();
1852 await SoundNotificationRepetitionPeriodChanged_CHECK_EVENT();
1853 LockState_READ_WRITE_ALL();
1854 await LockStateChanged_CHECK_EVENT_LOCK();
1855 await LockStateChanged_CHECK_EVENT_UNLOCK();
1856 await LockStateChanged_CHECK_EVENT_LAUNCHING_LOCK();
1858 UsbDebuggingEnabled_READ_WRITE();
1860 Tizen.Log.Debug("CS-SYSTEM-SETTINGS", "Data3GNetworkSettingChangedEventArgsTests");
1861 await Data3GNetworkSettingChangedEventArgsTests.Value_PROPERTY_READ_ONLY();
1863 Tizen.Log.Debug("CS-SYSTEM-SETTINGS", "EmailAlertRingtoneChangedEventArgsTests");
1864 await EmailAlertRingtoneChangedEventArgsTests.Value_PROPERTY_READ_ONLY();
1866 Tizen.Log.Debug("CS-SYSTEM-SETTINGS", "FontSizeChangedEventArgsTests");
1867 await FontSizeChangedEventArgsTests.Value_ENUM_GIANT();
1868 await FontSizeChangedEventArgsTests.Value_ENUM_HUGE();
1869 await FontSizeChangedEventArgsTests.Value_ENUM_LARGE();
1870 await FontSizeChangedEventArgsTests.Value_ENUM_NORMAL();
1871 await FontSizeChangedEventArgsTests.Value_ENUM_SMALL();
1873 Tizen.Log.Debug("CS-SYSTEM-SETTINGS", "FontTypeChangedEventArgsTests");
1874 await FontTypeChangedEventArgsTests.Value_PROPERTY_READ_ONLY();
1876 Tizen.Log.Debug("CS-SYSTEM-SETTINGS", "IncomingCallRingtoneChangedEventArgsTests");
1877 await IncomingCallRingtoneChangedEventArgsTests.Value_PROPERTY_READ_ONLY();
1879 Tizen.Log.Debug("CS-SYSTEM-SETTINGS", "LocaleCountryChangedEventArgsTests");
1880 await LocaleCountryChangedEventArgsTests.Value_PROPERTY_READ_ONLY();
1882 Tizen.Log.Debug("CS-SYSTEM-SETTINGS", "LocaleLanguageChangedEventArgsTests");
1883 await LocaleLanguageChangedEventArgsTests.Value_PROPERTY_READ_ONLY();
1885 Tizen.Log.Debug("CS-SYSTEM-SETTINGS", "LocaleTimeFormat24HourSettingChangedEventArgsTests");
1886 await LocaleTimeFormat24HourSettingChangedEventArgsTests.Value_PROPERTY_READ_ONLY();
1888 Tizen.Log.Debug("CS-SYSTEM-SETTINGS", "LocaleTimeZoneChangedEventArgsTests");
1889 await LocaleTimeZoneChangedEventArgsTests.Value_PROPERTY_READ_ONLY();
1891 Tizen.Log.Debug("CS-SYSTEM-SETTINGS", "LockStateChangedEventArgsTests");
1892 await LockStateChangedEventArgsTests.Value_ENUM_LAUNCHING_LOCK();
1893 await LockStateChangedEventArgsTests.Value_ENUM_LOCK();
1894 await LockStateChangedEventArgsTests.Value_ENUM_UNLOCK();
1896 Tizen.Log.Debug("CS-SYSTEM-SETTINGS", "MotionActivationSettingChangedEventArgsTests");
1897 await MotionActivationSettingChangedEventArgsTests.Value_PROPERTY_READ_ONLY();
1899 Tizen.Log.Debug("CS-SYSTEM-SETTINGS", "SoundNotificationChangedEventArgsTests");
1900 await SoundNotificationChangedEventArgsTests.Value_PROPERTY_READ_ONLY();
1902 Tizen.Log.Debug("CS-SYSTEM-SETTINGS", "SoundNotificationRepetitionPeriodChangedEventArgsTests");
1903 await SoundNotificationRepetitionPeriodChangedEventArgsTests.Value_PROPERTY_READ_ONLY();
1905 Tizen.Log.Debug("CS-SYSTEM-SETTINGS", "WallpaperHomeScreenChangedEventArgsTests");
1906 await WallpaperHomeScreenChangedEventArgsTests.Value_PROPERTY_READ_ONLY();
1908 Tizen.Log.Debug("CS-SYSTEM-SETTINGS", "WallpaperLockScreenChangedEventArgsTests");
1909 await WallpaperLockScreenChangedEventArgsTests.Value_PROPERTY_READ_ONLY();
1912 Tizen.Log.Debug("CS-SYSTEM-SETTINGS", "BlackLightTime Test");
1913 ScreenBacklightTime_READ_WRITE_ALL();
1914 await ScreenBacklightTimeChanged_CHECK_EVENT_15();
1915 await ScreenBacklightTimeChanged_CHECK_EVENT_30();
1916 await ScreenBacklightTimeChanged_CHECK_EVENT_60();
1917 await ScreenBacklightTimeChanged_CHECK_EVENT_120();
1918 await ScreenBacklightTimeChanged_CHECK_EVENT_300();
1919 await ScreenBacklightTimeChanged_CHECK_EVENT_600();
1922 Tizen.Log.Debug("CS-SYSTEM-SETTINGS", "ScreenBacklightTimeChangedEventArgsTests");
1923 await ScreenBacklightTimeChangedEventArgsTests.Value_PROPERTY_READ_ONLY_120();
1924 await ScreenBacklightTimeChangedEventArgsTests.Value_PROPERTY_READ_ONLY_15();
1925 await ScreenBacklightTimeChangedEventArgsTests.Value_PROPERTY_READ_ONLY_30();
1926 await ScreenBacklightTimeChangedEventArgsTests.Value_PROPERTY_READ_ONLY_300();
1927 await ScreenBacklightTimeChangedEventArgsTests.Value_PROPERTY_READ_ONLY_60();
1928 await ScreenBacklightTimeChangedEventArgsTests.Value_PROPERTY_READ_ONLY_600();
1930 LogUtils.WriteResult();
1931 Tizen.Log.Debug("CS-SYSTEM-SETTINGS", "All of Unit test for Tizen.System.SystemSettings have completed!");