public void CalculateSquareEquation_CheckDeltaAndDenominatorValue_DeltaAndDenominatorCaluculatedProperly(double firtsValue, double secondValue, double thirdValue) { SquareEquationCalculator sec = new SquareEquationCalculator(); sec.CalculateSquareEquation(firtsValue, secondValue, thirdValue); Assert.AreEqual(-8, sec.delta); Assert.AreEqual(2, sec.denominator); }
public void CalculateSquareEquation_PositiveFirstValueAndNegativeThirdValue_DeltaHigherThanZero(double firtsValue, double secondValue, double thirdValue) { SquareEquationCalculator sec = new SquareEquationCalculator(); sec.CalculateSquareEquation(firtsValue, secondValue, thirdValue); double resultDelta = sec.delta; Assert.Greater(resultDelta, 0); }
public void CalculateSquareEquation_PositiveFirstValueAndNegativeThirdValue_AmountOfRootsEqualToTwo(double firtsValue, double secondValue, double thirdValue, int expectedAmountOfRoots) { SquareEquationCalculator sec = new SquareEquationCalculator(); sec.CalculateSquareEquation(firtsValue, secondValue, thirdValue); int resultRootCounter = sec.rootCounter; Assert.AreEqual(expectedAmountOfRoots, resultRootCounter); }
public void CalculateSquareEquation_PositiveFirstValueAndNegativeThirdValue_ValidMessageAboutRoots(double firtsValue, double secondValue, double thirdValue, string expectedMessageText) { SquareEquationCalculator sec = new SquareEquationCalculator(); sec.CalculateSquareEquation(firtsValue, secondValue, thirdValue); string resultMessage = sec.message; Assert.AreEqual(expectedMessageText, resultMessage); }
public void CalculateSquareEquation_FirstValueEqualZero_DenominatorEqualToZero(double firtsValue, double secondValue, double thirdValue, double expectedDenominatorValue) { SquareEquationCalculator sec = new SquareEquationCalculator(); sec.CalculateSquareEquation(firtsValue, secondValue, thirdValue); double resultMessage = sec.denominator; Assert.AreEqual(expectedDenominatorValue, resultMessage); }
public void CalculateSquareEquation_FirstValueEqualZero_MessageAboutException(double firtsValue, double secondValue, double thirdValue, string expectedMessageText) { SquareEquationCalculator sec = new SquareEquationCalculator(); sec.CalculateSquareEquation(firtsValue, secondValue, thirdValue); string resultMessage = sec.message; Assert.AreEqual(expectedMessageText, resultMessage); }
public void CalculateSquareEquation_ExampleWithDeltaLowerThanZero_DeltaLowerThanZero(double firstValue, double secondValue, double thirdValue) { SquareEquationCalculator sec = new SquareEquationCalculator(); sec.CalculateSquareEquation(firstValue, secondValue, thirdValue); double resultDelta = sec.delta; Assert.Less(resultDelta, 0); }
public void CalculateSquareEquation_ExampleWithDeltaLowerThanZero_AmountOfRootsEqualToZero(double firstValue, double secondValue, double thirdValue, int expectedRootsAmount) { SquareEquationCalculator sec = new SquareEquationCalculator(); sec.CalculateSquareEquation(firstValue, secondValue, thirdValue); int resultRootCounter = sec.rootCounter; Assert.AreEqual(expectedRootsAmount, resultRootCounter); }
public void CalculateSquareEquation_ExampleWithDeltaLowerThanZero_ValidMessageAboutRoots(double firstValue, double secondValue, double thirdValue, string expectedMessage) { SquareEquationCalculator sec = new SquareEquationCalculator(); sec.CalculateSquareEquation(firstValue, secondValue, thirdValue); string resultMessage = sec.message; Assert.AreEqual(expectedMessage, resultMessage); }
public void CalculateSquareEquation_ExampleWithDeltaEqualToZero_DeltaEqualToZero(double firstValue, double secondValue, double thirdValue, double expectedDelta) { SquareEquationCalculator sec = new SquareEquationCalculator(); sec.CalculateSquareEquation(firstValue, secondValue, thirdValue); double resultDelta = sec.delta; Assert.AreEqual(expectedDelta, resultDelta); }
public void CalculateSquareEquation_ExampleForDeltaEqualToZero_ValidMessageAboutRoots(double firstValue, double secondValue, double thirdValue, string expectedMessageText) { SquareEquationCalculator sec = new SquareEquationCalculator(); sec.CalculateSquareEquation(firstValue, secondValue, thirdValue); string resultMessageText = sec.message; Assert.AreEqual(expectedMessageText, resultMessageText); }