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)); }
// run the delegate private void TestHelper2(Action <KeyedItemCollection <string, MyClass> > action, KeyedItemCollection <string, MyClass> collection) { action(collection); }