Exemplo n.º 1
0
        public void Subtract_NonNumber_ShouldThrowExeption(string inputString)
        {
            var sut = new StringCalculator();

            Action result = () => sut.Subtract(inputString);

            result.Should().Throw <ArgumentException>();
        }
Exemplo n.º 2
0
        public void Subtract_ValidNumbers_CorrectDifference(string inputString, decimal expectedResult)
        {
            var sut = new StringCalculator();

            var result = sut.Subtract(inputString);

            result.Should().Be(expectedResult);
        }
        public void Test_CalculatorServiceStretch05_Subtract(string caclString, double expected)
        {
            // Arrange

            var svc  = new CalculatorServiceReq08();
            var calc = new StringCalculator(svc);

            // Act

            var actual = calc.Subtract(caclString);

            // Assert

            Assert.AreEqual(actual, expected, 0.001, "calc");
        }