public void Test_peek() { Queue = new MyPriorityQueue <int>(RandArr); for (int i = 0; i < RandArr.Length; i++) { Assert.Equal(Queue.Peek(), Queue.Poll()); } }
public void AddLettersBigAndSmall() { MyPriorityQueue <string> sut = new MyPriorityQueue <string>(); sut.Add("A"); sut.Add("a"); string actual = sut.Peek(); Assert.AreEqual("a", actual); }
public void SwoopsDataTheRightWay() { MyPriorityQueue <int> sut = new MyPriorityQueue <int>(); sut.Add(8); sut.Add(2); int actual = sut.Peek(); Assert.AreEqual(2, actual); }
public void AddNegativeValues() { MyPriorityQueue <int> sut = new MyPriorityQueue <int>(); sut.Add(-8); sut.Add(-2); int actual = sut.Peek(); Assert.AreEqual(-8, actual); }
public void PopOneValue() { MyPriorityQueue <int> sut = new MyPriorityQueue <int>(); sut.Add(8); sut.Add(2); sut.Pop(); int actual = sut.Peek(); Assert.AreEqual(8, actual); }
public void AddLoadsOfLettersBigAndSmall() { MyPriorityQueue <string> sut = new MyPriorityQueue <string>(); sut.Add("y"); sut.Add("Y"); sut.Add("a"); sut.Add("A"); sut.Add("j"); sut.Add("L"); sut.Add("R"); sut.Add("r"); sut.Add("B"); string actual = sut.Peek(); Assert.AreEqual("a", actual); }