From 2e3e865935b56f56856551d639ec3f3fb187e02b Mon Sep 17 00:00:00 2001 From: "rina6350.you" Date: Wed, 21 Jun 2017 20:01:06 +0900 Subject: Add test scenario for checking Toolbar operation change-Id: Ibb0a1fc23b36bf5646dc70f26be702fa261837fa --- ElmSharp.Test/TC/ToolbarTest2.cs | 36 +++++++++++++++++++++++++----------- 1 file changed, 25 insertions(+), 11 deletions(-) diff --git a/ElmSharp.Test/TC/ToolbarTest2.cs b/ElmSharp.Test/TC/ToolbarTest2.cs index 8e19d1d..07780fb 100755 --- a/ElmSharp.Test/TC/ToolbarTest2.cs +++ b/ElmSharp.Test/TC/ToolbarTest2.cs @@ -30,7 +30,7 @@ namespace ElmSharp.Test { Conformant conformant = new Conformant(window); conformant.Show(); - Box outterBox = new Box(window) + Box outerBox = new Box(window) { AlignmentX = -1, AlignmentY = -1, @@ -39,20 +39,18 @@ namespace ElmSharp.Test IsHorizontal = false, BackgroundColor = Color.Aqua, }; - outterBox.Show(); + outerBox.Show(); Toolbar toolbar = new Toolbar(window) { AlignmentX = -1, WeightX = 1, }; - toolbar.Show(); - outterBox.PackEnd(toolbar); + outerBox.PackEnd(toolbar); - int idx = 1; - ToolbarItem item = toolbar.Append(string.Format("{0} home", idx), "home"); - idx++; + List items = new List(); + items.Add(toolbar.Append(string.Format("{0} home", items.Count), "home")); Button bt = new Button(window) { @@ -61,13 +59,29 @@ namespace ElmSharp.Test }; bt.Clicked += (s, e) => { - ToolbarItem item2 = toolbar.Append(string.Format("{0} home", idx), "home"); - idx++; + items.Add(toolbar.Append(string.Format("{0} home", items.Count), "home")); + }; + + Button removebt = new Button(window) + { + Text = "Remove first ToolbarItem", + MinimumWidth = 400 + }; + removebt.Clicked += (s, e) => + { + foreach (var cur in items) + { + items.Remove(cur); + cur.Delete(); + return; + } }; bt.Show(); - outterBox.PackEnd(bt); - conformant.SetContent(outterBox); + removebt.Show(); + outerBox.PackEnd(bt); + outerBox.PackEnd(removebt); + conformant.SetContent(outerBox); } } } -- cgit v1.2.3