public void FindRoot_Throws() { bisection = new Bisection(x => x); bisection.Lower = 1.01; bisection.Upper = 2; bisection.MaxIterations = 100; Assert.Throws <Exception>(() => bisection.FindRoot()); }
public void FindRoot_Is1() { bisection = new Bisection(x => x - 1); bisection.Lower = -1; bisection.Upper = 1; bisection.MaxIterations = 100; var root = bisection.FindRoot(); Assert.That(root, Is.EqualTo(1.0).Within(0.00001)); }
public void SetUp() { bisection = new Bisection(x => x); }