Exemple #1
0
            public void subtracting_vector_produces_diff_vector()
            {
                var left     = new Vector4F(1.0f, 15, 5, 3);
                var right    = new Vector4F(3.0f, 2, 10, 1);
                var expected = new Vector4F(-2.0f, 13, -5, 2);

                var actual = left.GetDifference(right);

                Assert.Equal(expected, actual);
            }
Exemple #2
0
            public void op_subtraction_mimics_subtract()
            {
                var left     = new Vector4F(1.0f, 2, 4, 5);
                var right    = new Vector4F(-3.0f, -100, 40, 52);
                var expected = left.GetDifference(right);

                var actual = left - right;

                Assert.Equal(expected, actual);
            }
Exemple #3
0
            public void subtracting_vectors_leaves_operands_unchanged()
            {
                var left          = new Vector4F(1.0f, 2, 3, 4);
                var expectedLeft  = new Vector4F(left);
                var right         = new Vector4F(3.0f, 4, 5, 6);
                var expectedRight = new Vector4F(right);

                var result = left.GetDifference(right);

                Assert.Equal(expectedLeft, left);
                Assert.Equal(expectedRight, right);
            }