diff options
author | rina6350.you <rina6350.you@samsung.com> | 2017-05-11 13:56:23 +0900 |
---|---|---|
committer | rina6350.you <rina6350.you@samsung.com> | 2017-05-11 13:56:23 +0900 |
commit | 95be64e2f1ce97f77a6733aa92e1440401b7f8e7 (patch) | |
tree | 5bdc70c36ebb117a12037c5d3ffda52e56278e7a /ElmSharp.Test | |
parent | 2d53b498a74b0ad1cb243fea7157c9450dde5e4d (diff) | |
download | elm-sharp-95be64e2f1ce97f77a6733aa92e1440401b7f8e7.tar.gz elm-sharp-95be64e2f1ce97f77a6733aa92e1440401b7f8e7.tar.bz2 elm-sharp-95be64e2f1ce97f77a6733aa92e1440401b7f8e7.zip |
Add a Toolbar TC
Change-Id: I1d59c8172ceb0cadf9a3b8e356f3823c67c77287
Diffstat (limited to 'ElmSharp.Test')
-rwxr-xr-x | ElmSharp.Test/ElmSharp.Test.csproj | 7 | ||||
-rwxr-xr-x | ElmSharp.Test/TC/ToolbarTest2.cs | 73 |
2 files changed, 77 insertions, 3 deletions
diff --git a/ElmSharp.Test/ElmSharp.Test.csproj b/ElmSharp.Test/ElmSharp.Test.csproj index ed2ba74..c03dcef 100755 --- a/ElmSharp.Test/ElmSharp.Test.csproj +++ b/ElmSharp.Test/ElmSharp.Test.csproj @@ -107,6 +107,7 @@ <Compile Include="TC\SliderTest1.cs" /> <Compile Include="TC\SpinnerTest1.cs" /> <Compile Include="TC\ToolbarTest1.cs" /> + <Compile Include="TC\ToolbarTest2.cs" /> <Compile Include="TC\WindowInternalTest.cs" /> <Compile Include="TestCaseBase.cs" /> <Compile Include="TestRunner.cs" /> @@ -197,11 +198,11 @@ <ProjectExtensions> <VisualStudio> <FlavorProperties GUID="{2F98DAC9-6F16-457B-AED7-D43CAC379341}" Configuration="Debug|Any CPU"> - <ProjectCorporateFlavorCfg /> + <ProjectCommonFlavorCfg /> </FlavorProperties> <FlavorProperties GUID="{2F98DAC9-6F16-457B-AED7-D43CAC379341}" Configuration="Release|Any CPU"> - <ProjectCorporateFlavorCfg /> + <ProjectCommonFlavorCfg /> </FlavorProperties> </VisualStudio> </ProjectExtensions> -</Project> +</Project>
\ No newline at end of file diff --git a/ElmSharp.Test/TC/ToolbarTest2.cs b/ElmSharp.Test/TC/ToolbarTest2.cs new file mode 100755 index 0000000..8e19d1d --- /dev/null +++ b/ElmSharp.Test/TC/ToolbarTest2.cs @@ -0,0 +1,73 @@ +/* + * 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; +using System.Collections.Generic; + +namespace ElmSharp.Test +{ + public class ToolbarTest2 : TestCaseBase + { + Dictionary<ToolbarItem, int> _itemTable = new Dictionary<ToolbarItem, int>(); + Dictionary<int, ToolbarItem> _reverseItemTable = new Dictionary<int, ToolbarItem>(); + public override string TestName => "ToolbarTest2"; + public override string TestDescription => "To test basic operation of Toolbar"; + public override void Run(Window window) + { + Conformant conformant = new Conformant(window); + conformant.Show(); + Box outterBox = new Box(window) + { + AlignmentX = -1, + AlignmentY = -1, + WeightX = 1, + WeightY = 1, + IsHorizontal = false, + BackgroundColor = Color.Aqua, + }; + outterBox.Show(); + + Toolbar toolbar = new Toolbar(window) + { + AlignmentX = -1, + WeightX = 1, + }; + + toolbar.Show(); + outterBox.PackEnd(toolbar); + + int idx = 1; + ToolbarItem item = toolbar.Append(string.Format("{0} home", idx), "home"); + idx++; + + Button bt = new Button(window) + { + Text = "Add ToolbarItem", + MinimumWidth = 400 + }; + bt.Clicked += (s, e) => + { + ToolbarItem item2 = toolbar.Append(string.Format("{0} home", idx), "home"); + idx++; + }; + + bt.Show(); + outterBox.PackEnd(bt); + conformant.SetContent(outterBox); + } + } +} |