Esempio n. 1
0
        public void SingleNumberReturnsSum()
        {
            Calculator calc = new Calculator();
            int result = calc.Add("3");

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

            Assert.AreEqual(0, result);
        }
Esempio n. 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);
        }
Esempio n. 4
0
 public void NewLinesBetweenNums()
 {
     Calculator calc = new Calculator();
     int result = calc.Add("1\n2,3");
     Assert.AreEqual(6, result);
 }