public void TestSetClearing() { var set = new RedBlackSet<char> { 'a', 'b', 'c', 'd', }; Assert.That(set.Count, Is.GreaterThan(0)); set.Clear(); Assert.That(set.Empty, Is.True); set.Add('z'); Assert.That(set.Count, Is.EqualTo(1)); }
public void TestDoubleInsertionSet() { var set = new RedBlackSet<char> { 'a', 'b', 'c', 'd', }; Assert.That(set.Empty, Is.False); Assert.That(set.Count, Is.EqualTo(4)); Assert.That(set.Contains('e'), Is.False); set.Add('e'); Assert.That(set.Contains('e')); Assert.That(set.Count, Is.EqualTo(5)); set.Add('e'); Assert.That(set.Contains('e')); Assert.That(set.Count, Is.EqualTo(5)); }