public void PeekTest() { MyQueue <int> Queue = new MyArrayQueue <int>(); Queue.Enqueue(98); Queue.Enqueue(20); Assert.AreEqual(Queue.Peek(), 98); }
public void Should_Peek_Throw_If_Empty() { //arrange var queue = new MyArrayQueue <int>(); //act Action act = () => queue.Peek(); //assert act.ShouldThrow <InvalidOperationException>(); }
public void PeekFromEmptyTest() { MyQueue <int> Queue = new MyArrayQueue <int>(); try { Queue.Peek(); } catch (InvalidOperationException e) { StringAssert.Contains(e.Message, "Очередь пуста."); } }
public void Should_Peek() { //arrange var queue = new MyArrayQueue <int>(); queue.Enqueue(1); queue.Enqueue(2); queue.Enqueue(3); queue.Enqueue(4); queue.Enqueue(5); //act var result = queue.Peek(); //assert result.ShouldBeEquivalentTo(1); queue.Capacity.ShouldBeEquivalentTo(8); queue.Count.ShouldBeEquivalentTo(5); queue.Dequeue().ShouldBeEquivalentTo(1); queue.Dequeue().ShouldBeEquivalentTo(2); queue.Dequeue().ShouldBeEquivalentTo(3); queue.Dequeue().ShouldBeEquivalentTo(4); queue.Dequeue().ShouldBeEquivalentTo(5); }
public void PeekFromEmptyTest() { MyQueue<int> Queue = new MyArrayQueue<int>(); try { Queue.Peek(); } catch (InvalidOperationException e) { StringAssert.Contains(e.Message, "Очередь пуста."); } }
public void PeekTest() { MyQueue<int> Queue = new MyArrayQueue<int>(); Queue.Enqueue(98); Queue.Enqueue(20); Assert.AreEqual(Queue.Peek(), 98); }