public void Add_GivenAnEmptyOrNullNumber_ShouldReturn0(string numbers)
        {
            //Arrange
            var sut = new StringCalculator();

            //Act
            var actual = sut.Add(numbers);

            //Assert
            int expected = 0;

            Assert.AreEqual(expected, actual);
        }
예제 #2
0
        public void kataProblem4(string numbers, int expectedResult)
        {
            int result = StringCalculator.Add(numbers);

            Assert.AreEqual(expectedResult, result);
        }
        public void EmptyString_ShouldReturnZero()
        {
            int sum = calculator.Add(String.Empty);

            Assert.That(sum, Is.EqualTo(0));
        }
예제 #4
0
        public void Add_UnknownNumbers_With_various_Seperator(string numbers, int expectedResult)
        {
            int result = StringCalculator.Add(numbers);

            Assert.AreEqual(expectedResult, result);
        }
예제 #5
0
        [TestCase("1, ,2", 3)]  //needs to ahve something inside
        public void Add_TwoNumbers_ReturnSum(string numbers, int expectedResult)
        {
            int result = StringCalculator.Add(numbers);

            Assert.AreEqual(expectedResult, result);
        }
예제 #6
0
        [TestCase("c", 44)] //parses c into ascii number
        public void Add_OneNumber_ReturnSelf(string blah, int expectedResult)
        {
            int result = StringCalculator.Add(blah);

            Assert.AreEqual(expectedResult, result);
        }
예제 #7
0
        public void Add_EmptyString_ReturnZero()
        {
            int result = _stringCalculator.Add("");

            Assert.AreEqual(0, result);
        }
 public void EmptyStringInputReturnsZero()
 {
     Assert.AreEqual(0, calculator.Add(""));
 }