Esempio n. 1
0
        // Test Operator: Equality //-----------------------------------------//

        /// <summary>
        /// Helper method for testing equality.
        /// </summary>
        void TestEquality (Matrix44 a, Matrix44 b, Boolean expected )
        {
            // This test asserts the following:
            //   (a == b) == expected
            //   (b == a) == expected
            //   (a != b) == !expected
            //   (b != a) == !expected

            Boolean result_1a = (a == b);
            Boolean result_1b = (a.Equals(b));
            Boolean result_1c = (a.Equals((Object)b));

            Boolean result_2a = (b == a);
            Boolean result_2b = (b.Equals(a));
            Boolean result_2c = (b.Equals((Object)a));

            Boolean result_3a = (a != b);
            Boolean result_4a = (b != a);

            Assert.That(result_1a, Is.EqualTo(expected));
            Assert.That(result_1b, Is.EqualTo(expected));
            Assert.That(result_1c, Is.EqualTo(expected));
            Assert.That(result_2a, Is.EqualTo(expected));
            Assert.That(result_2b, Is.EqualTo(expected));
            Assert.That(result_2c, Is.EqualTo(expected));
            Assert.That(result_3a, Is.EqualTo(!expected));
            Assert.That(result_4a, Is.EqualTo(!expected));
        }