3 using NUnit.Framework.TUnit;
4 using Tizen.NUI.Components;
5 using Tizen.NUI.BaseComponents;
7 namespace Tizen.NUI.Devel.Tests
9 using tlog = Tizen.Log;
12 [Description("Internal/Utility/ItemCollection")]
13 public class InternalItemCollectionTest
15 private const string tag = "NUITEST";
20 tlog.Info(tag, "Init() is called!");
26 tlog.Info(tag, "Destroy() is called!");
31 [Description("ItemCollection constructor.")]
32 [Property("SPEC", "Tizen.NUI.ItemCollection.ItemCollection C")]
33 [Property("SPEC_URL", "-")]
34 [Property("CRITERIA", "CONSTR")]
35 [Property("AUTHOR", "guowei.wang@samsung.com")]
36 public void ItemCollectionConstructor()
38 tlog.Debug(tag, $"ItemCollectionConstructor START");
40 var testingTarget = new ItemCollection();
41 Assert.IsNotNull(testingTarget, "Should be not null!");
42 Assert.IsInstanceOf<ItemCollection>(testingTarget, "Should be an Instance of ItemCollection!");
44 Assert.IsFalse(testingTarget.IsFixedSize);
45 Assert.IsFalse(testingTarget.IsReadOnly);
46 Assert.IsFalse(testingTarget.IsSynchronized);
48 testingTarget.Dispose();
49 tlog.Debug(tag, $"ItemCollectionConstructor END (OK)");
54 [Description("ItemCollection constructor. With ItemCollection.")]
55 [Property("SPEC", "Tizen.NUI.ItemCollection.ItemCollection C")]
56 [Property("SPEC_URL", "-")]
57 [Property("CRITERIA", "CONSTR")]
58 [Property("AUTHOR", "guowei.wang@samsung.com")]
59 public void ItemCollectionConstructorWithItemCollection()
61 tlog.Debug(tag, $"ItemCollectionConstructorWithItemCollection START");
63 using (ItemCollection itemCollection = new ItemCollection())
65 var testingTarget = new ItemCollection(itemCollection);
66 Assert.IsNotNull(testingTarget, "Should be not null!");
67 Assert.IsInstanceOf<ItemCollection>(testingTarget, "Should be an Instance of ItemCollection!");
69 testingTarget.Dispose();
72 tlog.Debug(tag, $"ItemCollectionConstructorWithItemCollection END (OK)");
77 [Description("ItemCollection constructor. With capacity.")]
78 [Property("SPEC", "Tizen.NUI.ItemCollection.ItemCollection C")]
79 [Property("SPEC_URL", "-")]
80 [Property("CRITERIA", "CONSTR")]
81 [Property("AUTHOR", "guowei.wang@samsung.com")]
82 public void ItemCollectionConstructorWithCapacity()
84 tlog.Debug(tag, $"ItemCollectionConstructorWithCapacity START");
86 var testingTarget = new ItemCollection(5);
87 Assert.IsNotNull(testingTarget, "Should be not null!");
88 Assert.IsInstanceOf<ItemCollection>(testingTarget, "Should be an Instance of ItemCollection!");
90 testingTarget.Dispose();
91 tlog.Debug(tag, $"ItemCollectionConstructorWithCapacity END (OK)");
96 [Description("ItemCollection constructor. With ICollection.")]
97 [Property("SPEC", "Tizen.NUI.ItemCollection.ItemCollection C")]
98 [Property("SPEC_URL", "-")]
99 [Property("CRITERIA", "CONSTR")]
100 [Property("AUTHOR", "guowei.wang@samsung.com")]
101 public void ItemCollectionConstructorWithICollection()
103 tlog.Debug(tag, $"ItemCollectionConstructorWithICollection START");
105 Item[] b = new Item[] { new Item(), new Item(), new Item(), new Item() };
106 global::System.Collections.ICollection c = b;
107 var testingTarget = new ItemCollection(c);
108 Assert.IsNotNull(testingTarget, "Should be not null!");
109 Assert.IsInstanceOf<ItemCollection>(testingTarget, "Should be an Instance of ItemCollection!");
111 Assert.AreEqual(4, testingTarget.Count, "Should be equal!");
113 testingTarget.Dispose();
114 tlog.Debug(tag, $"ItemCollectionConstructorWithICollection END (OK)");
119 [Description("ItemCollection constructor. With null ICollection.")]
120 [Property("SPEC", "Tizen.NUI.ItemCollection.ItemCollection C")]
121 [Property("SPEC_URL", "-")]
122 [Property("CRITERIA", "CONSTR")]
123 [Property("AUTHOR", "guowei.wang@samsung.com")]
124 public void ItemCollectionConstructorWithNullICollection()
126 tlog.Debug(tag, $"ItemCollectionConstructorWithNullICollection START");
128 global::System.Collections.ICollection c = null;
132 new ItemCollection(c);
134 catch (ArgumentNullException e)
136 tlog.Debug(tag, e.Message.ToString());
137 tlog.Debug(tag, $"ItemCollectionConstructorWithNullICollection END (OK)");
138 Assert.Pass("Caught ArgumentNullException: Passed!");
144 [Description("ItemCollection Clear.")]
145 [Property("SPEC", "Tizen.NUI.ItemCollection.Clear M")]
146 [Property("SPEC_URL", "-")]
147 [Property("CRITERIA", "MR")]
148 [Property("AUTHOR", "guowei.wang@samsung.com")]
149 public void ItemCollectionClear()
151 tlog.Debug(tag, $"ItemCollectionClear START");
153 Item[] b = new Item[] { new Item(), new Item(), new Item(), new Item() };
154 global::System.Collections.ICollection c = b;
156 var testingTarget = new ItemCollection(c);
157 Assert.IsNotNull(testingTarget, "Should be not null!");
158 Assert.IsInstanceOf<ItemCollection>(testingTarget, "Should be an Instance of ItemCollection!");
159 tlog.Debug(tag, "Count : " + testingTarget.Count.ToString());
164 testingTarget.Clear();
165 tlog.Debug(tag, "Count : " + testingTarget.Count.ToString());
169 tlog.Debug(tag, e.Message.ToString());
170 Assert.Fail("Caught Exception: Failed!");
173 testingTarget.Dispose();
174 tlog.Debug(tag, $"ItemCollectionClear END (OK)");
179 [Description("ItemCollection this.")]
180 [Property("SPEC", "Tizen.NUI.ItemCollection.this A")]
181 [Property("SPEC_URL", "-")]
182 [Property("CRITERIA", "PRW")]
183 [Property("AUTHOR", "guowei.wang@samsung.com")]
184 public void ItemCollectionGetVauleByIndex()
186 tlog.Debug(tag, $"ItemCollectionGetVauleByIndex START");
188 Item[] b = new Item[] { new Item(), new Item(), new Item(), new Item() };
189 global::System.Collections.ICollection c = b;
190 var testingTarget = new ItemCollection(c);
191 Assert.IsNotNull(testingTarget, "Should be not null!");
192 Assert.IsInstanceOf<ItemCollection>(testingTarget, "Should be an Instance of ItemCollection!");
194 testingTarget[2].first = 3;
195 Assert.AreEqual(3, testingTarget[2].first, "Should be equal!");
199 testingTarget[1] = new Item(testingTarget[2]);
200 Assert.AreEqual(3, testingTarget[1].first, "Should be equal!");
204 tlog.Debug(tag, e.Message.ToString());
205 Assert.Fail("Caught Exception: Failed!");
208 testingTarget.Dispose();
209 tlog.Debug(tag, $"ItemCollectionGetVauleByIndex END (OK)");
214 [Description("ItemCollection Capacity.")]
215 [Property("SPEC", "Tizen.NUI.ItemCollection.Capacity A")]
216 [Property("SPEC_URL", "-")]
217 [Property("CRITERIA", "PRW")]
218 [Property("AUTHOR", "guowei.wang@samsung.com")]
219 public void ItemCollectionCapacity()
221 tlog.Debug(tag, $"ItemCollectionCapacity START");
223 Item[] b = new Item[] { new Item(), new Item(), new Item(), new Item() };
224 global::System.Collections.ICollection c = b;
225 var testingTarget = new ItemCollection(c);
226 Assert.IsNotNull(testingTarget, "Should be not null!");
227 Assert.IsInstanceOf<ItemCollection>(testingTarget, "Should be an Instance of ItemCollection!");
229 Assert.AreEqual(4, testingTarget.Capacity, "Should be equal!");
231 testingTarget.Capacity = 8;
232 Assert.AreEqual(8, testingTarget.Capacity, "Should be equal!");
234 testingTarget.Dispose();
235 tlog.Debug(tag, $"ItemCollectionCapacity END (OK)");
240 [Description("ItemCollection Capacity. Set exception.")]
241 [Property("SPEC", "Tizen.NUI.ItemCollection.Capacity A")]
242 [Property("SPEC_URL", "-")]
243 [Property("CRITERIA", "PRW")]
244 [Property("AUTHOR", "guowei.wang@samsung.com")]
245 public void ItemCollectionCapacitySetException()
247 tlog.Debug(tag, $"ItemCollectionCapacitySetException START");
249 Item[] b = new Item[] { new Item(), new Item(), new Item(), new Item() };
250 global::System.Collections.ICollection c = b;
251 var testingTarget = new ItemCollection(c);
252 Assert.IsNotNull(testingTarget, "Should be not null!");
253 Assert.IsInstanceOf<ItemCollection>(testingTarget, "Should be an Instance of ItemCollection!");
255 Assert.AreEqual(4, testingTarget.Capacity, "Should be equal!");
259 testingTarget.Capacity = 2;
261 catch (ArgumentOutOfRangeException e)
263 tlog.Debug(tag, e.Message.ToString());
264 testingTarget.Dispose();
265 tlog.Debug(tag, $"ItemCollectionCapacitySetException END (OK)");
266 Assert.Pass("Caught ArgumentOutOfRangeException: Passed!");
272 [Description("ItemCollection CopyTo.")]
273 [Property("SPEC", "Tizen.NUI.ItemCollection.CopyTo M")]
274 [Property("SPEC_URL", "-")]
275 [Property("CRITERIA", "MR")]
276 [Property("AUTHOR", "guowei.wang@samsung.com")]
277 public void ItemCollectionCopyTo()
279 tlog.Debug(tag, $"ItemCollectionCopyTo START");
281 Item[] b = new Item[] { new Item(), new Item(), new Item(), new Item() };
282 global::System.Collections.ICollection c = b;
283 var testingTarget = new ItemCollection(c);
284 Assert.IsNotNull(testingTarget, "Should be not null!");
285 Assert.IsInstanceOf<ItemCollection>(testingTarget, "Should be an Instance of ItemCollection!");
287 Item[] array = new Item[4];
291 testingTarget.CopyTo(array);
292 Assert.IsNotNull(array[1], "Should be not null!");
293 Assert.IsInstanceOf<Item>(array[1], "Should be an Instance of Item!");
297 tlog.Debug(tag, e.Message.ToString());
298 Assert.Fail("Caught Exception: Failed!");
301 testingTarget.Dispose();
302 tlog.Debug(tag, $"ItemCollectionCopyTo END (OK)");
307 [Description("ItemCollection CopyTo. With arrayIndex.")]
308 [Property("SPEC", "Tizen.NUI.ItemCollection.CopyTo M")]
309 [Property("SPEC_URL", "-")]
310 [Property("CRITERIA", "MR")]
311 [Property("AUTHOR", "guowei.wang@samsung.com")]
312 public void ItemCollectionCopyToWithArrayIndex()
314 tlog.Debug(tag, $"ItemCollectionCopyToWithArrayIndex START");
316 var testingTarget = new ItemCollection();
317 Assert.IsNotNull(testingTarget, "Should be not null!");
318 Assert.IsInstanceOf<ItemCollection>(testingTarget, "Should be an Instance of ItemCollection!");
320 testingTarget.Add(new Item());
321 Assert.AreEqual(1, testingTarget.Count, "Should be equal!");
325 testingTarget.CopyTo(new Item[2], 0);
329 tlog.Debug(tag, e.Message.ToString());
330 Assert.Fail("Caught Exception: Failed!");
333 testingTarget.Dispose();
334 tlog.Debug(tag, $"ItemCollectionCopyToWithArrayIndex END (OK)");
339 [Description("ItemCollection CopyTo. With null array.")]
340 [Property("SPEC", "Tizen.NUI.ItemCollection.CopyTo M")]
341 [Property("SPEC_URL", "-")]
342 [Property("CRITERIA", "MR")]
343 [Property("AUTHOR", "guowei.wang@samsung.com")]
344 public void ItemCollectionCopyToWithNullArray()
346 tlog.Debug(tag, $"ItemCollectionCopyToWithNullArray START");
348 var testingTarget = new ItemCollection();
349 Assert.IsNotNull(testingTarget, "Should be not null!");
350 Assert.IsInstanceOf<ItemCollection>(testingTarget, "Should be an Instance of ItemCollection!");
352 testingTarget.Add(new Item());
353 Assert.AreEqual(1, testingTarget.Count, "Should be equal!");
357 testingTarget.CopyTo(null, 0);
359 catch (ArgumentNullException e)
361 tlog.Debug(tag, e.Message.ToString());
362 testingTarget.Dispose();
363 tlog.Debug(tag, $"ItemCollectionCopyToWithNullArray END (OK)");
364 Assert.Fail("Caught ArgumentNullException: Failed!");
370 [Description("ItemCollection CopyTo. ArrayIndex < 0.")]
371 [Property("SPEC", "Tizen.NUI.ItemCollection.CopyTo M")]
372 [Property("SPEC_URL", "-")]
373 [Property("CRITERIA", "MR")]
374 [Property("AUTHOR", "guowei.wang@samsung.com")]
375 public void ItemCollectionCopyToWithArrayIndexLessThan0()
377 tlog.Debug(tag, $"ItemCollectionCopyToWithArrayIndexLessThan0 START");
379 var testingTarget = new ItemCollection();
380 Assert.IsNotNull(testingTarget, "Should be not null!");
381 Assert.IsInstanceOf<ItemCollection>(testingTarget, "Should be an Instance of ItemCollection!");
383 testingTarget.Add(new Item());
384 Assert.AreEqual(1, testingTarget.Count, "Should be equal!");
388 testingTarget.CopyTo(new Item[2], -1);
390 catch (ArgumentOutOfRangeException e)
392 tlog.Debug(tag, e.Message.ToString());
393 testingTarget.Dispose();
394 tlog.Debug(tag, $"ItemCollectionCopyToWithArrayIndexLessThan0 END (OK)");
395 Assert.Fail("Caught ArgumentOutOfRangeException: Failed!");
401 [Description("ItemCollection CopyTo. Elements too large.")]
402 [Property("SPEC", "Tizen.NUI.ItemCollection.CopyTo M")]
403 [Property("SPEC_URL", "-")]
404 [Property("CRITERIA", "MR")]
405 [Property("AUTHOR", "guowei.wang@samsung.com")]
406 public void ItemCollectionCopyToWithLargerElements()
408 tlog.Debug(tag, $"ItemCollectionCopyToWithLargerElements START");
410 Item[] b = new Item[] { new Item(), new Item(), new Item(), new Item() };
411 global::System.Collections.ICollection c = b;
412 var testingTarget = new ItemCollection(c);
413 Assert.IsNotNull(testingTarget, "Should be not null!");
414 Assert.IsInstanceOf<ItemCollection>(testingTarget, "Should be an Instance of ItemCollection!");
416 Item[] array = new Item[4];
420 testingTarget.CopyTo(array, 2);
422 catch (ArgumentException e)
424 tlog.Debug(tag, e.Message.ToString());
425 testingTarget.Dispose();
426 tlog.Debug(tag, $"ItemCollectionCopyToWithLargerElements END (OK)");
427 Assert.Fail("Caught ArgumentException: Failed!");
433 [Description("ItemCollection CopyTo. Index < 0.")]
434 [Property("SPEC", "Tizen.NUI.ItemCollection.CopyTo M")]
435 [Property("SPEC_URL", "-")]
436 [Property("CRITERIA", "MR")]
437 [Property("AUTHOR", "guowei.wang@samsung.com")]
438 public void ItemCollectionCopyToWithIndexLessThan0()
440 tlog.Debug(tag, $"ItemCollectionCopyToWithIndexLessThan0 START");
442 var testingTarget = new ItemCollection();
443 Assert.IsNotNull(testingTarget, "Should be not null!");
444 Assert.IsInstanceOf<ItemCollection>(testingTarget, "Should be an Instance of ItemCollection!");
446 testingTarget.Add(new Item());
447 Assert.AreEqual(1, testingTarget.Count, "Should be equal!");
451 testingTarget.CopyTo(-1, new Item[2], 0, 1);
453 catch (ArgumentOutOfRangeException e)
455 tlog.Debug(tag, e.Message.ToString());
456 testingTarget.Dispose();
457 tlog.Debug(tag, $"ItemCollectionCopyToWithIndexLessThan0 END (OK)");
458 Assert.Fail("Caught ArgumentOutOfRangeException: Failed!");
464 [Description("ItemCollection CopyTo. Count < zero.")]
465 [Property("SPEC", "Tizen.NUI.ItemCollection.CopyTo M")]
466 [Property("SPEC_URL", "-")]
467 [Property("CRITERIA", "MR")]
468 [Property("AUTHOR", "guowei.wang@samsung.com")]
469 public void ItemCollectionCopyToWithCountLessThan0()
471 tlog.Debug(tag, $"ItemCollectionCopyToWithCountLessThan0 START");
473 var testingTarget = new ItemCollection();
474 Assert.IsNotNull(testingTarget, "Should be not null!");
475 Assert.IsInstanceOf<ItemCollection>(testingTarget, "Should be an Instance of ItemCollection!");
477 testingTarget.Add(new Item());
478 Assert.AreEqual(1, testingTarget.Count, "Should be equal!");
482 testingTarget.CopyTo(0, new Item[2], 0, -1);
484 catch (ArgumentOutOfRangeException e)
486 tlog.Debug(tag, e.Message.ToString());
487 testingTarget.Dispose();
488 tlog.Debug(tag, $"ItemCollectionCopyToWithCountLessThan0 END (OK)");
489 Assert.Fail("Caught ArgumentOutOfRangeException: Failed!");
495 [Description("ItemCollection GetEnumerator.")]
496 [Property("SPEC", "Tizen.NUI.ItemCollection.GetEnumerator M")]
497 [Property("SPEC_URL", "-")]
498 [Property("CRITERIA", "MR")]
499 [Property("AUTHOR", "guowei.wang@samsung.com")]
500 public void ItemCollectionGetEnumerator()
502 tlog.Debug(tag, $"ItemCollectionGetEnumerator START");
504 Item[] b = new Item[] { new Item(), new Item(), new Item(), new Item() };
505 global::System.Collections.ICollection c = b;
506 var testingTarget = new ItemCollection(c);
507 Assert.IsNotNull(testingTarget, "Should be not null!");
508 Assert.IsInstanceOf<ItemCollection>(testingTarget, "Should be an Instance of ItemCollection!");
510 var result = testingTarget.GetEnumerator();
511 Assert.IsNotNull(result, "Should be not null!");
512 Assert.IsInstanceOf<ItemCollection.ItemCollectionEnumerator>(result, "Should be an Instance of ItemCollectionEnumerator!");
514 tlog.Debug(tag, $"ItemCollectionGetEnumerator END (OK)");
519 [Description("ItemCollection.ItemCollectionEnumerator constructor.")]
520 [Property("SPEC", "Tizen.NUI.ItemCollection.ItemCollectionEnumerator.ItemCollectionEnumerator C")]
521 [Property("SPEC_URL", "-")]
522 [Property("CRITERIA", "CONTSTR")]
523 [Property("AUTHOR", "guowei.wang@samsung.com")]
524 public void ItemCollectionItemCollectionEnumeratorConstructor()
526 tlog.Debug(tag, $"ItemCollectionItemCollectionEnumeratorConstructor START");
528 using (ItemCollection itemCollection = new ItemCollection())
530 var testingTarget = new ItemCollection.ItemCollectionEnumerator(itemCollection);
531 Assert.IsNotNull(testingTarget, "Should be not null!");
532 Assert.IsInstanceOf<ItemCollection.ItemCollectionEnumerator>(testingTarget, "Should be an Instance of ItemCollectionEnumerator!");
534 testingTarget.Dispose();
537 tlog.Debug(tag, $"ItemCollectionItemCollectionEnumeratorConstructor END (OK)");
542 [Description("ItemCollection.ItemCollectionEnumerator Current. currentIndex == -1.")]
543 [Property("SPEC", "Tizen.NUI.ItemCollection.ItemCollectionEnumerator.Current A")]
544 [Property("SPEC_URL", "-")]
545 [Property("CRITERIA", "PRO")]
546 [Property("AUTHOR", "guowei.wang@samsung.com")]
547 public void ItemCollectionItemCollectionEnumeratorCurrent()
549 tlog.Debug(tag, $"ItemCollectionItemCollectionEnumeratorCurrent START");
551 using (ItemCollection itemCollection = new ItemCollection())
553 var testingTarget = new ItemCollection.ItemCollectionEnumerator(itemCollection);
554 Assert.IsNotNull(testingTarget, "Should be not null!");
555 Assert.IsInstanceOf<ItemCollection.ItemCollectionEnumerator>(testingTarget, "Should be an Instance of ItemCollectionEnumerator!");
559 tlog.Debug(tag, "Current : " + testingTarget.Current);
561 catch (InvalidOperationException e)
563 tlog.Debug(tag, e.Message.ToString());
564 testingTarget.Dispose();
565 tlog.Debug(tag, $"ItemCollectionItemCollectionEnumeratorCurrent END (OK)");
566 Assert.Pass("Caught InvalidOperationException : passed!");
570 tlog.Debug(tag, $"ItemCollectionItemCollectionEnumeratorCurrent END (OK)");
575 [Description("ItemCollection.ItemCollectionEnumerator MoveNext.")]
576 [Property("SPEC", "Tizen.NUI.ItemCollection.ItemCollectionEnumerator.MoveNext M")]
577 [Property("SPEC_URL", "-")]
578 [Property("CRITERIA", "MR")]
579 [Property("AUTHOR", "guowei.wang@samsung.com")]
580 public void ItemCollectionItemCollectionEnumeratorMoveNext()
582 tlog.Debug(tag, $"ItemCollectionItemCollectionEnumeratorMoveNext START");
584 Item[] b = new Item[] { new Item(), new Item(), new Item(), new Item() };
585 global::System.Collections.ICollection c = b;
586 var itemCollection = new ItemCollection(c);
587 Assert.IsNotNull(itemCollection, "Should be not null!");
588 Assert.IsInstanceOf<ItemCollection>(itemCollection, "Should be an Instance of ItemCollection!");
590 var testingTarget = new ItemCollection.ItemCollectionEnumerator(itemCollection);
591 Assert.IsNotNull(testingTarget, "Should be not null!");
592 Assert.IsInstanceOf<ItemCollection.ItemCollectionEnumerator>(testingTarget, "Should be an Instance of ItemCollectionEnumerator!");
596 testingTarget.MoveNext();
597 var result = testingTarget.Current;
598 Assert.IsNotNull(result, "Should be not null!");
599 Assert.IsInstanceOf<Item>(result, "Should be an Instance of Item!");
603 tlog.Debug(tag, e.Message.ToString());
604 Assert.Fail("Caught Exception: Failed!");
607 tlog.Debug(tag, $"ItemCollectionItemCollectionEnumeratorMoveNext END (OK)");
612 [Description("ItemCollection.ItemCollectionEnumerator MoveNext. Object is null.")]
613 [Property("SPEC", "Tizen.NUI.ItemCollection.ItemCollectionEnumerator.MoveNext M")]
614 [Property("SPEC_URL", "-")]
615 [Property("CRITERIA", "MR")]
616 [Property("AUTHOR", "guowei.wang@samsung.com")]
617 public void ItemCollectionItemCollectionEnumeratorMoveNextNullObject()
619 tlog.Debug(tag, $"ItemCollectionItemCollectionEnumeratorMoveNextNullObject START");
621 Item[] b = new Item[] { new Item(), new Item(), new Item(), new Item() };
622 global::System.Collections.ICollection c = b;
623 var itemCollection = new ItemCollection(c);
624 Assert.IsNotNull(itemCollection, "Should be not null!");
625 Assert.IsInstanceOf<ItemCollection>(itemCollection, "Should be an Instance of ItemCollection!");
627 var testingTarget = new ItemCollection.ItemCollectionEnumerator(itemCollection);
628 Assert.IsNotNull(testingTarget, "Should be not null!");
629 Assert.IsInstanceOf<ItemCollection.ItemCollectionEnumerator>(testingTarget, "Should be an Instance of ItemCollectionEnumerator!");
633 testingTarget.MoveNext();
634 testingTarget.MoveNext();
635 testingTarget.MoveNext();
636 testingTarget.MoveNext();
637 testingTarget.MoveNext();
638 var result = testingTarget.Current;
640 catch (InvalidOperationException e)
642 tlog.Debug(tag, e.Message.ToString());
643 testingTarget.Dispose();
644 tlog.Debug(tag, $"ItemCollectionItemCollectionEnumeratorMoveNextNullObject END (OK)");
645 Assert.Pass("Caught InvalidOperationException: Passed!");
651 [Description("ItemCollection.ItemCollectionEnumerator Reset.")]
652 [Property("SPEC", "Tizen.NUI.ItemCollection.ItemCollectionEnumerator.Reset M")]
653 [Property("SPEC_URL", "-")]
654 [Property("CRITERIA", "MR")]
655 [Property("AUTHOR", "guowei.wang@samsung.com")]
656 public void ItemCollectionItemCollectionEnumeratorReset()
658 tlog.Debug(tag, $"ItemCollectionItemCollectionEnumeratorReset START");
660 Item[] b = new Item[] { new Item(), new Item(), new Item(), new Item() };
661 global::System.Collections.ICollection c = b;
662 var itemCollection = new ItemCollection(c);
663 Assert.IsNotNull(itemCollection, "Should be not null!");
664 Assert.IsInstanceOf<ItemCollection>(itemCollection, "Should be an Instance of ItemCollection!");
666 var testingTarget = new ItemCollection.ItemCollectionEnumerator(itemCollection);
667 Assert.IsNotNull(testingTarget, "Should be not null!");
668 Assert.IsInstanceOf<ItemCollection.ItemCollectionEnumerator>(testingTarget, "Should be an Instance of ItemCollectionEnumerator!");
670 testingTarget.MoveNext();
674 testingTarget.Reset();
678 tlog.Debug(tag, e.Message.ToString());
679 Assert.Fail("Caught Exception: Failed!");
682 tlog.Debug(tag, $"ItemCollectionItemCollectionEnumeratorReset END (OK)");
687 [Description("ItemCollection AddRange.")]
688 [Property("SPEC", "Tizen.NUI.ItemCollection.AddRange M")]
689 [Property("SPEC_URL", "-")]
690 [Property("CRITERIA", "MR")]
691 [Property("AUTHOR", "guowei.wang@samsung.com")]
692 public void ItemCollectionAddRange()
694 tlog.Debug(tag, $"ItemCollectionAddRange START");
696 using (ItemCollection itemCollection = new ItemCollection(5))
698 var testingTarget = new ItemCollection();
699 Assert.IsNotNull(testingTarget, "Should be not null!");
700 Assert.IsInstanceOf<ItemCollection>(testingTarget, "Should be an Instance of ItemCollection!");
704 testingTarget.AddRange(itemCollection);
708 tlog.Debug(tag, e.Message.ToString());
709 Assert.Fail("Caught Exception: Failed!");
712 testingTarget.Dispose();
715 tlog.Debug(tag, $"ItemCollectionAddRange END (OK)");
720 [Description("ItemCollection GetRange.")]
721 [Property("SPEC", "Tizen.NUI.ItemCollection.GetRange M")]
722 [Property("SPEC_URL", "-")]
723 [Property("CRITERIA", "MR")]
724 [Property("AUTHOR", "guowei.wang@samsung.com")]
725 public void ItemCollectionGetRange()
727 tlog.Debug(tag, $"ItemCollectionGetRange START");
729 using (ItemCollection itemCollection = new ItemCollection(5))
731 var testingTarget = new ItemCollection();
732 Assert.IsNotNull(testingTarget, "Should be not null!");
733 Assert.IsInstanceOf<ItemCollection>(testingTarget, "Should be an Instance of ItemCollection!");
735 testingTarget.AddRange(itemCollection);
739 var result = testingTarget.GetRange(0, 0);
740 Assert.IsInstanceOf<ItemCollection>(result, "Should be an Instance of ItemCollection!");
744 tlog.Debug(tag, e.Message.ToString());
745 Assert.Fail("Caught Exception: Failed!");
748 testingTarget.Dispose();
751 tlog.Debug(tag, $"ItemCollectionGetRange END (OK)");
756 [Description("ItemCollection Insert.")]
757 [Property("SPEC", "Tizen.NUI.ItemCollection.Insert M")]
758 [Property("SPEC_URL", "-")]
759 [Property("CRITERIA", "MR")]
760 [Property("AUTHOR", "guowei.wang@samsung.com")]
761 public void ItemCollectionInsert()
763 tlog.Debug(tag, $"ItemCollectionInsert START");
765 Item[] b = new Item[] { new Item(), new Item(), new Item(), new Item() };
766 global::System.Collections.ICollection c = b;
767 var testingTarget = new ItemCollection(c);
769 testingTarget.Capacity = 5;
773 testingTarget.Insert(4, new Item());
777 tlog.Debug(tag, e.Message.ToString());
778 Assert.Fail("Caught Exception: Failed!");
781 testingTarget.Dispose();
782 tlog.Debug(tag, $"ItemCollectionInsert END (OK)");
787 [Description("ItemCollection InsertRange.")]
788 [Property("SPEC", "Tizen.NUI.ItemCollection.InsertRange M")]
789 [Property("SPEC_URL", "-")]
790 [Property("CRITERIA", "MR")]
791 [Property("AUTHOR", "guowei.wang@samsung.com")]
792 public void ItemCollectionInsertRange()
794 tlog.Debug(tag, $"ItemCollectionInsertRange START");
796 using (ItemCollection value = new ItemCollection(3))
799 Item[] b = new Item[] { new Item(), new Item(), new Item(), new Item() };
800 global::System.Collections.ICollection c = b;
801 var testingTarget = new ItemCollection(c);
803 testingTarget.Capacity = 10;
807 testingTarget.InsertRange(4, value);
811 tlog.Debug(tag, e.Message.ToString());
812 Assert.Fail("Caught Exception: Failed!");
815 testingTarget.Dispose();
818 tlog.Debug(tag, $"ItemCollectionInsertRange END (OK)");
823 [Description("ItemCollection RemoveAt.")]
824 [Property("SPEC", "Tizen.NUI.ItemCollection.RemoveAt M")]
825 [Property("SPEC_URL", "-")]
826 [Property("CRITERIA", "MR")]
827 [Property("AUTHOR", "guowei.wang@samsung.com")]
828 public void ItemCollectionRemoveAt()
830 tlog.Debug(tag, $"ItemCollectionRemoveAt START");
832 Item[] b = new Item[] { new Item(), new Item(), new Item(), new Item() };
833 global::System.Collections.ICollection c = b;
834 var testingTarget = new ItemCollection(c);
836 testingTarget.Capacity = 5;
840 testingTarget.RemoveAt(3);
844 tlog.Debug(tag, e.Message.ToString());
845 Assert.Fail("Caught Exception: Failed!");
848 testingTarget.Dispose();
850 tlog.Debug(tag, $"ItemCollectionRemoveAt END (OK)");
855 [Description("ItemCollection RemoveRange.")]
856 [Property("SPEC", "Tizen.NUI.ItemCollection.RemoveRange M")]
857 [Property("SPEC_URL", "-")]
858 [Property("CRITERIA", "MR")]
859 [Property("AUTHOR", "guowei.wang@samsung.com")]
860 public void ItemCollectionRemoveRange()
862 tlog.Debug(tag, $"ItemCollectionRemoveRange START");
864 Item[] b = new Item[] { new Item(), new Item(), new Item(), new Item() };
865 global::System.Collections.ICollection c = b;
866 var testingTarget = new ItemCollection(c);
868 testingTarget.Capacity = 5;
872 testingTarget.RemoveRange(1, 2);
876 tlog.Debug(tag, e.Message.ToString());
877 Assert.Fail("Caught Exception: Failed!");
880 testingTarget.Dispose();
882 tlog.Debug(tag, $"ItemCollectionRemoveRange END (OK)");
887 [Description("ItemCollection Repeat.")]
888 [Property("SPEC", "Tizen.NUI.ItemCollection.Repeat M")]
889 [Property("SPEC_URL", "-")]
890 [Property("CRITERIA", "MR")]
891 [Property("AUTHOR", "guowei.wang@samsung.com")]
892 public void ItemCollectionRepeat()
894 tlog.Debug(tag, $"ItemCollectionRepeat START");
896 var testingTarget = ItemCollection.Repeat(new Item(), 6);
897 Assert.IsNotNull(testingTarget, "Should be not null!");
898 Assert.IsInstanceOf<ItemCollection>(testingTarget, "Should be an Instance of ItemCollection!");
900 Assert.AreEqual(6, testingTarget.Capacity, "Should be equal!");
902 testingTarget.Dispose();
904 tlog.Debug(tag, $"ItemCollectionRepeat END (OK)");
909 [Description("ItemCollection SetRange.")]
910 [Property("SPEC", "Tizen.NUI.ItemCollection.SetRange M")]
911 [Property("SPEC_URL", "-")]
912 [Property("CRITERIA", "MR")]
913 [Property("AUTHOR", "guowei.wang@samsung.com")]
914 public void ItemCollectionSetRange()
916 tlog.Debug(tag, $"ItemCollectionSetRange START");
918 using (ItemCollection itemCollection = new ItemCollection(5))
920 Item[] b = new Item[] { new Item(), new Item(), new Item(), new Item() };
921 global::System.Collections.ICollection c = b;
922 var testingTarget = new ItemCollection(c);
926 testingTarget.SetRange(1, itemCollection);
930 tlog.Debug(tag, e.Message.ToString());
931 Assert.Fail("Caught Exception: Failed!");
934 testingTarget.Dispose();
937 tlog.Debug(tag, $"ItemCollectionSetRange END (OK)");
942 [Description("ItemCollection Reverse.")]
943 [Property("SPEC", "Tizen.NUI.ItemCollection.Reverse M")]
944 [Property("SPEC_URL", "-")]
945 [Property("CRITERIA", "MR")]
946 [Property("AUTHOR", "guowei.wang@samsung.com")]
947 public void ItemCollectionReverse()
949 tlog.Debug(tag, $"ItemCollectionReverse START");
951 Item[] b = new Item[] { new Item(), new Item(), new Item(), new Item() };
952 global::System.Collections.ICollection c = b;
953 var testingTarget = new ItemCollection(c);
955 testingTarget.Capacity = 5;
959 testingTarget.Reverse();
963 tlog.Debug(tag, e.Message.ToString());
964 Assert.Fail("Caught Exception: Failed!");
967 testingTarget.Dispose();
969 tlog.Debug(tag, $"ItemCollectionReverse END (OK)");
974 [Description("ItemCollection Reverse. With parameters.")]
975 [Property("SPEC", "Tizen.NUI.ItemCollection.Reverse M")]
976 [Property("SPEC_URL", "-")]
977 [Property("CRITERIA", "MR")]
978 [Property("AUTHOR", "guowei.wang@samsung.com")]
979 public void ItemCollectionReverseWithParameters()
981 tlog.Debug(tag, $"ItemCollectionReverseWithParameters START");
983 Item[] b = new Item[] { new Item(), new Item(), new Item(), new Item() };
984 global::System.Collections.ICollection c = b;
985 var testingTarget = new ItemCollection(c);
987 testingTarget.Capacity = 5;
991 testingTarget.Reverse(1, 2);
995 tlog.Debug(tag, e.Message.ToString());
996 Assert.Fail("Caught Exception: Failed!");
999 testingTarget.Dispose();
1001 tlog.Debug(tag, $"ItemCollectionReverseWithParameters END (OK)");