public void Addition_return_correct_result() { var expected = new Complex(-2, 2.5); ComplexTestUtils.AssertAreEqual(expected, _c1 + _c2); ComplexTestUtils.AssertAreEqual(expected, Complex.Add(_c1, _c2)); }
/// <summary> /// Adds a complex number and a scalar value. /// </summary> /// /// <param name="a">A <see cref="Complex"/> instance.</param> /// <param name="s">A scalar value.</param> /// /// <returns>Returns new <see cref="Complex"/> instance containing the sum.</returns> /// public static Complex operator +(double s, Complex a) { return(Complex.Add(a, s)); }
/// <summary> /// Adds two complex numbers. /// </summary> /// /// <param name="a">A <see cref="Complex"/> instance.</param> /// <param name="b">A <see cref="Complex"/> instance.</param> /// /// <returns>Returns new <see cref="Complex"/> instance containing the sum.</returns> /// public static Complex operator +(Complex a, Complex b) { return(Complex.Add(a, b)); }