1 using System.Threading.Tasks;
3 using System.Threading;
7 namespace SystemSettingsUnitTest
10 //[Description("Tizen.System.FontTypeChangedEventArgs Tests")]
11 public static class FontTypeChangedEventArgsTests
13 private static bool s_fontTypeCallbackCalled = false;
14 private static readonly string s_fontTypeValue = "BreezeSans";
17 //[Description("Check FontTypeChangedEventArgs Value property")]
18 //[Property("SPEC", "Tizen.System.FontTypeChangedEventArgs.Value A")]
19 //[Property("SPEC_URL", "-")]
20 //[Property("CRITERIA", "PRO")]
21 //[Property("AUTHOR", "Aditya Aswani, a.aswani@samsung.com")]
22 public static async Task Value_PROPERTY_READ_ONLY()
27 * 1. Assign event handler
29 Tizen.System.SystemSettings.FontTypeChanged += OnFontTypeChangedValue;
31 string preValue = Tizen.System.SystemSettings.FontType;
32 Tizen.System.SystemSettings.FontType = s_fontTypeValue;
33 await Task.Delay(2000);
34 Assert.IsTrue(s_fontTypeCallbackCalled, "Value_PROPERTY_READ_ONLY: EventHandler added. Not getting called");
38 * 1. Reset callback called flag
39 * 2. Remove event handler
40 * 3. Reset property value
42 s_fontTypeCallbackCalled = false;
43 Tizen.System.SystemSettings.FontTypeChanged -= OnFontTypeChangedValue;
44 Tizen.System.SystemSettings.FontType = preValue;
47 private static void OnFontTypeChangedValue(object sender, Tizen.System.FontTypeChangedEventArgs e)
49 s_fontTypeCallbackCalled = true;
51 Assert.IsInstanceOf<string>(e.Value, "OnFontTypeChangedValue: FontType not an instance of string");
52 Assert.IsTrue(s_fontTypeValue.CompareTo(e.Value) == 0, "OnFontTypeChangedValue: The callback should receive the latest value for the property.");