示例#1
0
        public void returnsSum4GivenTwoNum(string input)
        {
            // Arrange
            var s = new StringCalc();

            // Act
            int output = s.Add(input);

            // Assert
            Assert.Equal(4, output);
        }
示例#2
0
        public void returnsNumGivenOneNum(string input)
        {
            // Arrange
            var s = new StringCalc();

            // Act
            int output = s.Add(input);

            // Assert
            Assert.Equal(int.Parse(input), output);
        }
示例#3
0
        public void returnsSumGivenAnyNumNum3()
        {
            // Arrange
            String input = "3,1,2,5";
            var    s     = new StringCalc();

            // Act
            int output = s.Add(input);

            // Assert
            Assert.Equal(11, output);
        }
示例#4
0
        public void returns0GivenEmpty()
        {
            // Arrange
            String input = "";
            var    s     = new StringCalc();

            // Act
            int output = s.Add(input);

            // Assert
            Assert.Equal(0, output);
        }
示例#5
0
        public void returnsSumGivenTwoNum()
        {
            // Arrange
            String input = "18,3";
            var    s     = new StringCalc();

            // Act
            int output = s.Add(input);

            // Assert
            Assert.Equal(21, output);
        }
示例#6
0
        public void returnsSumGivenAnyNumsDeliminatedByNewLine()
        {
            // Arrange
            String input = "3\n1\n2\n5";
            var    s     = new StringCalc();

            // Act
            int output = s.Add(input);

            // Assert
            Assert.Equal(11, output);
        }