public void EqualsTests(bool expected, double[] a1, double[] a2) { PolynomialLib.Polynomial polynomial1 = new PolynomialLib.Polynomial(a1); PolynomialLib.Polynomial polynomial2 = new PolynomialLib.Polynomial(a2); Assert.AreEqual(expected, polynomial1.Equals(polynomial2)); }
public void DoestNotEqualOperatorTests(bool expected, double[] a1, double[] a2) { PolynomialLib.Polynomial polynomial1 = new PolynomialLib.Polynomial(a1); PolynomialLib.Polynomial polynomial2 = new PolynomialLib.Polynomial(a2); Assert.AreEqual(expected, polynomial1 != polynomial2); }
public void PlusOperatorTests(double[] expected, double[] a1, double[] a2) { PolynomialLib.Polynomial polynomial1 = new PolynomialLib.Polynomial(a1); PolynomialLib.Polynomial polynomial2 = new PolynomialLib.Polynomial(a2); PolynomialLib.Polynomial polynomial3 = polynomial1 + polynomial2; PolynomialLib.Polynomial expectedP = new PolynomialLib.Polynomial(expected); Assert.AreEqual(expectedP, polynomial3); }
public void MultiplyOperatorTests(double[] expected, double[] a1, double[] a2) { PolynomialLib.Polynomial polynomial1 = new PolynomialLib.Polynomial(a1); PolynomialLib.Polynomial polynomial2 = new PolynomialLib.Polynomial(a2); PolynomialLib.Polynomial polynomial3 = polynomial1 * polynomial2; for (int i = 0; i < expected.Length; i++) { Assert.AreEqual(expected[i], polynomial3.PolynomialValue[i]); } }
public void ToStringTests(string expected, double[] a1) { PolynomialLib.Polynomial polynomial1 = new PolynomialLib.Polynomial(a1); Assert.AreEqual(expected, polynomial1.ToString()); }