public void Remove() { WordInfoCollection collection = new WordInfoCollection(); WordInfo mi1 = new WordInfo("goose", 1, 0, WordLocation.Content); WordInfo mi2 = new WordInfo("hello", 12, 0, WordLocation.Content); collection.Add(mi1); Assert.IsTrue(collection.Contains(mi1), "Collection should contain item"); Assert.IsFalse(collection.Contains(mi2), "Collection should not contain item"); Assert.IsFalse(collection.Contains(null as WordInfo), "Contains should return false"); }
public void Contains_String() { WordInfoCollection collection = new WordInfoCollection(); WordInfo mi1 = new WordInfo("continuous", 0, 0, WordLocation.Content); collection.Add(mi1); Assert.IsTrue(collection.Contains("continuous"), "Collection should contain string"); Assert.IsFalse(collection.Contains("taskbar"), "Collection should not contain string"); Assert.IsFalse(collection.Contains(null as string), "Contains should return false"); Assert.IsFalse(collection.Contains(""), "Contains should return false"); }
public void Contains_WordInfo() { WordInfoCollection collection = new WordInfoCollection(); WordInfo mi1 = new WordInfo("continuous", 0, 0, WordLocation.Content); WordInfo mi2 = new WordInfo("taskbar", 21, 0, WordLocation.Content); collection.Add(mi1); Assert.IsTrue(collection.Contains(mi1), "Collection should contain item"); Assert.IsFalse(collection.Contains(mi2), "Collection should not contain item"); Assert.IsFalse(collection.Contains(null as WordInfo), "Contains should return false"); }