Merge "[Telephony] Sample App implementation."
[platform/core/csapi/tizenfx.git] / test / ElmSharp.Test / TC / BackgroundColorTest1.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;
19
20 namespace ElmSharp.Test
21 {
22     class BackgroundColorTest1 : TestCaseBase
23     {
24         public override string TestName => "BackgroundColorTest1";
25         public override string TestDescription => "To test basic operation of Widget's background Color";
26
27         
28
29         public override void Run(Window window)
30         {
31             Button button1 = new Button(window) {
32                 Text = "Target Button",
33             };
34             button1.Resize(window.ScreenSize.Width, 100);
35             button1.Move(0, 0);
36             button1.Show();
37
38             Label label1 = new Label(window) {
39                 Text = button1.BackgroundColor.ToString(),
40                 BackgroundColor = Color.Black,
41                 Color = Color.White
42             };
43             label1.Resize(window.ScreenSize.Width, 100);
44             label1.Move(0, 100);
45             label1.Show();
46
47             Button button2 = new Button(window) {
48                 Text = "Set Color.Red",
49                 BackgroundColor = Color.Red,
50             };
51             button2.Clicked += (e, o) =>
52             {
53                 button1.BackgroundColor = Color.Red;
54                 label1.Text = button1.BackgroundColor.ToString();
55             };
56             button2.Resize(window.ScreenSize.Width, 100);
57             button2.Move(0, 400);
58             button2.Show();
59
60             Button button3 = new Button(window) {
61                 Text = "Set Color(125,200,255, 150)",
62                 BackgroundColor = new Color(125,200,255, 150)
63             };
64             button3.Clicked += (e, o) =>
65             {
66                 button1.BackgroundColor = button3.BackgroundColor;
67                 label1.Text = button1.BackgroundColor.ToString();
68             };
69             button3.Resize(window.ScreenSize.Width, 100);
70             button3.Move(0, 500);
71             button3.Show();
72
73             Button button4 = new Button(window) {
74                 Text = "Set Color(125, 200, 255, 10)",
75                 BackgroundColor = new Color(125, 200, 255, 10)
76             };
77             button4.Clicked += (e,o) =>
78             {
79                 button1.BackgroundColor = button4.BackgroundColor;
80                 label1.Text = button1.BackgroundColor.ToString();
81             };
82             button4.Resize(window.ScreenSize.Width, 100);
83             button4.Move(0, 600);
84             button4.Show();
85
86             Button button5 = new Button(window) {
87                 Text = "Set Color.Default",
88                 BackgroundColor = Color.Default
89             };
90             button5.Clicked += (e, o) =>
91             {
92                 button1.BackgroundColor = button5.BackgroundColor;
93                 label1.Text = button1.BackgroundColor.ToString();
94             };
95             button5.Resize(window.ScreenSize.Width, 100);
96             button5.Move(0, 700);
97             button5.Show();
98         }
99
100     }
101 }