示例#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);
        }