Release 11.0.0.18008
[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 Tizen.NUI.Components;
5
6 namespace SystemSettingsUnitTest
7 {
8     class Program : NUIApplication
9     {
10         static public Progress testProgress;
11         static public TextLabel text;
12         protected override void OnCreate()
13         {
14             base.OnCreate();
15             DisplayString();
16             SystemSettingsTests.TestAllAsync();
17             
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         public void DisplayString()
29         {
30             Window.Instance.KeyEvent += OnKeyEvent;
31
32             testProgress = new Progress();
33             testProgress.MaxValue = 100;
34             testProgress.MinValue = 0;
35             testProgress.CurrentValue = 0;
36             testProgress.TrackColor = Color.Black;
37             testProgress.ProgressColor = Color.Green; 
38             testProgress.Position2D = new Position2D(30, 100);
39             testProgress.Size2D = new Size2D(300, 5);
40
41             text = new TextLabel("SystemSettings Unit Test");
42             text.HorizontalAlignment = HorizontalAlignment.Center;
43             text.VerticalAlignment = VerticalAlignment.Center;
44             text.TextColor = Color.Blue;
45             text.PointSize = 12.0f;
46             text.HeightResizePolicy = ResizePolicyType.FillToParent;
47             text.WidthResizePolicy = ResizePolicyType.FillToParent;
48             Window.Instance.GetDefaultLayer().Add(text);
49             Window.Instance.GetDefaultLayer().Add(testProgress);
50
51         }
52
53         public void OnKeyEvent(object sender, Window.KeyEventArgs e)
54         {
55             if (e.Key.State == Key.StateType.Down && (e.Key.KeyPressedName == "XF86Back" || e.Key.KeyPressedName == "Escape"))
56             {
57                 Exit();
58             }
59         }
60
61         static void Main(string[] args)
62         {
63
64             var app = new Program();
65             app.Run(args);
66
67         }
68     }
69 }