public void Sin_ErrorForm_ValidCases(double point, double error) { // Arrange var expected = Math.Sin(point); // Act var actual = Maclaurin.Sin(point, error); // Assert Assert.IsTrue(Math.Abs(expected - actual) < error); }
public void Cos_TermsForm_ValidCases(double point, int terms, double expectedError) { // Arrange var expected = Math.Cos(point); // Act var actual = Maclaurin.Cos(point, terms); // Assert Assert.IsTrue(Math.Abs(expected - actual) < expectedError); }
public void Exp_ErrorForm_InvalidCases(double error) => Assert.Throws <ArgumentException>(() => Maclaurin.Exp(0.0, error));
public void Cos_TermsForm_InvalidCase() => Assert.Throws <ArgumentOutOfRangeException>(() => Maclaurin.Cos(0, -1));