public void Should_Check_Length_One_Enqueue_Dequeue_Multiple() { //arrange var queue = new MyLinkedListQueue <int>(); //act queue.Enqueue(1); queue.Dequeue(); queue.Enqueue(2); var result = queue.Dequeue(); //assert result.ShouldBeEquivalentTo(2); queue.Count.ShouldBeEquivalentTo(0); }
public void Should_Enqueue() { //arrange var queue = new MyLinkedListQueue <int>(); //act queue.Enqueue(1); queue.Enqueue(22); queue.Enqueue(3); queue.Enqueue(2); queue.Enqueue(5); var result = queue.Peek(); //assert queue.Count.ShouldBeEquivalentTo(5); result.ShouldBeEquivalentTo(1); }
public void Should_Enqueue_One() { //arrange var queue = new MyLinkedListQueue <int>(); //act queue.Enqueue(1); //assert queue.Count.ShouldBeEquivalentTo(1); }
public void Should_Is_Empty_False() { //arrange var queue = new MyLinkedListQueue <int>(); queue.Enqueue(1); //act var result = queue.IsEmpty(); //assert result.ShouldBeEquivalentTo(false); }
public void Should_Dequeue() { //arrange var queue = new MyLinkedListQueue <int>(); queue.Enqueue(1); //act var result = queue.Dequeue(); //assert result.ShouldBeEquivalentTo(1); queue.Count.ShouldBeEquivalentTo(0); }
public void Should_Dequeue_Multiple() { //arrange var queue = new MyLinkedListQueue <int>(); queue.Enqueue(1); queue.Enqueue(2); queue.Enqueue(3); queue.Enqueue(4); //act var first = queue.Dequeue(); var second = queue.Dequeue(); var third = queue.Dequeue(); var fourth = queue.Dequeue(); //assert first.ShouldBeEquivalentTo(1); second.ShouldBeEquivalentTo(2); third.ShouldBeEquivalentTo(3); fourth.ShouldBeEquivalentTo(4); queue.Count.ShouldBeEquivalentTo(0); }
public void Should_Check_Length_One_Enqueue_Dequeue() { //arrange var queue = new MyLinkedListQueue <int>(); //act queue.Enqueue(1); var result = queue.Dequeue(); Action act = () => queue.Dequeue(); //assert result.ShouldBeEquivalentTo(1); queue.Count.ShouldBeEquivalentTo(0); act.ShouldThrow <InvalidOperationException>(); }