public void Clear_Empty() { var mru = new MostRecentlyUsedCollection<String>(); mru.Clear(); Assert.AreEqual(0, mru.Count); }
public void Clear_Empty() { var mru = new MostRecentlyUsedCollection <String>(); mru.Clear(); Assert.AreEqual(0, mru.Count); }
public void Clear_WithItems() { var mru = new MostRecentlyUsedCollection<String>(); mru.Add("one"); mru.Add("two"); mru.Clear(); Assert.AreEqual(0, mru.Count); }
public void Clear_WithItems() { var mru = new MostRecentlyUsedCollection <String>(); mru.Add("one"); mru.Add("two"); mru.Clear(); Assert.AreEqual(0, mru.Count); }
public void Clear() { var c = new MostRecentlyUsedCollection <string> { "a", "b", "c" }; c.Count.ShouldEqual(3); c.Clear(); c.Count.ShouldEqual(0); }
public void Validation() { var validItems = new [] { "a", "b", "c" }; var c = new MostRecentlyUsedCollection <string> ( itemValidationDelegate: i => validItems.Contains(i)); c.Load(new [] { "a", "b", "c", "d" }); c.SequenceShouldEqual(validItems); c.Clear(); c.Count.ShouldEqual(0); c.Add("d"); c.Count.ShouldEqual(0); // ensure even if we make no inserts, we still validate the rest c.Load(new [] { "a", "b", "c", "d" }); validItems = new [] { "a" }; c.Add("a"); c.SequenceShouldEqual(new [] { "a" }); }