public void CalculateQuadraticEquationRoots_ExampleWithDeltaEqualsZero_DelatEqualsZero(double firstValue, double secondValue, double thirdValue) { RootCalculator rc = new RootCalculator(firstValue, secondValue, thirdValue); rc.RootCalculate(); Assert.AreEqual(rc.Delta, 0); }
public void CalculateQuadraticEquationRoots_ExampleWithDeltaLowerThanZero_ExpectedMessageForZeroRoots(double firstValue, double secondValue, double thirdValue, string message) { RootCalculator rc = new RootCalculator(firstValue, secondValue, thirdValue); rc.RootCalculate(); Assert.AreEqual(rc.ToString(), message); }
public void CalculateQuadraticEquationRoots_NegativeFirstPositiveThirdValue_TwoRootsExpected(double firstValue, double secondValue, double thirdValue) { RootCalculator rc = new RootCalculator(firstValue, secondValue, thirdValue); rc.RootCalculate(); Assert.AreEqual(rc.Roots.Count, 2); }
public void CalculateQuadraticEquationRoots_DeltaEqualsZero_OneRoot(double firstValue, double secondValue, double thirdValue) { RootCalculator rc = new RootCalculator(firstValue, secondValue, thirdValue); rc.RootCalculate(); Assert.AreEqual(rc.Roots.Count, 1); }
public void CalculateQuadraticEquationRoots_NegativeFirstPositiveThirdValue_DeltaAlwaysHigherThanZero(double firstValue, double secondValue, double thirdValue) { RootCalculator rc = new RootCalculator(firstValue, secondValue, thirdValue); rc.RootCalculate(); Assert.Greater(rc.Delta, 0); }
public void CalculateQuadraticEquationRoots_DeltaHigherThanZero_TwoRootsExpected(double firstValue, double secondValue, double thirdValue) { RootCalculator rc = new RootCalculator(firstValue, secondValue, thirdValue); rc.RootCalculate(); Assert.AreEqual(rc.Roots.Count, 2); }
public void CalculateQuadraticEquationRoots_ExampleWithDeltaLowerThanZero_ExpectedZeroRoots(double firstValue, double secondValue, double thirdValue) { RootCalculator rc = new RootCalculator(firstValue, secondValue, thirdValue); rc.RootCalculate(); Assert.AreEqual(rc.Roots.Count, 0); }
public void CalculateQuadraticEquationRoots_ExampleWithDeltaLowerThanZero_ExpectedDeltaLowerthanZero(double firstValue, double secondValue, double thirdValue) { RootCalculator rc = new RootCalculator(firstValue, secondValue, thirdValue); rc.RootCalculate(); Assert.Less(rc.Delta, 0); }
public void CalculateQuadraticEquationRoots_ExampleWithFirstValueZero_ExpectedException(double firstValue, double secondValue, double thirdValue) { RootCalculator rc = new RootCalculator(firstValue, secondValue, thirdValue); Assert.Throws <Exception>(() => rc.RootCalculate()); }