Example #1
0
        public void Then_The_Return_Value_Is_Same_As_The_Input(string stringNumber, int expectedNumber)
        {
            var stringCalculator = new StringCalculator();

            int actual = stringCalculator.Add(stringNumber);

            Assert.That(actual, Is.EqualTo(expectedNumber));
        }
Example #2
0
        public void Then_The_Return_Value_Is_Zero()
        {
            const int expected = 0;
            var stringCalculator = new StringCalculator();

            int actual = stringCalculator.Add(string.Empty);

            Assert.That(actual, Is.EqualTo(expected));
        }
Example #3
0
 public void Then_Nagative_Not_Allowed_Expection_Is_Thrown_And_Negative_Numbers_Are_Listed(string inputString, int expectedResult)
 {
     var stringCalculator = new StringCalculator();
     int result = stringCalculator.Add(inputString);
     Assert.That(result,Is.EqualTo(expectedResult));
 }
Example #4
0
 public void Then_The_Result_Considers_Different_Delemeter(string inputString, int expectedResult)
 {
     var stringCalculator= new StringCalculator();
     int actualResult= stringCalculator.Add(inputString);
     Assert.That(actualResult, Is.EqualTo(expectedResult));
 }
Example #5
0
 public void Then_The_Result_Ignores_New_Line_Characters(string inputString, int expectedResult)
 {
     var stringCalculator = new StringCalculator();
     int actualResult = stringCalculator.Add(inputString);
     Assert.That(actualResult, Is.EqualTo(expectedResult));
 }
Example #6
0
        public void Then_The_Result_Is_Sum_Of_All_Numbers(string inputString, int resultNumber)
        {
            var stringCalculator= new StringCalculator();

            int actualResult = stringCalculator.Add(inputString);

            Assert.That(actualResult, Is.EqualTo(resultNumber));
        }