From: rina6350.you Date: Wed, 21 Jun 2017 11:11:01 +0000 (+0900) Subject: Add the scenario for chekcing GenList operation X-Git-Tag: submit/trunk/20170823.075128~110^2~40^2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=cd508971a5d818630238826f4b78bd252629ab16;p=platform%2Fcore%2Fcsapi%2Ftizenfx.git Add the scenario for chekcing GenList operation TASK=TCAPI-2500 Change-Id: I902c331881932ff2adb853cb513af0fbc14cf3da --- diff --git a/test/ElmSharp.Test/TC/GenListTest2.cs b/test/ElmSharp.Test/TC/GenListTest2.cs old mode 100644 new mode 100755 index 58d0952..a22311a --- a/test/ElmSharp.Test/TC/GenListTest2.cs +++ b/test/ElmSharp.Test/TC/GenListTest2.cs @@ -16,6 +16,7 @@ using System; using ElmSharp; +using System.Collections.Generic; namespace ElmSharp.Test { @@ -55,14 +56,18 @@ namespace ElmSharp.Test return string.Format("{0} - {1}", (string)obj, part); } }; + GenListItem[] items = new GenListItem[100]; - for (int i = 0; i < 100; i++) + int i = 0; + for (i = 0; i < 100; i++) { items[i] = list.Append(defaultClass, string.Format("{0} Item", i)); } list.Show(); list.ItemSelected += List_ItemSelected; + GenListItem scroll = items[0]; + box.PackEnd(list); Button first = new Button(window) { @@ -76,9 +81,20 @@ namespace ElmSharp.Test AlignmentX = -1, WeightX = 1, }; + Button Add = new Button(window) + { + Text = "Add", + AlignmentX = -1, + WeightX = 1, + }; + Add.Clicked += (s, e) => + { + scroll = list.InsertBefore(defaultClass, string.Format("{0} Item", i++), scroll); + list.ScrollTo(scroll, ScrollToPosition.In, false); + }; first.Clicked += (s, e) => { - list.ScrollTo(items[0], ScrollToPosition.In, true); + list.ScrollTo(scroll, ScrollToPosition.In, true); }; last.Clicked += (s, e) => { @@ -86,8 +102,10 @@ namespace ElmSharp.Test }; first.Show(); last.Show(); + Add.Show(); box.PackEnd(first); box.PackEnd(last); + box.PackEnd(Add); }