diff options
author | Seungkeun Lee <sngn.lee@samsung.com> | 2016-12-29 13:03:34 +0900 |
---|---|---|
committer | Seungkeun Lee <sngn.lee@samsung.com> | 2016-12-29 13:03:34 +0900 |
commit | aa98d780d14e099cb69df1dcf9551dcf4189ac0f (patch) | |
tree | 3b7779f707c562efc146e6446cdd1e99023d7938 | |
parent | 662a44ea670abb40844096b486d97162969ede41 (diff) | |
download | elm-sharp-aa98d780d14e099cb69df1dcf9551dcf4189ac0f.tar.gz elm-sharp-aa98d780d14e099cb69df1dcf9551dcf4189ac0f.tar.bz2 elm-sharp-aa98d780d14e099cb69df1dcf9551dcf4189ac0f.zip |
Add Label test TC
- To test valgin
- To test TextBlockFormattedSize
Change-Id: I396cff2513ba298ef6f2bad380550c814a386733
-rw-r--r-- | ElmSharp.Test/ElmSharp.Test.csproj | 1 | ||||
-rw-r--r-- | ElmSharp.Test/TC/LabelTest2.cs | 83 |
2 files changed, 84 insertions, 0 deletions
diff --git a/ElmSharp.Test/ElmSharp.Test.csproj b/ElmSharp.Test/ElmSharp.Test.csproj index b874efe..5ce3e11 100644 --- a/ElmSharp.Test/ElmSharp.Test.csproj +++ b/ElmSharp.Test/ElmSharp.Test.csproj @@ -65,6 +65,7 @@ <Compile Include="TC\GenListTest6.cs" /> <Compile Include="TC\ImageTest3.cs" /> <Compile Include="TC\ImageTest2.cs" /> + <Compile Include="TC\LabelTest2.cs" /> <Compile Include="TC\TableTest1.cs" /> <Compile Include="TC\GenListTest8.cs" /> <Compile Include="TC\PerformanceTest.cs" /> diff --git a/ElmSharp.Test/TC/LabelTest2.cs b/ElmSharp.Test/TC/LabelTest2.cs new file mode 100644 index 0000000..5d837d6 --- /dev/null +++ b/ElmSharp.Test/TC/LabelTest2.cs @@ -0,0 +1,83 @@ +/* + * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved + * + * Licensed under the Apache License, Version 2.0 (the License); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an AS IS BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +using System; +using ElmSharp; + +namespace ElmSharp.Test +{ + class LabelTest2 : TestCaseBase + { + public override string TestName => "LabelTest2"; + public override string TestDescription => "To test basic operation of Label"; + + public override void Run(Window window) + { + Background bg = new Background(window); + bg.Color = Color.White; + bg.Move(0, 0); + bg.Resize(window.ScreenSize.Width, window.ScreenSize.Height); + bg.Show(); + + Label label1 = new Label(window); + label1.Text = "[default valign=top] gyj <span valign=bottom>[bottom gyp]</span>, <span valign=top>[top gyp]</span>, <span valign=middle>[middle gyp]</span>"; + label1.EdjeObject["elm.text"].TextStyle = "DEFAULT = 'color=#000000FF backing_color=#ff0000 backing=on font_size=25 align=left valign=top wrap=word'"; + label1.Resize(650, 0); + var size = label1.EdjeObject["elm.text"].TextBlockFormattedSize; + label1.Show(); + label1.Resize(size.Width, size.Height); + label1.Move(0, 0); + + Label label2 = new Label(window); + label2.Move(0, size.Height + 10); + label2.Text = "[default valign=middle] gyj <span valign=bottom>[bottom gyp]</span>, <span valign=top>[top gyp]</span>, <span valign=middle>[middle gyp]</span>"; + label2.EdjeObject["elm.text"].TextStyle = "DEFAULT = 'color=#000000FF backing_color=#ff0000 backing=on font_size=25 align=left valign=middle wrap=word'"; + label2.Resize(650, 0); + size = label2.EdjeObject["elm.text"].TextBlockFormattedSize; + label2.Show(); + label2.Resize(size.Width, size.Height); + + Label label3 = new Label(window); + label3.Move(0, label2.Geometry.Y + size.Height + 10); + label3.Text = "[default valign=bottom] gyj <span valign=bottom>[bottom gyp]</span>, <span valign=top>[top gyp]</span>, <span valign=middle>[middle gyp]</span>"; + label3.EdjeObject["elm.text"].TextStyle = "DEFAULT = 'color=#000000FF backing_color=#ff0000 backing=on font_size=25 align=left valign=bottom wrap=word'"; + label3.Resize(650, 0); + size = label3.EdjeObject["elm.text"].TextBlockFormattedSize; + label3.Show(); + label3.Resize(size.Width, size.Height); + + Label label4 = new Label(window); + label4.Move(0, label3.Geometry.Y + size.Height + 10); + label4.Text = "<span color=#000000>[No TextStyle]</span>" + + "<span color=#000000 valign=bottom>[bottom gyp]</span>, " + + "<span color=#000000 valign=top>[top gyp]</span>, " + + "<span color=#000000 valign=middle>[middle gyp]</span>"; + label4.Resize(650, 0); + size = label4.EdjeObject["elm.text"].TextBlockFormattedSize; + label4.Show(); + label4.Resize(size.Width, size.Height); + + Label label5 = new Label(window); + label5.Move(0, label4.Geometry.Y + size.Height + 10); + label5.Text = "<span valign=top color=#000000 font_size=50>[top gyp]</span>"; + label5.Resize(650, 0); + size = label5.EdjeObject["elm.text"].TextBlockFormattedSize; + label5.Show(); + label5.Resize(size.Width, size.Height); + } + + } +} |