[ElmSharp.Wearable] deprecate AngleRatio, fix incorrect default value of AngleRatio...
[platform/core/csapi/tizenfx.git] / test / ElmSharp.Wearable.Test / TC / CircleSpinnerTest3.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 ElmSharp.Wearable;
18
19 namespace ElmSharp.Test.TC
20 {
21     class CircleSpinnerTest3 : TestCaseBase
22     {
23         public override string TestName => "CircleSpinnerTest3";
24         public override string TestDescription => "To test basic operation of Circle Spinner with AngleRatio";
25
26         public override void Run(Window window)
27         {
28             Log.Debug(TestName, "CircleSpinnerTest run");
29             Conformant conformant = new Conformant(window);
30             conformant.Show();
31
32             Naviframe naviframe = new Naviframe(window);
33             naviframe.Show();
34             conformant.SetContent(naviframe);
35
36             Layout layout = new Layout(naviframe);
37             layout.SetTheme("layout", "circle", "spinner");
38
39             var surface = new CircleSurface(conformant);
40             CircleSpinner spn1 = new CircleSpinner(naviframe, surface)
41             {
42                 Text = "Spinner Test",
43                 LabelFormat = "%d Value",
44                 Style = "circle",
45                 AngleRatio = 1.0,
46                 Minimum = 0,
47                 Maximum = 100,
48                 Value = 0,
49                 Step = 10,
50                 Interval = 0.5,
51                 AlignmentX = -1,
52                 AlignmentY = 1,
53                 WeightX = 1,
54                 WeightY = 1
55             };
56             ((IRotaryActionWidget)spn1).Activate();
57             spn1.AddSpecialValue(50, "50 match !!!!");
58             layout.SetContent(spn1);
59
60             Button btn = new Button(layout) {
61                 Text = "OK",
62                 Style = "bottom",
63             };
64
65             layout.SetPartContent("elm.swallow.btn", btn);
66             layout.SetPartText("elm.text", "Set value");
67
68             naviframe.Push(layout, null, "empty");
69         }
70     }
71 }