Example #1
0
        public void TestInvertEmpty()
        {
            var vector        = new MathVector(new List <double>());
            var assumedVector = new MathVector(new List <double>());

            var resultVector = (MathVector)vector.Invert();

            Assert.IsTrue(assumedVector.Equals(resultVector));
        }
Example #2
0
        public void TestInvertException()
        {
            var vector = new MathVector(new List <double>()
            {
                0,
                1
            });

            Assert.ThrowsException <DivideByZeroException>(() => vector.Invert());
        }
Example #3
0
        public void TestInvertMultiple()
        {
            var vector = new MathVector(new List <double>()
            {
                1,
                2,
                4
            });
            var assumedVector = new MathVector(new List <double>()
            {
                1,
                0.5,
                0.25
            });

            var resultVector = (MathVector)vector.Invert();

            Assert.IsTrue(assumedVector.Equals(resultVector));
        }