Exemplo n.º 1
0
        public void WhenPreviousIsNull_ReturnsFirstItem()
        {
            //Arrange
            var expected = "Joe";
            var list = new[] { expected, "Michael", "Jane" };

            //Act
            var result = list.NextElement(null);

            //Assert
            Assert.AreEqual(expected, result);
        }
Exemplo n.º 2
0
        public void WhenPreviousIsLastItem_ReturnsFirstItem()
        {
            //Arrange
            var previous = "Bob";
            var expected = "Joe";
            var list = new[] { expected, "Michael", previous };

            //Act
            var result = list.NextElement(previous);

            //Assert
            Assert.AreEqual(expected, result);
        }
Exemplo n.º 3
0
        public void WhenEnumerableHasItems_ReturnsNextItem()
        {
            //Arrange
            var previous = "Bob";
            var expected = "Joe";
            var list = new[] { "Michael", previous, expected };

            //Act
            var result = list.NextElement(previous);

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