public void CalculateTest(double firstArgument, double expectedResult)
        {
            var calculator   = new SquareRootCalculator();
            var actualResult = calculator.Calculate(firstArgument);

            Assert.AreEqual(expectedResult, actualResult, 0.001);
        }
Exemplo n.º 2
0
        public void SquareRootCalculatorTest()
        {
            var    calculator = new SquareRootCalculator();
            double actual     = calculator.Calculate(4);

            Assert.AreEqual(2, actual);
        }
        public void ExceptionTest()
        {
            var calculator = new SquareRootCalculator();

            Assert.Throws <Exception>(() => calculator.Calculate(-23));
        }
Exemplo n.º 4
0
        public void NegativeSquareRootCalculatorTest()
        {
            var calculator = new SquareRootCalculator();

            Assert.Throws <Exception>(() => calculator.Calculate(-4));
        }