Merge remote-tracking branch 'tizen-platform-config/tizen'
[platform/core/csapi/tizenfx.git] / test / ElmSharp.Wearable.Test / TC / CircleDateTimeSelectorTest3.cs
1 /*
2  * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
3  *
4  * Licensed under the Apache License, Version 2.0 (the License);
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an AS IS BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16
17 using System;
18 using ElmSharp.Wearable;
19
20 namespace ElmSharp.Test.TC
21 {
22     class CircleDateTimeSelectorTest3 : TestCaseBase
23     {
24         public override string TestName => "CircleDateTimeSelectorTest3";
25         public override string TestDescription => "To display a date time selector with circle UI";
26
27         public override void Run(Window window)
28         {
29             Conformant conformant = new Conformant(window);
30             conformant.Show();
31
32             Layout layout = new Layout(window);
33
34             layout.SetTheme("layout", "circle", "datetime");
35
36             conformant.SetContent(layout);
37
38             DateTimeSelector datetime = new CircleDateTimeSelector(conformant)
39             {
40                 DateTime = DateTime.Now,
41                 Style = "timepicker/circle",
42                 Disabled = true
43             };
44
45             layout.SetContent(datetime);
46
47             Button btn = new Button(layout)
48             {
49                 Text = "OK",
50                 Style = "bottom",
51             };
52
53             layout.SetPartContent("elm.swallow.btn", btn);
54
55             layout.SetPartText("elm.text", "Set time");
56
57             datetime.DateTimeChanged += (object sender, DateChangedEventArgs e) =>
58             {
59                 Log.Debug(TestName, "Old DateTime={0}", e.OldDate.ToString());
60                 Log.Debug(TestName, "New DateTime={0}", e.NewDate.ToString());
61                 Log.Debug(TestName, "Current DateTime={0}", datetime.DateTime.ToString());
62             };
63         }
64     }
65 }