diff --git a/src/Managed.UnitTests/ComplexTest.cs b/src/Managed.UnitTests/ComplexTest.cs index 3291ff6f..7c9f0def 100644 --- a/src/Managed.UnitTests/ComplexTest.cs +++ b/src/Managed.UnitTests/ComplexTest.cs @@ -6,11 +6,11 @@ public class ComplexTest { [Test, MultipleAsserts] - public void CanCreateAComplexNumberUsingTheConstructor() + public void CanCreateComplexNumberUsingTheConstructor() { var complex = new Complex(1.1, -2.2); - AssertEx.That(() => complex.Real == 1.1, "Real Part"); - AssertEx.That(() => complex.Imaginary == -2.2, "Imaginary Part"); + Assert.AreEqual(complex.Real, 1.1, "Real part is 1.1"); + Assert.AreEqual(complex.Imaginary, -2.2, "Imaginary part is -2.2"); } } } \ No newline at end of file diff --git a/src/Managed/Complex.cs b/src/Managed/Complex.cs index 6e666770..966d53d4 100644 --- a/src/Managed/Complex.cs +++ b/src/Managed/Complex.cs @@ -229,7 +229,7 @@ namespace MathNet.Numerics /// true if this instance is I; otherwise, false. public bool IsI { - get { throw new NotImplementedException(); } // return Number.AlmostZero(real) && Number.AlmostEqual(imag, 1); } + get { return _real.AlmostZero() && _imag.AlmostEqual(1); } } /// @@ -239,7 +239,7 @@ namespace MathNet.Numerics /// true if this instance is NaN; otherwise, false. public bool IsNaN { - get { throw new NotImplementedException(); } // return double.IsNaN(real) || double.IsNaN(imag); } + get { return double.IsNaN(_real) || double.IsNaN(_imag); } } /// @@ -264,7 +264,7 @@ namespace MathNet.Numerics /// true if this instance is a real number; otherwise, false. public bool IsReal { - get { throw new NotImplementedException(); } // return Number.AlmostZero(imag); } + get { return _imag.AlmostZero(); } } /// @@ -275,7 +275,7 @@ namespace MathNet.Numerics /// public bool IsRealNonNegative { - get { throw new NotImplementedException(); } // return Number.AlmostZero(imag) && real >= 0; } + get { return _imag.AlmostZero() && _real >= 0; } } /// @@ -286,7 +286,7 @@ namespace MathNet.Numerics /// public bool IsImaginary { - get { throw new NotImplementedException(); } // return Number.AlmostZero(real); } + get { return _real.AlmostZero(); } } #region Static Initializers