示例#1
0
        public void RooterValueRange()
        {
            //instance to test
            Rooter rooter = new Rooter();

            //range of values
            for (double expectedResult = 1e-8; expectedResult < 1e+8; expectedResult = expectedResult * 3.2)
            {
                RooterOneValue(rooter, expectedResult);
            }
        }
示例#2
0
        public void RooterTestNegativeInputx()
        {
            Rooter rooter = new Rooter();

            try
            {
                rooter.SquareRoot(-10);
            }
            catch (ArgumentOutOfRangeException e)
            {
                return;
            }
            Assert.Fail();
        }
示例#3
0
        public void BasicRooterTest()
        {
            //instance to test
            Rooter rooter = new Rooter();

            //initialize test variable
            double expectedResult = 2.0;

            double input = expectedResult * expectedResult;

            //run method under test
            double actualResult = rooter.SquareRoot(input);

            // Verify the result:
            Assert.AreEqual(expectedResult, actualResult,
                            delta: expectedResult / 100);
        }