2 * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
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
8 * http://www.apache.org/licenses/LICENSE-2.0
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.
20 namespace ElmSharp.Test
22 class BackgroundColorTest1 : TestCaseBase
24 public override string TestName => "BackgroundColorTest1";
25 public override string TestDescription => "To test basic operation of Widget's background Color";
29 public override void Run(Window window)
31 Button button1 = new Button(window) {
32 Text = "Target Button",
34 button1.Resize(window.ScreenSize.Width, 100);
38 Label label1 = new Label(window) {
39 Text = button1.BackgroundColor.ToString(),
40 BackgroundColor = Color.Black,
43 label1.Resize(window.ScreenSize.Width, 100);
47 Button button2 = new Button(window) {
48 Text = "Set Color.Red",
49 BackgroundColor = Color.Red,
51 button2.Clicked += (e, o) =>
53 button1.BackgroundColor = Color.Red;
54 label1.Text = button1.BackgroundColor.ToString();
56 button2.Resize(window.ScreenSize.Width, 100);
60 Button button3 = new Button(window) {
61 Text = "Set Color(125,200,255, 150)",
62 BackgroundColor = new Color(125,200,255, 150)
64 button3.Clicked += (e, o) =>
66 button1.BackgroundColor = button3.BackgroundColor;
67 label1.Text = button1.BackgroundColor.ToString();
69 button3.Resize(window.ScreenSize.Width, 100);
73 Button button4 = new Button(window) {
74 Text = "Set Color(125, 200, 255, 10)",
75 BackgroundColor = new Color(125, 200, 255, 10)
77 button4.Clicked += (e,o) =>
79 button1.BackgroundColor = button4.BackgroundColor;
80 label1.Text = button1.BackgroundColor.ToString();
82 button4.Resize(window.ScreenSize.Width, 100);
86 Button button5 = new Button(window) {
87 Text = "Set Color.Default",
88 BackgroundColor = Color.Default
90 button5.Clicked += (e, o) =>
92 button1.BackgroundColor = button5.BackgroundColor;
93 label1.Text = button1.BackgroundColor.ToString();
95 button5.Resize(window.ScreenSize.Width, 100);