Add the scenario for chekcing GenList operation
authorrina6350.you <rina6350.you@samsung.com>
Wed, 21 Jun 2017 11:11:01 +0000 (20:11 +0900)
committerrina6350.you <rina6350.you@samsung.com>
Wed, 21 Jun 2017 11:11:01 +0000 (20:11 +0900)
TASK=TCAPI-2500

Change-Id: I902c331881932ff2adb853cb513af0fbc14cf3da

test/ElmSharp.Test/TC/GenListTest2.cs [changed mode: 0644->0755]

old mode 100644 (file)
new mode 100755 (executable)
index 58d0952..a22311a
@@ -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);
 
         }