예제 #1
0
        public void ImplementsINumberArrayTotaler()
        {
            // Arrange
            var totaler = new NumberArrayTotaler();

            // Act

            // Assert
            Assert.IsTrue(totaler is INumberArrayTotaler);
        }
예제 #2
0
        public void TotalWithEmptyArrayReturnsZero()
        {
            // Arrange
            var expected = 0;
            var totaler = new NumberArrayTotaler();

            // Act
            var actual = totaler.Total(new string[] { });

            // Assert
            Assert.AreEqual(expected, actual);
        }
예제 #3
0
        public void TotalWithArrayContainingTwoAndThreeReturnsFive()
        {
            // Arrange
            var expected = 5;
            var totaler = new NumberArrayTotaler();

            // Act
            var actual = totaler.Total(new string[] { "2", "3" });

            // Assert
            Assert.AreEqual(expected, actual);
        }
예제 #4
0
        public void TotalWithArrayContainingOneAndTwoAndThreeAndFourReturnsTen()
        {
            // Arrange
            var expected = 10;
            var totaler = new NumberArrayTotaler();

            // Act
            var actual = totaler.Total(new string[] { "1", "2", "3", "4" });

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