public void Clear() { WordInfoCollection collection = new WordInfoCollection(); WordInfo mi1 = new WordInfo("continuous", 0, 0, WordLocation.Content); WordInfo mi2 = new WordInfo("taskbar", 21, 1, WordLocation.Content); collection.Add(mi1); collection.Add(mi2); Assert.AreEqual(2, collection.Count, "Wrong count (collection should contain 2 items)"); collection.Clear(); Assert.AreEqual(0, collection.Count, "Wrong count (collection should be empty)"); }
public void Clear() { WordInfoCollection sut = new WordInfoCollection(); WordInfo mi1 = new WordInfo("continuous", 0, 0, WordLocation.Content); WordInfo mi2 = new WordInfo("taskbar", 21, 1, WordLocation.Content); sut.Add(mi1); sut.Add(mi2); Assert.Equal(2, sut.Count); sut.Clear(); Assert.Empty(sut); }