示例#1
0
            public void adding_vector_produces_sum_vector()
            {
                var left     = new Vector4F(1.0f, 2, 10, -4);
                var right    = new Vector4F(3.0f, 4, 11, 1);
                var expected = new Vector4F(4.0f, 6, 21, -3);

                var actual = left.GetSum(right);

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

                var actual = left + right;

                Assert.Equal(expected, actual);
            }
示例#3
0
            public void adding_vectors_leaves_operands_unchanged()
            {
                var left          = new Vector4F(1.0f, 2, 10, -4);
                var expectedLeft  = new Vector4F(left);
                var right         = new Vector4F(3.0f, 4, 11, 1);
                var expectedRight = new Vector4F(right);

                var result = left.GetSum(right);

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