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); } }
public void RooterTestNegativeInputx() { Rooter rooter = new Rooter(); try { rooter.SquareRoot(-10); } catch (ArgumentOutOfRangeException e) { return; } Assert.Fail(); }
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); }