public void ItemCollection_IndexterTest() { this.TestHelper( "Indexer", (col) => { Assert.AreSame(ItemCollectionTest.object1, col[ItemCollectionTest.object1.Key]); }, false, ItemCollectionTest.CreateNew(ItemCollectionTest.object1)); }
public void ItemCollection_ContainsTest() { this.TestHelper( "Contains", (col) => { Assert.IsTrue(col.Contains(ItemCollectionTest.object1.Key)); }, false, ItemCollectionTest.CreateNew(ItemCollectionTest.object1)); }
public void ItemCollection_ClearTest() { this.TestHelper( "Clear", (col) => { col.Clear(); Assert.AreEqual(0, col.Count); }, true, ItemCollectionTest.CreateNew(ItemCollectionTest.object1)); }
public void ItemCollection_RemoveItemTest() { this.TestHelper( "RemoveItem", (col) => { col.Remove(ItemCollectionTest.object1); Assert.AreEqual(0, col.Count); }, true, ItemCollectionTest.CreateNew(ItemCollectionTest.object1)); }
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); }
private void TestHelper(string actionName, Action <KeyedItemCollection <string, MyClass> > action, bool isReadonlyExceptionExpected, KeyedItemCollection <string, MyClass> collection = null) { LogHelper.Log("Testing {0} ", actionName); this.TestHelper2(action, ItemCollectionTest.Clone(collection)); }