Ejemplo n.º 1
0
        public void RelativeVector4Constructor()
        {
            tlog.Debug(tag, $"RelativeVector4Constructor START");

            var testingTarget = new RelativeVector4();

            Assert.IsNotNull(testingTarget, "Can't create success object RelativeVector4");
            Assert.IsInstanceOf <RelativeVector4>(testingTarget, "Should return Vector4 instance.");

            testingTarget.Dispose();
            tlog.Debug(tag, $"RelativeVector4Constructor END (OK)");
        }
Ejemplo n.º 2
0
        public void RelativeVector4GetW()
        {
            tlog.Debug(tag, $"RelativeVector4GetW START");

            var testingTarget = new RelativeVector4(0.5f, 0.6f, 0.7f, 0.8f);

            Assert.IsNotNull(testingTarget, "Can't create success object RelativeVector4");
            Assert.IsInstanceOf <RelativeVector4>(testingTarget, "Should return Vector4 instance.");

            testingTarget.W = 1.0f;
            Assert.AreEqual(1.0f, testingTarget.W, "Should be equal!");

            testingTarget.Dispose();
            tlog.Debug(tag, $"RelativeVector4GetW END (OK)");
        }
Ejemplo n.º 3
0
        public void RelativeVector4GetHashCode()
        {
            tlog.Debug(tag, $"RelativeVector4GetHashCode START");

            var testingTarget = new RelativeVector4(10.0f, 20.0f, 30.0f, 40.0f);

            Assert.IsNotNull(testingTarget, "Can't create success object RelativeVector4");
            Assert.IsInstanceOf <RelativeVector4>(testingTarget, "Should be an instance of RelativeVector4 type.");

            var result = testingTarget.GetHashCode();

            Assert.IsTrue(result >= Int32.MinValue && result <= Int32.MaxValue, "The value of hash is out of Integer range");

            testingTarget.Dispose();
            tlog.Debug(tag, $"RelativeVector4GetHashCode END (OK)");
        }
Ejemplo n.º 4
0
        public void RelativeVector4ConstructorWithFloat()
        {
            tlog.Debug(tag, $"RelativeVector4ConstructorWithFloat START");

            var testingTarget = new RelativeVector4(0.5f, 0.6f, 0.7f, 0.8f);

            Assert.IsNotNull(testingTarget, "Can't create success object RelativeVector4");
            Assert.IsInstanceOf <RelativeVector4>(testingTarget, "Should return Vector4 instance.");

            Assert.AreEqual(0.5f, testingTarget.X, "Retrieved vector.X should be equal to set value");
            Assert.AreEqual(0.6f, testingTarget.Y, "Retrieved vector.Y should be equal to set value");
            Assert.AreEqual(0.7f, testingTarget.Z, "Retrieved vector.Z should be equal to set value");
            Assert.AreEqual(0.8f, testingTarget.W, "Retrieved vector.W should be equal to set value");

            testingTarget.Dispose();
            tlog.Debug(tag, $"RelativeVector4ConstructorWithFloat END (OK)");
        }
Ejemplo n.º 5
0
        public void RelativeVector4NotEqualTo()
        {
            tlog.Debug(tag, $"RelativeVector4NotEqualTo START");

            var testingTarget = new RelativeVector4(1.0f, 0.5f, 0.4f, 0.3f);

            Assert.IsNotNull(testingTarget, "Can't create success object RelativeVector4");
            Assert.IsInstanceOf <RelativeVector4>(testingTarget, "Should return Vector4 instance.");

            using (RelativeVector4 vector = new RelativeVector4(1.0f, 0.5f, 0.6f, 0.7f))
            {
                Assert.IsTrue((testingTarget.NotEqualTo(vector)), "Should be equal");
            }

            testingTarget.Dispose();
            tlog.Debug(tag, $"RelativeVector4NotEqualTo END (OK)");
        }
Ejemplo n.º 6
0
        public void RelativeVector4GetVauleBySubscriptIndex()
        {
            tlog.Debug(tag, $"RelativeVector4GetVauleBySubscriptIndex START");

            var testingTarget = new RelativeVector4(0.5f, 0.6f, 0.7f, 0.8f);

            Assert.IsNotNull(testingTarget, "Can't create success object RelativeVector4");
            Assert.IsInstanceOf <RelativeVector4>(testingTarget, "Should return Vector4 instance.");

            Assert.AreEqual(0.5f, testingTarget[0], "this[0] should return 100.0f");
            Assert.AreEqual(0.6f, testingTarget[1], "this[1] should return 200.0f");
            Assert.AreEqual(0.7f, testingTarget[2], "this[2] should return 300.0f");
            Assert.AreEqual(0.8f, testingTarget[3], "this[3] should return 400.0f");

            testingTarget.Dispose();
            tlog.Debug(tag, $"RelativeVector4GetVauleBySubscriptIndex END (OK)");
        }
