[SystemSettings] Add SystemSettings.UnitTest (#679)
[platform/core/csapi/tizenfx.git] / test / Tizen.System.SystemSettings.UnitTest / SystemSettings.UnitTest / SystemSettings.UnitTest.cs
1 using System;
2 using Tizen.NUI;
3 using Tizen.NUI.BaseComponents;
4 using System.Threading.Tasks;
5 using Tizen;
6 using Tizen.System;
7
8
9 namespace SystemSettingsUnitTest
10 {
11     class Program : NUIApplication
12     {
13         protected override void OnCreate()
14         {
15             base.OnCreate();
16             SystemSettingsTests.TestAllAsync();
17             Initialize();
18         }
19      
20         public static void PrintOkFuncName(String str_in)
21         {
22             String func_name = str_in.ToString();
23             String[] parse_func = func_name.Split(' ');
24             Console.WriteLine(parse_func[1] + " >>>>>> ok");
25
26         }
27
28         void Initialize()
29         {
30             Window.Instance.KeyEvent += OnKeyEvent;
31             TextLabel text = new TextLabel("SystemSettings Unit Test");
32             text.HorizontalAlignment = HorizontalAlignment.Center;
33             text.VerticalAlignment = VerticalAlignment.Center;
34             text.TextColor = Color.Blue;
35             text.PointSize = 12.0f;
36             text.HeightResizePolicy = ResizePolicyType.FillToParent;
37             text.WidthResizePolicy = ResizePolicyType.FillToParent;
38             Window.Instance.GetDefaultLayer().Add(text);
39
40             /*
41             Animation animation = new Animation(2000);
42             animation.AnimateTo(text, "Orientation", new Rotation(new Radian(new Degree(180.0f)), PositionAxis.X), 200, 500);
43             animation.AnimateTo(text, "Orientation", new Rotation(new Radian(new Degree(0.0f)), PositionAxis.X), 500, 1000);
44             animation.Looping = true;
45             animation.Play();
46             */
47
48         }
49
50         public void OnKeyEvent(object sender, Window.KeyEventArgs e)
51         {
52             if (e.Key.State == Key.StateType.Down && (e.Key.KeyPressedName == "XF86Back" || e.Key.KeyPressedName == "Escape"))
53             {
54                 Exit();
55             }
56         }
57
58         static void Main(string[] args)
59         {
60             
61             var app = new Program();
62             app.Run(args);
63             
64         }
65     }
66 }