Example #1
0
 public void TestSetRemove()
 {
     var set = new RedBlackSet<char>
     {
         'a',
         'b',
         'c',
         'd',
         'e',
         'f',
         'g',
         'h',
     };
     Assert.That(set.Count, Is.EqualTo(8));
     Assert.That(set.Contains('f'), Is.True);
     set.Remove('f');
     Assert.That(set.Count, Is.EqualTo(7));
     Assert.That(set.Contains('f'), Is.False);
 }
Example #2
0
 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));
 }