Ejemplo n.º 7
0
        public void KeyValueRelativeVector4Value()
        {
            tlog.Debug(tag, $"KeyValueRelativeVector4Value START");

            RelativeVector4 b1 = new RelativeVector4(0, 0, 0, 0);
            KeyValue        a1 = new KeyValue
            {
                RelativeVector4Value = b1
            };

            b1 = a1.RelativeVector4Value;

            b1.Dispose();
            a1.Dispose();
            tlog.Debug(tag, $"KeyValueRelativeVector4Value END (OK)");
            Assert.Pass("KeyValueRelativeVector4Value");
        }
Ejemplo n.º 8
0
        public void RelativeVector4ImplicitToRelativeVector4()
        {
            tlog.Debug(tag, $"RelativeVector4ImplicitToRelativeVector4 START");

            RelativeVector4 testingTarget = null;

            using (Vector4 vector = new Vector4(0.5f, 0.6f, 0.7f, 0.8f))
            {
                testingTarget = vector;
                Assert.AreEqual(testingTarget.X, vector.X, "The value of X is not correct.");
                Assert.AreEqual(testingTarget.Y, vector.Y, "The value of Y is not correct.");
                Assert.AreEqual(testingTarget.Z, vector.Z, "The value of Z is not correct.");
                Assert.AreEqual(testingTarget.W, vector.W, "The value of W is not correct.");
            }

            testingTarget.Dispose();
            tlog.Debug(tag, $"RelativeVector4ImplicitToRelativeVector4 END (OK)");
        }
Ejemplo n.º 9
0
        public void RelativeVector4Equals()
        {
            tlog.Debug(tag, $"RelativeVector4Equals START");

            var testingTarget = new RelativeVector4(0.02f, 0.02f, 0.02f, 0.02f);

            Assert.IsNotNull(testingTarget, "Can't create success object RelativeVector4");
            Assert.IsInstanceOf <RelativeVector4>(testingTarget, "Should return Vector4 instance.");

            using (RelativeVector4 vector = new RelativeVector4(0.02f, 0.02f, 0.02f, 0.02f))
            {
                var result = testingTarget.Equals(vector);
                Assert.IsTrue(result, "Should be true here!");
            }

            testingTarget.Dispose();
            tlog.Debug(tag, $"RelativeVector4Equals END (OK)");
        }
Ejemplo n.º 10
0
        public void RelativeVector4DivisionByFloat()
        {
            tlog.Debug(tag, $"RelativeVector4DivisionByFloat START");

            var testingTarget = new RelativeVector4(0.5f, 0.6f, 0.7f, 0.8f);

            Assert.IsNotNull(testingTarget, "Can't create success object RelativeVector4");
            Assert.IsInstanceOf <RelativeVector4>(testingTarget, "Should return Vector4 instance.");

            var result = testingTarget / 2.0f;

            Assert.Less(Math.Abs(0.25f - result.X), 0.0001f, "The X of the vector is not correct here!");
            Assert.Less(Math.Abs(0.3f - result.Y), 0.0001f, "The Y of the vector is not correct here!");
            Assert.Less(Math.Abs(0.35f - result.Z), 0.0001f, "The Z of the vector is not correct here!");
            Assert.Less(Math.Abs(0.4f - result.W), 0.0001f, "The W of the vector is not correct here!");

            testingTarget.Dispose();
            tlog.Debug(tag, $"RelativeVector4DivisionByFloat END (OK)");
        }
Ejemplo n.º 11
0
        public void RelativeVector4Dispose()
        {
            tlog.Debug(tag, $"RelativeVector4Dispose START");

            var testingTarget = new RelativeVector4(10.0f, 20.0f, 30.0f, 40.0f);

            Assert.IsNotNull(testingTarget, "Can't create success object RelativeVector4");
            Assert.IsInstanceOf <RelativeVector4>(testingTarget, "Should return Vector4 instance.");

            try
            {
                testingTarget.Dispose();
            }
            catch (Exception e)
            {
                Assert.Fail("Caught Exception" + e.ToString());
            }

            tlog.Debug(tag, $"RelativeVector4Dispose END (OK)");
        }
Ejemplo n.º 12
0
        public void RelativeVector4MultiplyByRelativeVector4()
        {
            tlog.Debug(tag, $"RelativeVector4MultiplyByRelativeVector4 START");

            var testingTarget = new RelativeVector4(0.5f, 0.6f, 0.7f, 0.8f);

            Assert.IsNotNull(testingTarget, "Can't create success object RelativeVector4");
            Assert.IsInstanceOf <RelativeVector4>(testingTarget, "Should return Vector4 instance.");

            using (RelativeVector4 vector = new RelativeVector4(0.4f, 0.3f, 0.2f, 0.1f))
            {
                var result = testingTarget * vector;
                Assert.Less(Math.Abs(0.2f - result.X), 0.0001f, "The X of the vector is not correct here!");
                Assert.Less(Math.Abs(0.18f - result.Y), 0.0001f, "The Y of the vector is not correct here!");
                Assert.Less(Math.Abs(0.14f - result.Z), 0.0001f, "The Z of the vector is not correct here!");
                Assert.Less(Math.Abs(0.08f - result.W), 0.0001f, "The W of the vector is not correct here!");
            }

            testingTarget.Dispose();
            tlog.Debug(tag, $"RelativeVector4MultiplyByRelativeVector4 END (OK)");
        }