public void TestContainsKeyName() { KeyDef keyDef = new KeyDef("mykey"); KeyDefCol col = new KeyDefCol(); Assert.IsFalse(col.Contains("mykey")); col.Add(keyDef); Assert.IsTrue(col.Contains("mykey")); }
public void TestAddRange() { //---------------Set up test pack------------------- var keyDef1 = new KeyDef("key1"); var keyDef2 = new KeyDef("key2"); var keyDef3 = new KeyDef("key3"); var col = new KeyDefCol { keyDef1, keyDef2, keyDef3 }; var testCol = new KeyDefCol(); //---------------Assert Precondition---------------- Assert.AreEqual(3, col.Count); Assert.AreEqual(0, testCol.Count); //---------------Execute Test ---------------------- testCol.AddRange(col); //---------------Test Result ----------------------- Assert.AreEqual(3, testCol.Count); Assert.IsTrue(col.Contains("key1")); Assert.IsTrue(col.Contains("key2")); Assert.IsTrue(col.Contains("key3")); }
public void TestAddRange() { //---------------Set up test pack------------------- var keyDef1 = new KeyDef("key1"); var keyDef2 = new KeyDef("key2"); var keyDef3 = new KeyDef("key3"); var col = new KeyDefCol {keyDef1, keyDef2, keyDef3}; var testCol = new KeyDefCol(); //---------------Assert Precondition---------------- Assert.AreEqual(3, col.Count); Assert.AreEqual(0, testCol.Count); //---------------Execute Test ---------------------- testCol.AddRange(col); //---------------Test Result ----------------------- Assert.AreEqual(3, testCol.Count); Assert.IsTrue(col.Contains("key1")); Assert.IsTrue(col.Contains("key2")); Assert.IsTrue(col.Contains("key3")); }