Merge remote-tracking branch 'origin/master' into tizen
[platform/core/csapi/tizenfx.git] / test / Tizen.NUI.Tests / Tizen.NUI.Devel.Tests / testcase / internal / Utility / TSItemIdCollection.cs
1 using global::System;
2 using NUnit.Framework;
3 using NUnit.Framework.TUnit;
4 using Tizen.NUI.Components;
5 using Tizen.NUI.BaseComponents;
6
7 namespace Tizen.NUI.Devel.Tests 
8 {
9     using tlog = Tizen.Log;
10
11     [TestFixture]
12     [Description("Internal/Utility/ItemIdCollection")]
13     public class InternalItemIdCollectionTest
14     {
15         private const string tag = "NUITEST";
16
17         internal class MyItemIdCollection : ItemIdCollection
18         {
19             public MyItemIdCollection() : base()
20             { }
21         }
22
23         [SetUp]
24         public void Init()
25         {
26             tlog.Info(tag, "Init() is called!");
27         }
28
29         [TearDown]
30         public void Destroy()
31         {
32             tlog.Info(tag, "Destroy() is called!");
33         }
34
35         [Test]
36         [Category("P1")]
37         [Description("ItemIdCollection constructor.")]
38         [Property("SPEC", "Tizen.NUI.ItemIdCollection.ItemIdCollection C")]
39         [Property("SPEC_URL", "-")]
40         [Property("CRITERIA", "CONSTR")]
41         [Property("AUTHOR", "guowei.wang@samsung.com")]
42         public void ItemIdCollectionConstructor()
43         {
44             tlog.Debug(tag, $"ItemIdCollectionConstructor START");
45
46             uint[] itemId = new uint[] { 1, 2, 3, 4 };
47             global::System.Collections.ICollection c = itemId;
48
49             var testingTarget = new ItemIdCollection(c);
50             Assert.IsNotNull(testingTarget, "Should be not null!");
51             Assert.IsInstanceOf<ItemIdCollection>(testingTarget, "Should be an Instance of ItemIdCollection!");
52
53             Assert.IsFalse(testingTarget.IsFixedSize);
54             Assert.IsFalse(testingTarget.IsReadOnly);
55             Assert.IsFalse(testingTarget.IsSynchronized);
56
57             testingTarget.Dispose();
58             tlog.Debug(tag, $"ItemIdCollectionConstructor END (OK)");
59         }
60
61         [Test]
62         [Category("P1")]
63         [Description("ItemIdCollection constructor. With ItemIdCollection.")]
64         [Property("SPEC", "Tizen.NUI.ItemIdCollection.ItemIdCollection C")]
65         [Property("SPEC_URL", "-")]
66         [Property("CRITERIA", "CONSTR")]
67         [Property("AUTHOR", "guowei.wang@samsung.com")]
68         public void ItemIdCollectionConstructorWithItemIdCollection()
69         {
70             tlog.Debug(tag, $"ItemIdCollectionConstructorWithItemIdCollection START");
71
72             uint[] itemId = new uint[] { 1, 2, 3, 4 };
73             global::System.Collections.ICollection c = itemId;
74
75             var itemIdCollection = new ItemIdCollection(c);
76             Assert.IsNotNull(itemIdCollection, "Should be not null!");
77             Assert.IsInstanceOf<ItemIdCollection>(itemIdCollection, "Should be an Instance of ItemIdCollection!");
78
79             var testingTarget = new ItemIdCollection(itemIdCollection);
80             Assert.IsNotNull(testingTarget, "Should be not null!");
81             Assert.IsInstanceOf<ItemIdCollection>(testingTarget, "Should be an Instance of ItemIdCollection!");
82
83             itemIdCollection.Dispose();
84             testingTarget.Dispose();
85             tlog.Debug(tag, $"ItemIdCollectionConstructorWithItemIdCollection END (OK)");
86         }
87
88         [Test]
89         [Category("P1")]
90         [Description("ItemIdCollection constructor. With capacity.")]
91         [Property("SPEC", "Tizen.NUI.ItemIdCollection.ItemIdCollection C")]
92         [Property("SPEC_URL", "-")]
93         [Property("CRITERIA", "CONSTR")]
94         [Property("AUTHOR", "guowei.wang@samsung.com")]
95         public void ItemIdCollectionConstructorWithCapacity()
96         {
97             tlog.Debug(tag, $"ItemIdCollectionConstructorWithCapacity START");
98
99             var testingTarget = new ItemIdCollection(5);
100             Assert.IsNotNull(testingTarget, "Should be not null!");
101             Assert.IsInstanceOf<ItemIdCollection>(testingTarget, "Should be an Instance of ItemIdCollection!");
102
103             testingTarget.Dispose();
104             tlog.Debug(tag, $"ItemIdCollectionConstructorWithCapacity END (OK)");
105         }
106
107         [Test]
108         [Category("P2")]
109         [Description("ItemIdCollection constructor. Null ICollection.")]
110         [Property("SPEC", "Tizen.NUI.ItemIdCollection.ItemIdCollection C")]
111         [Property("SPEC_URL", "-")]
112         [Property("CRITERIA", "CONSTR")]
113         [Property("AUTHOR", "guowei.wang@samsung.com")]
114         public void ItemIdCollectionConstructorWithNullICollection()
115         {
116             tlog.Debug(tag, $"ItemIdCollectionConstructorWithNullICollection START");
117
118             global::System.Collections.ICollection c = null;
119
120             try
121             {
122                 new ItemIdCollection(c);
123             }
124             catch (ArgumentNullException e)
125             {
126                 tlog.Debug(tag, e.Message.ToString());
127                 tlog.Debug(tag, $"ItemIdCollectionConstructorWithNullICollection END (OK)");
128                 Assert.Pass("Caught ArgumentNullException : passed!");
129             }
130         }
131
132         [Test]
133         [Category("P1")]
134         [Description("ItemIdCollection getCPtr.")]
135         [Property("SPEC", "Tizen.NUI.ItemIdCollection.getCPtr M")]
136         [Property("SPEC_URL", "-")]
137         [Property("CRITERIA", "MR")]
138         [Property("AUTHOR", "guowei.wang@samsung.com")]
139         public void ItemIdCollectiongetCPtr()
140         {
141             tlog.Debug(tag, $"ItemIdCollectiongetCPtr START");
142
143             uint[] itemId = new uint[] { 1, 2, 3, 4 };
144             global::System.Collections.ICollection c = itemId;
145
146             var testingTarget = new ItemIdCollection(c);
147             Assert.IsNotNull(testingTarget, "Should be not null!");
148             Assert.IsInstanceOf<ItemIdCollection>(testingTarget, "Should be an Instance of ItemIdCollection!");
149
150             try
151             {
152                 ItemIdCollection.getCPtr(testingTarget);
153             }
154             catch (Exception e)
155             {
156                 tlog.Debug(tag, e.Message.ToString());
157                 Assert.Fail("Caught Exception: Failed!");
158             }
159
160             testingTarget.Dispose();
161             tlog.Debug(tag, $"ItemIdCollectiongetCPtr END (OK)");
162         }
163
164         [Test]
165         [Category("P1")]
166         [Description("ItemIdCollection this.")]
167         [Property("SPEC", "Tizen.NUI.ItemIdCollection.this A")]
168         [Property("SPEC_URL", "-")]
169         [Property("CRITERIA", "PRW")]
170         [Property("AUTHOR", "guowei.wang@samsung.com")]
171         public void ItemIdCollectionThis()
172         {
173             tlog.Debug(tag, $"ItemIdCollectionThis START");
174
175             uint[] itemId = new uint[] { 1, 2, 3, 4 };
176             global::System.Collections.ICollection c = itemId;
177
178             var testingTarget = new ItemIdCollection(c);
179             Assert.IsNotNull(testingTarget, "Should be not null!");
180             Assert.IsInstanceOf<ItemIdCollection>(testingTarget, "Should be an Instance of ItemIdCollection!");
181
182             tlog.Debug(tag, testingTarget[1].ToString());
183
184             testingTarget[2] = 5;
185             tlog.Debug(tag, testingTarget[2].ToString());
186
187             testingTarget.Dispose();
188             tlog.Debug(tag, $"ItemIdCollectionThis END (OK)");
189         }
190
191         [Test]
192         [Category("P1")]
193         [Description("ItemIdCollection Capacity.")]
194         [Property("SPEC", "Tizen.NUI.ItemIdCollection.Capacity A")]
195         [Property("SPEC_URL", "-")]
196         [Property("CRITERIA", "PRW")]
197         [Property("AUTHOR", "guowei.wang@samsung.com")]
198         public void ItemIdCollectionCapacity()
199         {
200             tlog.Debug(tag, $"ItemIdCollectionCapacity START");
201
202             uint[] itemId = new uint[] { 1, 2, 3, 4 };
203             global::System.Collections.ICollection c = itemId;
204
205             var testingTarget = new ItemIdCollection(c);
206             Assert.IsNotNull(testingTarget, "Should be not null!");
207             Assert.IsInstanceOf<ItemIdCollection>(testingTarget, "Should be an Instance of ItemIdCollection!");
208
209             tlog.Debug(tag, "Capacity : " + testingTarget.Capacity.ToString());
210
211             testingTarget.Capacity = 5;
212             tlog.Debug(tag, "Capacity : " + testingTarget.Capacity.ToString());
213
214             testingTarget.Dispose();
215             tlog.Debug(tag, $"ItemIdCollectionCapacity END (OK)");
216         }
217
218         [Test]
219         [Category("P2")]
220         [Description("ItemIdCollection Capacity. Set value < size.")]
221         [Property("SPEC", "Tizen.NUI.ItemIdCollection.Capacity A")]
222         [Property("SPEC_URL", "-")]
223         [Property("CRITERIA", "PRW")]
224         [Property("AUTHOR", "guowei.wang@samsung.com")]
225         public void ItemIdCollectionCapacitySetValueLessThanSize()
226         {
227             tlog.Debug(tag, $"ItemIdCollectionCapacitySetValueLessThanSize START");
228
229             uint[] itemId = new uint[] { 1, 2, 3, 4 };
230             global::System.Collections.ICollection c = itemId;
231
232             var testingTarget = new ItemIdCollection(c);
233             Assert.IsNotNull(testingTarget, "Should be not null!");
234             Assert.IsInstanceOf<ItemIdCollection>(testingTarget, "Should be an Instance of ItemIdCollection!");
235
236             tlog.Debug(tag, "Count : " + testingTarget.Count);
237             tlog.Debug(tag, "Capacity : " + testingTarget.Capacity.ToString());
238
239             try
240             {
241                 testingTarget.Capacity = 3;
242             }
243             catch (ArgumentOutOfRangeException e)
244             {
245                 tlog.Debug(tag, e.Message.ToString());
246                 testingTarget.Dispose();
247                 tlog.Debug(tag, $"ItemIdCollectionCapacitySetValueLessThanSize END (OK)");
248                 Assert.Pass("Caught ArgumentOutOfRangeException : Passed!");
249             }
250         }
251
252         [Test]
253         [Category("P1")]
254         [Description("ItemIdCollection CopyTo.")]
255         [Property("SPEC", "Tizen.NUI.ItemIdCollection.CopyTo M")]
256         [Property("SPEC_URL", "-")]
257         [Property("CRITERIA", "MR")]
258         [Property("AUTHOR", "guowei.wang@samsung.com")]
259         public void ItemIdCollectionCopyTo()
260         {
261             tlog.Debug(tag, $"ItemIdCollectionCopyTo START");
262
263             uint[] itemId = new uint[] { 1, 2, 3, 4 };
264             global::System.Collections.ICollection c = itemId;
265
266             var testingTarget = new ItemIdCollection(c);
267             Assert.IsNotNull(testingTarget, "Should be not null!");
268             Assert.IsInstanceOf<ItemIdCollection>(testingTarget, "Should be an Instance of ItemIdCollection!");
269
270             uint[] array = new uint[4];
271
272             try
273             {
274                 testingTarget.CopyTo(array);
275             }
276             catch (Exception e)
277             {
278                 tlog.Debug(tag, e.Message.ToString());
279                 Assert.Fail("Caught Exception : Failed!");
280             }
281
282             tlog.Debug(tag, $"ItemIdCollectionCopyTo END (OK)");
283         }
284
285         [Test]
286         [Category("P1")]
287         [Description("ItemIdCollection CopyTo. With arrayIndex.")]
288         [Property("SPEC", "Tizen.NUI.ItemIdCollection.CopyTo M")]
289         [Property("SPEC_URL", "-")]
290         [Property("CRITERIA", "MR")]
291         [Property("AUTHOR", "guowei.wang@samsung.com")]
292         public void ItemIdCollectionCopyToWithArrayIndex()
293         {
294             tlog.Debug(tag, $"ItemIdCollectionCopyToWithArrayIndex START");
295
296             uint[] itemId = new uint[] { 1, 2, 3, 4 };
297             global::System.Collections.ICollection c = itemId;
298
299             var testingTarget = new ItemIdCollection(c);
300             Assert.IsNotNull(testingTarget, "Should be not null!");
301             Assert.IsInstanceOf<ItemIdCollection>(testingTarget, "Should be an Instance of ItemIdCollection!");
302
303             uint[] array = new uint[4];
304
305             try
306             {
307                 testingTarget.CopyTo(array, 0);
308             }
309             catch (Exception e)
310             {
311                 tlog.Debug(tag, e.Message.ToString());
312                 Assert.Fail("Caught Exception : Failed!");
313             }
314
315             tlog.Debug(tag, $"ItemIdCollectionCopyToWithArrayIndex END (OK)");
316         }
317
318         [Test]
319         [Category("P1")]
320         [Description("ItemIdCollection CopyTo. With null array.")]
321         [Property("SPEC", "Tizen.NUI.ItemIdCollection.CopyTo M")]
322         [Property("SPEC_URL", "-")]
323         [Property("CRITERIA", "MR")]
324         [Property("AUTHOR", "guowei.wang@samsung.com")]
325         public void ItemIdCollectionCopyToWithNullArray()
326         {
327             tlog.Debug(tag, $"ItemIdCollectionCopyToWithNullArray START");
328
329             uint[] itemId = new uint[] { 1, 2, 3, 4 };
330             global::System.Collections.ICollection c = itemId;
331
332             var testingTarget = new ItemIdCollection(c);
333             Assert.IsNotNull(testingTarget, "Should be not null!");
334             Assert.IsInstanceOf<ItemIdCollection>(testingTarget, "Should be an Instance of ItemIdCollection!");
335
336             try
337             {
338                 testingTarget.CopyTo(null);
339             }
340             catch (ArgumentNullException e)
341             {
342                 tlog.Debug(tag, e.Message.ToString());
343                 testingTarget.Dispose();
344                 tlog.Debug(tag, $"ItemIdCollectionCopyToWithNullArray END (OK)");
345                 Assert.Fail("Caught ArgumentNullException : Failed!");
346             }
347         }
348
349         [Test]
350         [Category("P1")]
351         [Description("ItemIdCollection CopyTo. index < 0.")]
352         [Property("SPEC", "Tizen.NUI.ItemIdCollection.CopyTo M")]
353         [Property("SPEC_URL", "-")]
354         [Property("CRITERIA", "MR")]
355         [Property("AUTHOR", "guowei.wang@samsung.com")]
356         public void ItemIdCollectionCopyToWithIndexLessThan0()
357         {
358             tlog.Debug(tag, $"ItemIdCollectionCopyToWithIndexLessThan0 START");
359
360             uint[] itemId = new uint[] { 1, 2, 3, 4 };
361             global::System.Collections.ICollection c = itemId;
362
363             var testingTarget = new ItemIdCollection(c);
364             Assert.IsNotNull(testingTarget, "Should be not null!");
365             Assert.IsInstanceOf<ItemIdCollection>(testingTarget, "Should be an Instance of ItemIdCollection!");
366
367             try
368             {
369                 uint[] array = new uint[4];
370                 testingTarget.CopyTo(-1, array, 0, testingTarget.Count);
371             }
372             catch (ArgumentOutOfRangeException e)
373             {
374                 tlog.Debug(tag, e.Message.ToString());
375                 testingTarget.Dispose();
376                 tlog.Debug(tag, $"ItemIdCollectionCopyToWithIndexLessThan0 END (OK)");
377                 Assert.Fail("Caught ArgumentOutOfRangeException : Failed!");
378             }
379         }
380
381         [Test]
382         [Category("P1")]
383         [Description("ItemIdCollection CopyTo. arrayIndex < 0.")]
384         [Property("SPEC", "Tizen.NUI.ItemIdCollection.CopyTo M")]
385         [Property("SPEC_URL", "-")]
386         [Property("CRITERIA", "MR")]
387         [Property("AUTHOR", "guowei.wang@samsung.com")]
388         public void ItemIdCollectionCopyToWithArrayIndexLessThan0()
389         {
390             tlog.Debug(tag, $"ItemIdCollectionCopyToWithArrayIndexLessThan0 START");
391
392             uint[] itemId = new uint[] { 1, 2, 3, 4 };
393             global::System.Collections.ICollection c = itemId;
394
395             var testingTarget = new ItemIdCollection(c);
396             Assert.IsNotNull(testingTarget, "Should be not null!");
397             Assert.IsInstanceOf<ItemIdCollection>(testingTarget, "Should be an Instance of ItemIdCollection!");
398
399             try
400             {
401                 uint[] array = new uint[4];
402                 testingTarget.CopyTo(0, array, -1, testingTarget.Count);
403             }
404             catch (ArgumentOutOfRangeException e)
405             {
406                 tlog.Debug(tag, e.Message.ToString());
407                 testingTarget.Dispose();
408                 tlog.Debug(tag, $"ItemIdCollectionCopyToWithArrayIndexLessThan0 END (OK)");
409                 Assert.Fail("Caught ArgumentOutOfRangeException : Failed!");
410             }
411         }
412
413         [Test]
414         [Category("P1")]
415         [Description("ItemIdCollection CopyTo. count < 0.")]
416         [Property("SPEC", "Tizen.NUI.ItemIdCollection.CopyTo M")]
417         [Property("SPEC_URL", "-")]
418         [Property("CRITERIA", "MR")]
419         [Property("AUTHOR", "guowei.wang@samsung.com")]
420         public void ItemIdCollectionCopyToWithCountLessThan0()
421         {
422             tlog.Debug(tag, $"ItemIdCollectionCopyToWithCountLessThan0 START");
423
424             uint[] itemId = new uint[] { 1, 2, 3, 4 };
425             global::System.Collections.ICollection c = itemId;
426
427             var testingTarget = new ItemIdCollection(c);
428             Assert.IsNotNull(testingTarget, "Should be not null!");
429             Assert.IsInstanceOf<ItemIdCollection>(testingTarget, "Should be an Instance of ItemIdCollection!");
430
431             try
432             {
433                 uint[] array = new uint[4];
434                 testingTarget.CopyTo(0, array, 0, -1);
435             }
436             catch (ArgumentOutOfRangeException e)
437             {
438                 tlog.Debug(tag, e.Message.ToString());
439                 testingTarget.Dispose();
440                 tlog.Debug(tag, $"ItemIdCollectionCopyToWithCountLessThan0 END (OK)");
441                 Assert.Fail("Caught ArgumentOutOfRangeException : Failed!");
442             }
443         }
444
445         [Test]
446         [Category("P1")]
447         [Description("ItemIdCollection GetEnumerator.")]
448         [Property("SPEC", "Tizen.NUI.ItemIdCollection.GetEnumerator M")]
449         [Property("SPEC_URL", "-")]
450         [Property("CRITERIA", "MR")]
451         [Property("AUTHOR", "guowei.wang@samsung.com")]
452         public void ItemIdCollectionGetEnumerator()
453         {
454             tlog.Debug(tag, $"ItemIdCollectionGetEnumerator START");
455
456             uint[] itemId = new uint[] { 1, 2, 3, 4 };
457             global::System.Collections.ICollection c = itemId;
458
459             var testingTarget = new ItemIdCollection(c);
460             Assert.IsNotNull(testingTarget, "Should be not null!");
461             Assert.IsInstanceOf<ItemIdCollection>(testingTarget, "Should be an Instance of ItemIdCollection!");
462
463             var result = testingTarget.GetEnumerator();
464             Assert.IsNotNull(result, "Should be not null!");
465             Assert.IsInstanceOf<ItemIdCollection.ItemIdCollectionEnumerator>(result, "Should be an Instance of ItemIdCollectionEnumerator!");
466
467             tlog.Debug(tag, $"ItemIdCollectionGetEnumerator END (OK)");
468         }
469
470         [Test]
471         [Category("P1")]
472         [Description("ItemIdCollection.ItemIdCollectionEnumerator constructor.")]
473         [Property("SPEC", "Tizen.NUI.ItemIdCollection.ItemIdCollectionEnumerator.ItemIdCollectionEnumerator C")]
474         [Property("SPEC_URL", "-")]
475         [Property("CRITERIA", "CONTSTR")]
476         [Property("AUTHOR", "guowei.wang@samsung.com")]
477         public void ItemIdCollectionEnumeratorConstructor()
478         {
479             tlog.Debug(tag, $"ItemIdCollectionEnumeratorConstructor START");
480
481             using (ItemIdCollection itemIdCollection = new ItemIdCollection())
482             {
483                 var testingTarget = new ItemIdCollection.ItemIdCollectionEnumerator(itemIdCollection);
484                 Assert.IsNotNull(testingTarget, "Should be not null!");
485                 Assert.IsInstanceOf<ItemIdCollection.ItemIdCollectionEnumerator>(testingTarget, "Should be an Instance of ItemIdCollectionEnumerator!");
486
487                 testingTarget.Dispose();
488             }
489
490             tlog.Debug(tag, $"ItemIdCollectionEnumeratorConstructor END (OK)");
491         }
492
493         [Test]
494         [Category("P2")]
495         [Description("ItemIdCollection.ItemIdCollectionEnumerator Current. currentIndex == -1.")]
496         [Property("SPEC", "Tizen.NUI.ItemIdCollection.ItemIdCollectionEnumerator.Current A")]
497         [Property("SPEC_URL", "-")]
498         [Property("CRITERIA", "PRO")]
499         [Property("AUTHOR", "guowei.wang@samsung.com")]
500         public void ItemIdCollectionEnumeratorCurrent()
501         {
502             tlog.Debug(tag, $"ItemIdCollectionEnumeratorCurrent START");
503
504             using (ItemIdCollection itemCollection = new ItemIdCollection())
505             {
506                 var testingTarget = new ItemIdCollection.ItemIdCollectionEnumerator(itemCollection);
507                 Assert.IsNotNull(testingTarget, "Should be not null!");
508                 Assert.IsInstanceOf<ItemIdCollection.ItemIdCollectionEnumerator>(testingTarget, "Should be an Instance of ItemIdCollectionEnumerator!");
509
510                 try
511                 {
512                     tlog.Debug(tag, "Current : " + testingTarget.Current);
513                 }
514                 catch (InvalidOperationException e)
515                 {
516                     tlog.Debug(tag, e.Message.ToString());
517                     testingTarget.Dispose();
518                     tlog.Debug(tag, $"ItemIdCollectionEnumeratorCurrent END (OK)");
519                     Assert.Pass("Caught InvalidOperationException : passed!");
520                 }
521             }
522         }
523
524         [Test]
525         [Category("P1")]
526         [Description("ItemIdCollection.ItemIdCollectionEnumerator MoveNext.")]
527         [Property("SPEC", "Tizen.NUI.ItemIdCollection.ItemIdCollectionEnumerator.MoveNext M")]
528         [Property("SPEC_URL", "-")]
529         [Property("CRITERIA", "MR")]
530         [Property("AUTHOR", "guowei.wang@samsung.com")]
531         public void ItemIdCollectionEnumeratorMoveNext()
532         {
533             tlog.Debug(tag, $"ItemIdCollectionEnumeratorMoveNext START");
534
535             uint[] itemId = new uint[] { 1, 2, 3, 4 };
536             global::System.Collections.ICollection c = itemId;
537
538             var itemIdCollection = new ItemIdCollection(c);
539             Assert.IsNotNull(itemIdCollection, "Should be not null!");
540             Assert.IsInstanceOf<ItemIdCollection>(itemIdCollection, "Should be an Instance of ItemIdCollection!");
541
542             var testingTarget = new ItemIdCollection.ItemIdCollectionEnumerator(itemIdCollection);
543             Assert.IsNotNull(testingTarget, "Should be not null!");
544             Assert.IsInstanceOf<ItemIdCollection.ItemIdCollectionEnumerator>(testingTarget, "Should be an Instance of ItemIdCollectionEnumerator!");
545
546             try
547             {
548                 testingTarget.MoveNext();
549                 var result = testingTarget.Current;
550                 Assert.IsNotNull(result, "Should be not null!");
551                 Assert.IsInstanceOf<uint>(result, "Should be an Instance of uint!");
552             }
553             catch (Exception e)
554             {
555                 tlog.Debug(tag, e.Message.ToString());
556                 Assert.Fail("Caught Exception: Failed!");
557             }
558
559             tlog.Debug(tag, $"ItemIdCollectionEnumeratorMoveNext END (OK)");
560         }
561
562         [Test]
563         [Category("P2")]
564         [Description("ItemIdCollection.ItemIdCollectionEnumerator MoveNext. Object is null.")]
565         [Property("SPEC", "Tizen.NUI.ItemIdCollection.ItemIdCollectionEnumerator.MoveNext M")]
566         [Property("SPEC_URL", "-")]
567         [Property("CRITERIA", "MR")]
568         [Property("AUTHOR", "guowei.wang@samsung.com")]
569         public void ItemIdCollectionEnumeratorMoveNextNullObject()
570         {
571             tlog.Debug(tag, $"ItemIdCollectionEnumeratorMoveNextNullObject START");
572
573             uint[] itemId = new uint[] { 1, 2, 3, 4 };
574             global::System.Collections.ICollection c = itemId;
575
576             var itemIdCollection = new ItemIdCollection(c);
577             Assert.IsNotNull(itemIdCollection, "Should be not null!");
578             Assert.IsInstanceOf<ItemIdCollection>(itemIdCollection, "Should be an Instance of ItemIdCollection!");
579
580             var testingTarget = new ItemIdCollection.ItemIdCollectionEnumerator(itemIdCollection);
581             Assert.IsNotNull(testingTarget, "Should be not null!");
582             Assert.IsInstanceOf<ItemIdCollection.ItemIdCollectionEnumerator>(testingTarget, "Should be an Instance of ItemIdCollectionEnumerator!");
583
584             try
585             {
586                 testingTarget.MoveNext();
587                 testingTarget.MoveNext();
588                 testingTarget.MoveNext();
589                 testingTarget.MoveNext();
590                 testingTarget.MoveNext();
591                 var result = testingTarget.Current;
592             }
593             catch (InvalidOperationException e)
594             {
595                 tlog.Debug(tag, e.Message.ToString());
596                 testingTarget.Dispose();
597                 tlog.Debug(tag, $"ItemIdCollectionEnumeratorMoveNextNullObject END (OK)");
598                 Assert.Pass("Caught InvalidOperationException: Passed!");
599             }
600         }
601
602         [Test]
603         [Category("P1")]
604         [Description("ItemIdCollection.ItemIdCollectionEnumerator Reset.")]
605         [Property("SPEC", "Tizen.NUI.ItemIdCollection.ItemIdCollectionEnumerator.Reset M")]
606         [Property("SPEC_URL", "-")]
607         [Property("CRITERIA", "MR")]
608         [Property("AUTHOR", "guowei.wang@samsung.com")]
609         public void ItemIdCollectionEnumeratorReset()
610         {
611             tlog.Debug(tag, $"ItemIdCollectionEnumeratorReset START");
612
613             uint[] itemId = new uint[] { 1, 2, 3, 4 };
614             global::System.Collections.ICollection c = itemId;
615
616             var itemIdCollection = new ItemIdCollection(c);
617             Assert.IsNotNull(itemIdCollection, "Should be not null!");
618             Assert.IsInstanceOf<ItemIdCollection>(itemIdCollection, "Should be an Instance of ItemIdCollection!");
619
620             var testingTarget = new ItemIdCollection.ItemIdCollectionEnumerator(itemIdCollection);
621             Assert.IsNotNull(testingTarget, "Should be not null!");
622             Assert.IsInstanceOf<ItemIdCollection.ItemIdCollectionEnumerator>(testingTarget, "Should be an Instance of ItemIdCollectionEnumerator!");
623
624             testingTarget.MoveNext();
625
626             try
627             {
628                 testingTarget.Reset();
629             }
630             catch (Exception e)
631             {
632                 tlog.Debug(tag, e.Message.ToString());
633                 Assert.Fail("Caught Exception: Failed!");
634             }
635
636             tlog.Debug(tag, $"ItemIdCollectionEnumeratorReset END (OK)");
637         }
638
639         [Test]
640         [Category("P1")]
641         [Description("ItemIdCollection Clear.")]
642         [Property("SPEC", "Tizen.NUI.ItemIdCollection.Clear M")]
643         [Property("SPEC_URL", "-")]
644         [Property("CRITERIA", "MR")]
645         [Property("AUTHOR", "guowei.wang@samsung.com")]
646         public void ItemIdCollectionClear()
647         {
648             tlog.Debug(tag, $"ItemIdCollectionClear START");
649
650             uint[] itemId = new uint[] { 1, 2, 3, 4 };
651             global::System.Collections.ICollection c = itemId;
652
653             var testingTarget = new ItemIdCollection(c);
654             Assert.IsNotNull(testingTarget, "Should be not null!");
655             Assert.IsInstanceOf<ItemIdCollection>(testingTarget, "Should be an Instance of ItemIdCollection!");
656             tlog.Debug(tag, "Count : " + testingTarget.Count.ToString());
657
658             try
659             {
660                 testingTarget.Clear();
661                 tlog.Debug(tag, "Count : " + testingTarget.Count.ToString());
662             }
663             catch (Exception e)
664             {
665                 tlog.Debug(tag, e.Message.ToString());
666                 Assert.Fail("Caught Exception: Failed!");
667             }
668
669             testingTarget.Dispose();
670             tlog.Debug(tag, $"ItemIdCollectionClear END (OK)");
671         }
672
673         [Test]
674         [Category("P1")]
675         [Description("ItemIdCollection AddRange.")]
676         [Property("SPEC", "Tizen.NUI.ItemIdCollection.AddRange M")]
677         [Property("SPEC_URL", "-")]
678         [Property("CRITERIA", "MR")]
679         [Property("AUTHOR", "guowei.wang@samsung.com")]
680         public void ItemIdCollectionAddRange()
681         {
682             tlog.Debug(tag, $"ItemIdCollectionAddRange START");
683
684             using (ItemIdCollection itemIdCollection = new ItemIdCollection(5))
685             {
686                 var testingTarget = new ItemIdCollection();
687                 Assert.IsNotNull(testingTarget, "Should be not null!");
688                 Assert.IsInstanceOf<ItemIdCollection>(testingTarget, "Should be an Instance of ItemIdCollection!");
689
690                 try
691                 {
692                     testingTarget.AddRange(itemIdCollection);
693                 }
694                 catch (Exception e)
695                 {
696                     tlog.Debug(tag, e.Message.ToString());
697                     Assert.Fail("Caught Exception: Failed!");
698                 }
699
700                 testingTarget.Dispose();
701             }
702
703             tlog.Debug(tag, $"ItemIdCollectionAddRange END (OK)");
704         }
705
706         [Test]
707         [Category("P1")]
708         [Description("ItemIdCollection GetRange.")]
709         [Property("SPEC", "Tizen.NUI.ItemIdCollection.GetRange M")]
710         [Property("SPEC_URL", "-")]
711         [Property("CRITERIA", "MR")]
712         [Property("AUTHOR", "guowei.wang@samsung.com")]
713         public void ItemIdCollectionGetRange()
714         {
715             tlog.Debug(tag, $"ItemIdCollectionGetRange START");
716
717             using (ItemIdCollection itemIdCollection = new ItemIdCollection(5))
718             {
719                 var testingTarget = new ItemIdCollection();
720                 Assert.IsNotNull(testingTarget, "Should be not null!");
721                 Assert.IsInstanceOf<ItemIdCollection>(testingTarget, "Should be an Instance of ItemIdCollection!");
722
723                 testingTarget.AddRange(itemIdCollection);
724
725                 try
726                 {
727                     var result = testingTarget.GetRange(0, 0);
728                     Assert.IsInstanceOf<ItemIdCollection>(result, "Should be an Instance of ItemIdCollection!");
729                 }
730                 catch (Exception e)
731                 {
732                     tlog.Debug(tag, e.Message.ToString());
733                     Assert.Fail("Caught Exception: Failed!");
734                 }
735
736                 testingTarget.Dispose();
737             }
738
739             tlog.Debug(tag, $"ItemIdCollectionGetRange END (OK)");
740         }
741
742         [Test]
743         [Category("P1")]
744         [Description("ItemIdCollection Insert.")]
745         [Property("SPEC", "Tizen.NUI.ItemIdCollection.Insert M")]
746         [Property("SPEC_URL", "-")]
747         [Property("CRITERIA", "MR")]
748         [Property("AUTHOR", "guowei.wang@samsung.com")]
749         public void ItemIdCollectionInsert()
750         {
751             tlog.Debug(tag, $"ItemIdCollectionInsert START");
752
753             uint[] itemId = new uint[] { 1, 2, 3, 4 };
754             global::System.Collections.ICollection c = itemId;
755
756             var testingTarget = new ItemIdCollection(c);
757             Assert.IsNotNull(testingTarget, "Should be not null!");
758             Assert.IsInstanceOf<ItemIdCollection>(testingTarget, "Should be an Instance of ItemIdCollection!");
759
760             testingTarget.Capacity = 5;
761
762             try
763             {
764                 testingTarget.Insert(4, 5);
765             }
766             catch (Exception e)
767             {
768                 tlog.Debug(tag, e.Message.ToString());
769                 Assert.Fail("Caught Exception: Failed!");
770             }
771
772             testingTarget.Dispose();
773
774             tlog.Debug(tag, $"ItemIdCollectionInsert END (OK)");
775         }
776
777         [Test]
778         [Category("P1")]
779         [Description("ItemIdCollection InsertRange.")]
780         [Property("SPEC", "Tizen.NUI.ItemIdCollection.InsertRange M")]
781         [Property("SPEC_URL", "-")]
782         [Property("CRITERIA", "MR")]
783         [Property("AUTHOR", "guowei.wang@samsung.com")]
784         public void ItemIdCollectionInsertRange()
785         {
786             tlog.Debug(tag, $"ItemIdCollectionInsertRange START");
787
788             using (ItemIdCollection value = new ItemIdCollection(3))
789             {
790
791                 uint[] itemId = new uint[] { 1, 2, 3, 4 };
792                 global::System.Collections.ICollection c = itemId;
793
794                 var testingTarget = new ItemIdCollection(c);
795                 Assert.IsNotNull(testingTarget, "Should be not null!");
796                 Assert.IsInstanceOf<ItemIdCollection>(testingTarget, "Should be an Instance of ItemIdCollection!");
797
798                 testingTarget.Capacity = 10;
799
800                 try
801                 {
802                     testingTarget.InsertRange(3, value);
803                 }
804                 catch (Exception e)
805                 {
806                     tlog.Debug(tag, e.Message.ToString());
807                     Assert.Fail("Caught Exception: Failed!");
808                 }
809
810                 testingTarget.Dispose();
811             }
812
813             tlog.Debug(tag, $"ItemIdCollectionInsertRange END (OK)");
814         }
815
816         [Test]
817         [Category("P1")]
818         [Description("ItemIdCollection RemoveAt.")]
819         [Property("SPEC", "Tizen.NUI.ItemIdCollection.RemoveAt M")]
820         [Property("SPEC_URL", "-")]
821         [Property("CRITERIA", "MR")]
822         [Property("AUTHOR", "guowei.wang@samsung.com")]
823         public void ItemIdCollectionRemoveAt()
824         {
825             tlog.Debug(tag, $"ItemIdCollectionRemoveAt START");
826
827             uint[] itemId = new uint[] { 1, 2, 3, 4 };
828             global::System.Collections.ICollection c = itemId;
829
830             var testingTarget = new ItemIdCollection(c);
831             Assert.IsNotNull(testingTarget, "Should be not null!");
832             Assert.IsInstanceOf<ItemIdCollection>(testingTarget, "Should be an Instance of ItemIdCollection!");
833
834             testingTarget.Capacity = 5;
835
836             try
837             {
838                 testingTarget.RemoveAt(3);
839             }
840             catch (Exception e)
841             {
842                 tlog.Debug(tag, e.Message.ToString());
843                 Assert.Fail("Caught Exception: Failed!");
844             }
845
846             testingTarget.Dispose();
847
848             tlog.Debug(tag, $"ItemIdCollectionRemoveAt END (OK)");
849         }
850
851         [Test]
852         [Category("P1")]
853         [Description("ItemIdCollection RemoveRange.")]
854         [Property("SPEC", "Tizen.NUI.ItemIdCollection.RemoveRange M")]
855         [Property("SPEC_URL", "-")]
856         [Property("CRITERIA", "MR")]
857         [Property("AUTHOR", "guowei.wang@samsung.com")]
858         public void ItemIdCollectionRemoveRange()
859         {
860             tlog.Debug(tag, $"ItemIdCollectionRemoveRange START");
861
862             uint[] itemId = new uint[] { 1, 2, 3, 4 };
863             global::System.Collections.ICollection c = itemId;
864
865             var testingTarget = new ItemIdCollection(c);
866             Assert.IsNotNull(testingTarget, "Should be not null!");
867             Assert.IsInstanceOf<ItemIdCollection>(testingTarget, "Should be an Instance of ItemIdCollection!");
868
869             testingTarget.Capacity = 5;
870
871             try
872             {
873                 testingTarget.RemoveRange(1, 2);
874             }
875             catch (Exception e)
876             {
877                 tlog.Debug(tag, e.Message.ToString());
878                 Assert.Fail("Caught Exception: Failed!");
879             }
880
881             testingTarget.Dispose();
882
883             tlog.Debug(tag, $"ItemIdCollectionRemoveRange END (OK)");
884         }
885
886         [Test]
887         [Category("P1")]
888         [Description("ItemIdCollection Repeat.")]
889         [Property("SPEC", "Tizen.NUI.ItemIdCollection.Repeat M")]
890         [Property("SPEC_URL", "-")]
891         [Property("CRITERIA", "MR")]
892         [Property("AUTHOR", "guowei.wang@samsung.com")]
893         public void ItemIdCollectionRepeat()
894         {
895             tlog.Debug(tag, $"ItemIdCollectionRepeat START");
896
897             var testingTarget = ItemIdCollection.Repeat(6, 4);
898             Assert.IsNotNull(testingTarget, "Should be not null!");
899             Assert.IsInstanceOf<ItemIdCollection>(testingTarget, "Should be an Instance of ItemIdCollection!");
900
901             Assert.AreEqual(4, testingTarget.Capacity, "Should be equal!");
902
903             testingTarget.Dispose();
904             tlog.Debug(tag, $"ItemIdCollectionRepeat END (OK)");
905         }
906
907         [Test]
908         [Category("P1")]
909         [Description("ItemIdCollection SetRange.")]
910         [Property("SPEC", "Tizen.NUI.ItemIdCollection.SetRange M")]
911         [Property("SPEC_URL", "-")]
912         [Property("CRITERIA", "MR")]
913         [Property("AUTHOR", "guowei.wang@samsung.com")]
914         public void ItemIdCollectionSetRange()
915         {
916             tlog.Debug(tag, $"ItemIdCollectionSetRange START");
917
918             using (ItemIdCollection itemIdCollection = new ItemIdCollection(5))
919             {
920                 uint[] itemId = new uint[] { 1, 2, 3, 4 };
921                 global::System.Collections.ICollection c = itemId;
922
923                 var testingTarget = new ItemIdCollection(c);
924                 Assert.IsNotNull(testingTarget, "Should be not null!");
925                 Assert.IsInstanceOf<ItemIdCollection>(testingTarget, "Should be an Instance of ItemIdCollection!");
926
927                 try
928                 {
929                     testingTarget.SetRange(1, itemIdCollection);
930                 }
931                 catch (Exception e)
932                 {
933                     tlog.Debug(tag, e.Message.ToString());
934                     Assert.Fail("Caught Exception: Failed!");
935                 }
936
937                 testingTarget.Dispose();
938             }
939
940             tlog.Debug(tag, $"ItemIdCollectionSetRange END (OK)");
941         }
942
943         [Test]
944         [Category("P1")]
945         [Description("ItemIdCollection Reverse.")]
946         [Property("SPEC", "Tizen.NUI.ItemIdCollection.Reverse M")]
947         [Property("SPEC_URL", "-")]
948         [Property("CRITERIA", "MR")]
949         [Property("AUTHOR", "guowei.wang@samsung.com")]
950         public void ItemIdCollectionReverse()
951         {
952             tlog.Debug(tag, $"ItemIdCollectionReverse START");
953
954             uint[] itemId = new uint[] { 1, 2, 3, 4 };
955             global::System.Collections.ICollection c = itemId;
956
957             var testingTarget = new ItemIdCollection(c);
958             Assert.IsNotNull(testingTarget, "Should be not null!");
959             Assert.IsInstanceOf<ItemIdCollection>(testingTarget, "Should be an Instance of ItemIdCollection!");
960
961             testingTarget.Capacity = 5;
962
963             try
964             {
965                 testingTarget.Reverse();
966             }
967             catch (Exception e)
968             {
969                 tlog.Debug(tag, e.Message.ToString());
970                 Assert.Fail("Caught Exception: Failed!");
971             }
972
973             testingTarget.Dispose();
974
975             tlog.Debug(tag, $"ItemIdCollectionReverse END (OK)");
976         }
977
978         [Test]
979         [Category("P1")]
980         [Description("ItemIdCollection Reverse. With parameters.")]
981         [Property("SPEC", "Tizen.NUI.ItemIdCollection.Reverse M")]
982         [Property("SPEC_URL", "-")]
983         [Property("CRITERIA", "MR")]
984         [Property("AUTHOR", "guowei.wang@samsung.com")]
985         public void ItemIdCollectionReverseWithParameters()
986         {
987             tlog.Debug(tag, $"ItemIdCollectionReverseWithParameters START");
988
989             uint[] itemId = new uint[] { 1, 2, 3, 4 };
990             global::System.Collections.ICollection c = itemId;
991
992             var testingTarget = new ItemIdCollection(c);
993             Assert.IsNotNull(testingTarget, "Should be not null!");
994             Assert.IsInstanceOf<ItemIdCollection>(testingTarget, "Should be an Instance of ItemIdCollection!");
995
996             testingTarget.Capacity = 5;
997
998             try
999             {
1000                 testingTarget.Reverse(1, 2);
1001             }
1002             catch (Exception e)
1003             {
1004                 tlog.Debug(tag, e.Message.ToString());
1005                 Assert.Fail("Caught Exception: Failed!");
1006             }
1007
1008             testingTarget.Dispose();
1009
1010             tlog.Debug(tag, $"ItemIdCollectionReverseWithParameters END (OK)");
1011         }
1012
1013         [Test]
1014         [Category("P1")]
1015         [Description("ItemIdCollection Contains.")]
1016         [Property("SPEC", "Tizen.NUI.ItemIdCollection.Contains M")]
1017         [Property("SPEC_URL", "-")]
1018         [Property("CRITERIA", "MR")]
1019         [Property("AUTHOR", "guowei.wang@samsung.com")]
1020         public void ItemIdCollectionContains()
1021         {
1022             tlog.Debug(tag, $"ItemIdCollectionContains START");
1023
1024             uint[] itemId = new uint[] { 1, 2, 3, 4 };
1025             global::System.Collections.ICollection c = itemId;
1026
1027             var testingTarget = new ItemIdCollection(c);
1028             Assert.IsNotNull(testingTarget, "Should be not null!");
1029             Assert.IsInstanceOf<ItemIdCollection>(testingTarget, "Should be an Instance of ItemIdCollection!");
1030
1031             testingTarget.Capacity = 5;
1032
1033             Assert.IsTrue(testingTarget.Contains(2));
1034
1035             testingTarget.Dispose();
1036             tlog.Debug(tag, $"ItemIdCollectionContains END (OK)");
1037         }
1038
1039         [Test]
1040         [Category("P1")]
1041         [Description("ItemIdCollection IndexOf.")]
1042         [Property("SPEC", "Tizen.NUI.ItemIdCollection.IndexOf M")]
1043         [Property("SPEC_URL", "-")]
1044         [Property("CRITERIA", "MR")]
1045         [Property("AUTHOR", "guowei.wang@samsung.com")]
1046         public void ItemIdCollectionIndexOf()
1047         {
1048             tlog.Debug(tag, $"ItemIdCollectionIndexOf START");
1049
1050             uint[] itemId = new uint[] { 1, 2, 3, 4 };
1051             global::System.Collections.ICollection c = itemId;
1052
1053             var testingTarget = new ItemIdCollection(c);
1054             Assert.IsNotNull(testingTarget, "Should be not null!");
1055             Assert.IsInstanceOf<ItemIdCollection>(testingTarget, "Should be an Instance of ItemIdCollection!");
1056
1057             testingTarget.Capacity = 5;
1058
1059             Assert.AreEqual(2, testingTarget.IndexOf(3), "Should be equal!");
1060
1061             testingTarget.Dispose();
1062             tlog.Debug(tag, $"ItemIdCollectionIndexOf END (OK)");
1063         }
1064
1065         [Test]
1066         [Category("P1")]
1067         [Description("ItemIdCollection LastIndexOf.")]
1068         [Property("SPEC", "Tizen.NUI.ItemIdCollection.LastIndexOf M")]
1069         [Property("SPEC_URL", "-")]
1070         [Property("CRITERIA", "MR")]
1071         [Property("AUTHOR", "guowei.wang@samsung.com")]
1072         public void ItemIdCollectionLastIndexOf()
1073         {
1074             tlog.Debug(tag, $"ItemIdCollectionLastIndexOf START");
1075
1076             uint[] itemId = new uint[] { 1, 2, 3, 4, 3 };
1077             global::System.Collections.ICollection c = itemId;
1078
1079             var testingTarget = new ItemIdCollection(c);
1080             Assert.IsNotNull(testingTarget, "Should be not null!");
1081             Assert.IsInstanceOf<ItemIdCollection>(testingTarget, "Should be an Instance of ItemIdCollection!");
1082
1083             testingTarget.Capacity = 5;
1084
1085             Assert.AreEqual(4, testingTarget.LastIndexOf(3), "Should be equal!");
1086
1087             testingTarget.Dispose();
1088             tlog.Debug(tag, $"ItemIdCollectionLastIndexOf END (OK)");
1089         }
1090
1091         [Test]
1092         [Category("P1")]
1093         [Description("ItemIdCollection Remove.")]
1094         [Property("SPEC", "Tizen.NUI.ItemIdCollection.Remove M")]
1095         [Property("SPEC_URL", "-")]
1096         [Property("CRITERIA", "MR")]
1097         [Property("AUTHOR", "guowei.wang@samsung.com")]
1098         public void ItemIdCollectionRemove()
1099         {
1100             tlog.Debug(tag, $"ItemIdCollectionRemove START");
1101
1102             uint[] itemId = new uint[] { 1, 2, 3, 4, 3 };
1103             global::System.Collections.ICollection c = itemId;
1104
1105             var testingTarget = new ItemIdCollection(c);
1106             Assert.IsNotNull(testingTarget, "Should be not null!");
1107             Assert.IsInstanceOf<ItemIdCollection>(testingTarget, "Should be an Instance of ItemIdCollection!");
1108
1109             testingTarget.Capacity = 5;
1110
1111             Assert.AreEqual(true, testingTarget.Remove(3), "Should be equal!");
1112
1113             testingTarget.Dispose();
1114             tlog.Debug(tag, $"ItemIdCollectionRemove END (OK)");
1115         }
1116     }
1117 }