예제 #1
0
        public void SingleNumberReturnsSum()
        {
            Calculator calc = new Calculator();
            int result = calc.Add("3");

            Assert.AreEqual(3, result);
        }
예제 #2
0
        public void EmptyStringReturnsZero()
        {
            Calculator calc = new Calculator();
            int result = calc.Add("");

            Assert.AreEqual(0, result);
        }
예제 #3
0
        public void TwoNumbersReturnsSum(string input, int expectedResult)
        {
            //Arrange
            Calculator calc = new Calculator();

            //Act
            int result = calc.Add(input);

            //Assert
            Assert.AreEqual(expectedResult, result);
        }
예제 #4
0
 public void NewLinesBetweenNums()
 {
     Calculator calc = new Calculator();
     int result = calc.Add("1\n2,3");
     Assert.AreEqual(6, result);
 }