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_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_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 RootSeacherTest3() { double actual = RootCalculator.FindNthRoot(0.0279936, 7, 0.0001); double expected = 0.6; Assert.IsTrue(Math.Abs(expected - actual) < 0.0001); }
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 RootSeacherTest4() { double actual = RootCalculator.FindNthRoot(-0.008, 3, 0.1); double expected = -0.2; Assert.IsTrue(Math.Abs(expected - actual) < 0.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_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_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 RootSeacherTest5() { double actual = RootCalculator.FindNthRoot(0.004241979, 9, 0.00000001); double expected = 0.545; Assert.IsTrue(Math.Abs(expected - actual) < 0.00000001); }
public void RootSeacherTest6() { double actual = RootCalculator.FindNthRoot(0.04100625, 4, 0.0001); double expected = 0.45; Assert.IsTrue(Math.Abs(expected - actual) < 0.0001); }
public void RootSeacherTest1() { double actual = RootCalculator.FindNthRoot(1, 5, 0.0001); double expected = 1; Assert.IsTrue(Math.Abs(expected - actual) < 0.0001); }
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 RootSeacherTest7() { try { double actual = RootCalculator.FindNthRoot(0.04100625, 4, -7); Assert.Fail("No Exception("); } catch (Exception ex) { Assert.IsTrue(ex is ArgumentOutOfRangeException); } }
static void Main(string[] args) { Console.WriteLine(IntMerger.IntMerger.Merge(8, 15, 3, 8)); long time; Console.WriteLine(BiggerNubmerSearcher.BiggerNubmerSearcher.FindNextBiggerNumber (1234321, out time)); RootCalculator.FindNthRoot(0.004241979, 9, 0.00000001); Console.ReadLine(); }
public void CalculateQuadraticEquationRoots_ExampleWithFirstValueZero_ExpectedException(double firstValue, double secondValue, double thirdValue) { RootCalculator rc = new RootCalculator(firstValue, secondValue, thirdValue); Assert.Throws <Exception>(() => rc.RootCalculate()); }
public void CalculateQuadraticEquationRoots_RootCalculateMethodNotUsed_ExpectedRootCountZero(double firstValue, double secondValue, double thirdValue) { RootCalculator rc = new RootCalculator(firstValue, secondValue, thirdValue); Assert.AreEqual(rc.Roots.Count, 0); }
public void CalculateQuadraticEquationRoots_RootCalculateMethodNotUsed_ExpectedMessage(double firstValue, double secondValue, double thirdValue, string message) { RootCalculator rc = new RootCalculator(firstValue, secondValue, thirdValue); Assert.AreEqual(rc.ToString(), message); }
public void CalculateQuadraticEquationRoots_RootCalculateMethodNotUsed_ExpectedNanDelta(double firstValue, double secondValue, double thirdValue) { RootCalculator rc = new RootCalculator(firstValue, secondValue, thirdValue); Assert.AreEqual(rc.Delta, Double.NaN); }