Exemple #1
0
 public void BuildTest()
 {
     string expected = "[ -59 -45 11 -12 44 53 80 11 94 62 ]";
     var hp = new Heap(a);
     string actual = hp.ToString();
     Assert.AreEqual(actual, expected);
 }
Exemple #2
0
 public void AddTest()
 {
     var hp = new Heap(8);
     hp.Add(-2);
     hp.Add(0);
     hp.Add(5);
     hp.Add(5);
     hp.Add(3);
     string expected = "[ -2 0 5 5 3 0 0 0 ]";
     string actual = hp.ToString();
     Assert.AreEqual(actual, expected);
 }
Exemple #3
0
 public void RemoveTest()
 {
     var hp = new Heap(8);
     hp.Add(-2);
     hp.Add(0);
     hp.Add(5);
     hp.Add(5);
     hp.Add(3);
     hp.Remove();
     string expected = String.Format("[ 0 3 5 5 {0} 0 0 0 ]", int.MaxValue);
     string actual = hp.ToString();
     Assert.AreEqual(actual, expected);
 }