예제 #1
0
        public void ShouldCalculateSumOfsingleValueInaString(string input, int output)
        {
            _stringCalculator = new StringCalculator(input);
            var sumOfValuesOFThestring = _stringCalculator.GetTheCalculatedValue();

            Assert.That(sumOfValuesOFThestring, Is.EqualTo(output));
        }
예제 #2
0
        public void ShouldNotAllowNumberBiggerThanThousandAndWithManyDelemiters(string input)
        {
            _stringCalculator = new StringCalculator(input);

            var sumOfValueInAString = _stringCalculator.GetTheCalculatedValue();
            Assert.That(sumOfValueInAString, Is.EqualTo(6));
        }
예제 #3
0
        public void ShouldReturnSumOfValuesInAStringStartingWithDelimeter(string input, int output)
        {
            _stringCalculator = new StringCalculator(input);

            var sumOfValueInAString = _stringCalculator.GetTheCalculatedValue();
            Assert.That(sumOfValueInAString, Is.EqualTo(output));
        }
예제 #4
0
        public void ShouldThrowAnExceptionwhenNegativeNumberIsPassed(string input)
        {
            _stringCalculator = new StringCalculator(input);

            Assert.Throws<System.NotSupportedException>(() => _stringCalculator.GetTheCalculatedValue());
        }