Exemplo n.º 1
0
        public void ShouldCalculateSumOfsingleValueInaString(string input, int output)
        {
            _stringCalculator = new StringCalculator(input);
            var sumOfValuesOFThestring = _stringCalculator.GetTheCalculatedValue();

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

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

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

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