Beispiel #1
0
 public void ItemCollection_IndexterTest()
 {
     this.TestHelper(
         "Indexer",
         (col) =>
     {
         Assert.AreSame(ItemCollectionTest.object1, col[ItemCollectionTest.object1.Key]);
     },
         false,
         ItemCollectionTest.CreateNew(ItemCollectionTest.object1));
 }
Beispiel #2
0
 public void ItemCollection_ContainsTest()
 {
     this.TestHelper(
         "Contains",
         (col) =>
     {
         Assert.IsTrue(col.Contains(ItemCollectionTest.object1.Key));
     },
         false,
         ItemCollectionTest.CreateNew(ItemCollectionTest.object1));
 }
Beispiel #3
0
 public void ItemCollection_ClearTest()
 {
     this.TestHelper(
         "Clear",
         (col) =>
     {
         col.Clear();
         Assert.AreEqual(0, col.Count);
     },
         true,
         ItemCollectionTest.CreateNew(ItemCollectionTest.object1));
 }
Beispiel #4
0
 public void ItemCollection_RemoveItemTest()
 {
     this.TestHelper(
         "RemoveItem",
         (col) =>
     {
         col.Remove(ItemCollectionTest.object1);
         Assert.AreEqual(0, col.Count);
     },
         true,
         ItemCollectionTest.CreateNew(ItemCollectionTest.object1));
 }
Beispiel #5
0
        private static KeyedItemCollection <string, MyClass> Clone(KeyedItemCollection <string, MyClass> init)
        {
            var collection = ItemCollectionTest.CreateNew();

            if (init != null)
            {
                foreach (var item in init)
                {
                    collection.Add(item);
                }
            }

            return(collection);
        }