From: rina6350.you Date: Wed, 21 Jun 2017 11:01:06 +0000 (+0900) Subject: Add test scenario for checking Toolbar operation X-Git-Tag: submit/trunk/20170823.075128~110^2~41^2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=3e0467b49eebfcc1cff8db2cfe1582bc60bf4a76;p=platform%2Fcore%2Fcsapi%2Ftizenfx.git Add test scenario for checking Toolbar operation change-Id: Ibb0a1fc23b36bf5646dc70f26be702fa261837fa --- diff --git a/test/ElmSharp.Test/TC/ToolbarTest2.cs b/test/ElmSharp.Test/TC/ToolbarTest2.cs index 8e19d1d..07780fb 100755 --- a/test/ElmSharp.Test/TC/ToolbarTest2.cs +++ b/test/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); } } }