public void TestAddItem() { List<string> strings = new List<string>(); PrimaryKeyCollection collection = new PrimaryKeyCollection(); Assert.AreEqual(1, collection.Add(strings)); }
public void TestClear() { List<string> strings1 = new List<string>(); PrimaryKeyCollection collection = new PrimaryKeyCollection(); collection.Add(strings1); collection.Clear(); Assert.IsFalse(collection.Contains(strings1)); }
public void TestAddUniqueItems() { List<string> item1 = new List<string>(); List<string> item2 = new List<string>(); PrimaryKeyCollection collection = new PrimaryKeyCollection(); collection.Add(item1); collection.Add(item2); Assert.AreEqual(1, collection.GetKeyFor(item1)); Assert.AreEqual(2, collection.GetKeyFor(item2)); }
public void TestAddItemsOfDifferentTypes() { List<string> strings1 = new List<string>(); List<string> strings2 = new List<string>(); Exception exception1 = new Exception(); Exception exception2 = new Exception(); PrimaryKeyCollection collection = new PrimaryKeyCollection(); collection.Add(strings1); collection.Add(strings2); collection.Add(exception1); collection.Add(exception2); Assert.AreEqual(1, collection.GetKeyFor(strings1)); Assert.AreEqual(2, collection.GetKeyFor(strings2)); Assert.AreEqual(1, collection.GetKeyFor(exception1)); Assert.AreEqual(2, collection.GetKeyFor(exception2)); }
public void TestDoesNotContain() { List<string> strings = new List<string>(); PrimaryKeyCollection collection = new PrimaryKeyCollection(); Assert.IsFalse(collection.Contains(strings)); }
public void TestContainsItem() { List<string> strings = new List<string>(); PrimaryKeyCollection collection = new PrimaryKeyCollection(); collection.Add(strings); Assert.IsTrue(collection.Contains(strings)); }
public void TestGetKeyForNoItemsDefined() { PrimaryKeyCollection collection = new PrimaryKeyCollection(); collection.GetKeyFor(new Exception()); }
public void TestGetKeyForItemNotFound() { List<string> strings1 = new List<string>(); List<string> strings2 = new List<string>(); PrimaryKeyCollection collection = new PrimaryKeyCollection(); collection.Add(strings1); collection.GetKeyFor(strings2); }