Exemplo n.º 1
0
        public void Dequeue_Empty_InvalidOperationException_NUnit()
        {
            // Arrange
            MyCustomQueue <int> queue = new MyCustomQueue <int>();

            // Assert
            Assert.Throws <InvalidOperationException>(() => queue.Dequeue());
        }
Exemplo n.º 2
0
        public void Dequeue_InputCorrectListStrings_NUnit()
        {
            // Arrange
            MyCustomQueue <string> queueStr = new MyCustomQueue <string>();

            string expected = "Kirill";

            // Act
            queueStr.Enqueue("Kirill");
            queueStr.Enqueue("Oleg");
            queueStr.Enqueue("Vasya");

            string result = queueStr.Dequeue();

            // Assert
            Assert.AreEqual(expected, result);
        }
Exemplo n.º 3
0
        public void Dequeue_InputCorrectListNumbers_NUnit()
        {
            // Arrange
            MyCustomQueue <int> queue = new MyCustomQueue <int>();

            int expected = 10;

            // Act
            queue.Enqueue(10);
            queue.Enqueue(12);
            queue.Enqueue(2);
            queue.Enqueue(7);

            int result = queue.Dequeue();

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