private void RooterOneValue(Rooter rooter, double expectedResult) { double input = expectedResult * expectedResult; double actualResult = rooter.SquareRoot(input); Assert.AreEqual(expectedResult, actualResult, delta: expectedResult / 100); }
public void BasicRooterTest() { Rooter rooter = new Rooter(); double expectedResult = 2.0; double input = expectedResult * expectedResult; double actualResult = rooter.SquareRoot(input); Assert.AreEqual(expectedResult, actualResult, delta: expectedResult / 100); }
public void BasicRooterTest() { //Create an instance to test Rooter rooter = new Rooter(); //Define a test input and ouput value double expectedResult = 2.0; double input = expectedResult * expectedResult; //Run the method under test double actualResult = rooter.SquareRoot(input); //Verify the reslt Assert.AreEqual(expectedResult, actualResult, delta: expectedResult / 100); }
public void RooterTestNegativeInputx() { Rooter rooter = new Rooter(); try { rooter.SquareRoot(-10); } catch (ArgumentOutOfRangeException e) { return; } Assert.Fail(); }