Abacus.DoublePrecision.Vector2Tests.TestMultiplication C# (CSharp) Method

TestMultiplication() private method

Helper method for testing multiplication.
private TestMultiplication ( System.Vector2 a, System.Vector2 b, System.Vector2 expected ) : void
a System.Vector2
b System.Vector2
expected System.Vector2
return void
        void TestMultiplication (Vector2 a, Vector2 b, Vector2 expected )
        {
            // This test asserts the following:
            //   a * b == expected
            //   b * a == expected

            var result_1a = a * b;
            var result_2a = b * a;

            Vector2 result_1b; Vector2.Multiply(ref a, ref b, out result_1b);
            Vector2 result_2b; Vector2.Multiply(ref b, ref a, out result_2b);

            Assert.That(result_1a, Is.EqualTo(expected));
            Assert.That(result_2a, Is.EqualTo(expected));
            Assert.That(result_1b, Is.EqualTo(expected));
            Assert.That(result_2b, Is.EqualTo(expected));
        }
Vector2Tests