Esempio n. 1
0
            public void MyQueue_4_Dequeue_1_ThrowsExceptionOnEmptyList()
            {
                // Arrange
                IMyQueue <string> stack = DSBuilder.CreateMyArrayQueue();

                // Act & Assert
                Assert.Throws(typeof(MyQueueEmptyException), () => stack.Dequeue());
            }
Esempio n. 2
0
            public void MyQueue_3_GetFront_1_ThrowsExceptionOnEmptyStack()
            {
                // Arrange
                IMyQueue <string> stack = DSBuilder.CreateMyArrayQueue();

                // Act & Assert
                Assert.Throws(typeof(MyQueueEmptyException), () => stack.GetFront());
            }
Esempio n. 3
0
            public void MyQueue_1_Constructor_1_IsEmptyReturnsTrue()
            {
                // Arrange
                IMyQueue <string> q = DSBuilder.CreateMyArrayQueue();
                bool expected       = true;

                // Act
                bool actual = q.IsEmpty();

                // Assert
                Assert.AreEqual(expected, actual);
            }
Esempio n. 4
0
            public void MyQueue_2_Enqueue_4_DequeueIsOkAfter1Enqueue()
            {
                // Arrange
                IMyQueue <string> stack    = DSBuilder.CreateMyArrayQueue();
                string            expected = "a";

                // Act
                stack.Enqueue("a");
                string actual = stack.Dequeue();

                // Assert
                Assert.AreEqual(expected, actual);
            }
Esempio n. 5
0
            public void MyQueue_2_Enqueue_1_IsEmptyReturnsFalse()
            {
                // Arrange
                IMyQueue <string> stack = DSBuilder.CreateMyArrayQueue();
                bool expected           = false;

                // Act
                stack.Enqueue("a");
                bool actual = stack.IsEmpty();

                // Assert
                Assert.AreEqual(expected, actual);
            }
Esempio n. 6
0
            public void MyQueue_4_Dequeue_2_IsEmptyReturnsTrueAfterGetFrontOnOneElement()
            {
                // Arrange
                IMyQueue <string> stack = DSBuilder.CreateMyArrayQueue();
                bool expected           = true;

                // Act
                stack.Enqueue("a");
                stack.Dequeue();
                bool actual = stack.IsEmpty();

                // Assert
                Assert.AreEqual(expected, actual);
            }
Esempio n. 7
0
            public void MyQueue_3_GetBack_2_IsEmptyReturnsFalseAfterGetBackOnOneElement()
            {
                // Arrange
                IMyQueue <string> stack = DSBuilder.CreateMyArrayQueue();
                bool expected           = false;

                // Act
                stack.Enqueue("a");
                stack.GetBack();
                bool actual = stack.IsEmpty();

                // Assert
                Assert.AreEqual(expected, actual);
            }
Esempio n. 8
0
            public void MyQueue_2_Enqueue_3_GetBackIsOkAfter3Enqueue()
            {
                // Arrange
                IMyQueue <string> stack    = DSBuilder.CreateMyArrayQueue();
                string            expected = "c";

                // Act
                stack.Enqueue("a");
                stack.Enqueue("b");
                stack.Enqueue("c");
                string actual = stack.GetBack();

                // Assert
                Assert.AreEqual(expected, actual);
            }