Beispiel #1
0
        public void TryMultiply_Vector_ReturnsVector()
        {
            var    v1 = new Vector(10, 10);
            var    v2 = v1 * 4;
            object v3;

            Assert.IsTrue(ReflectionMath.TryMultiply(v1, 4.0, out v3));
            Assert.AreEqual(v2, v3);
        }
Beispiel #2
0
        public void TryMultiply_Numbers_ReturnsVector()
        {
            object r;

            Assert.IsTrue(ReflectionMath.TryMultiply(2, 1, out r));
            Assert.AreEqual(2, r);
            Assert.IsTrue(ReflectionMath.TryMultiply(2d, 1d, out r));
            Assert.AreEqual(2, r);
            Assert.IsTrue(ReflectionMath.TryMultiply(2, 1d, out r));
            Assert.AreEqual(2, r);
            Assert.IsTrue(ReflectionMath.TryMultiply(2d, 1, out r));
            Assert.AreEqual(2, r);
        }