Exemplo n.º 1
0
        public void ImplementsINumberArrayTotaler()
        {
            // Arrange
            var totaler = new NumberArrayTotaler();

            // Act

            // Assert
            Assert.IsTrue(totaler is INumberArrayTotaler);
        }
Exemplo n.º 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);
        }
Exemplo n.º 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);
        }
Exemplo n.º 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);
        }