Merge "[Telephony] Sample App implementation."
[platform/core/csapi/tizenfx.git] / test / ElmSharp.Test / TC / EvasImageTest2.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 System.IO;
19 using ElmSharp;
20 using System.Collections.Generic;
21
22 namespace ElmSharp.Test
23 {
24     public class EvasImageTest2 : TestCaseBase
25     {
26         public override string TestName => "EvasImageTest2";
27         public override string TestDescription => "To test EvasImage";
28
29         public override void Run(Window window)
30         {
31             Conformant conformant = new Conformant(window);
32             conformant.Show();
33             Box box = new Box(window);
34             conformant.SetContent(box);
35             box.Show();
36
37             Image realObject2 = new Image(window)
38             {
39                 AlignmentX = -1,
40                 AlignmentY = -1,
41                 WeightX = 1,
42                 WeightY = 1,
43             };
44             realObject2.Load(Path.Combine(TestRunner.ResourceDir, "picture.png"));
45             realObject2.Show();
46
47             EvasImage img1 = new EvasImage(window)
48             {
49                 AlignmentX = -1,
50                 AlignmentY = -1,
51                 WeightX = 1,
52                 WeightY = 1,
53             };
54             img1.IsFilled = true;
55             img1.File = Path.Combine(TestRunner.ResourceDir, "picture.png");
56             img1.Show();
57
58             EvasImage img2 = new EvasImage(window)
59             {
60                 AlignmentX = -1,
61                 AlignmentY = -1,
62                 WeightX = 1,
63                 WeightY = 1,
64             };
65             img2.IsFilled = true;
66             img2.SetStream(new FileStream(Path.Combine(TestRunner.ResourceDir, "picture.png"), FileMode.Open, FileAccess.Read));
67             img2.Show();
68
69             EvasImage img3 = new EvasImage(window)
70             {
71                 AlignmentX = -1,
72                 AlignmentY = -1,
73                 WeightX = 1,
74                 WeightY = 1,
75             };
76             img3.IsFilled = true;
77             img3.SetSource(realObject2);
78             img3.Show();
79             img3.IsSourceVisible = true;
80
81             box.PackEnd(realObject2);
82             box.PackEnd(img1);
83             box.PackEnd(img2);
84             box.PackEnd(img3);
85         }
86     }
87 }