Exemplo n.º 1
0
        public void Phase_TestCaseData_ResultOfBenchmarkImplementation(Complex z)
        {
            double actual = z.Phase;

            double expected = ComplexNumber.Create(z.Real, z.Imaginary).Argument;

            Assert.That(actual, Is.EqualTo(expected).Within(1E-9));
        }
Exemplo n.º 2
0
        public void OperatorMultiplication_TestCaseData_ResultOfBenchmarkImplementation(Complex a, Complex b)
        {
            Complex actual = a * b;

            ComplexNumber expected = ComplexNumber.Create(a.Real, a.Imaginary) * ComplexNumber.Create(b.Real, b.Imaginary);

            Assert.That(actual.Real, Is.EqualTo(expected.RealPart).Within(1E-9));
            Assert.That(actual.Imaginary, Is.EqualTo(expected.ImaginaryPart).Within(1E-9));
        }