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); }
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); }
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); }