Exemple #1
0
        public void ExecuteEmptyVectorTest()
        {
            var vector = new Vector(2);
            var exp    = new Transpose(vector);

            Assert.Throws <ArgumentException>(() => exp.Execute());
        }
Exemple #2
0
        public void ExecuteEmptyMatrixTest()
        {
            var matrix = new Matrix(2, 2);
            var exp    = new Transpose(matrix);

            Assert.Throws <ArgumentException>(() => exp.Execute());
        }
Exemple #3
0
        public void ExecuteVectorTest()
        {
            var vector = new Vector(new[] { new Number(1), new Number(2) });

            var expected = new Matrix(new[]
            {
                new Vector(new[] { new Number(1) }),
                new Vector(new[] { new Number(2) })
            });
            var exp = new Transpose(vector);

            Assert.Equal(expected, exp.Execute());
        }
Exemple #4
0
        public void ExecuteMatrixTest()
        {
            var matrix = new Matrix(new[]
            {
                new Vector(new[] { new Number(1), new Number(2) }),
                new Vector(new[] { new Number(3), new Number(4) }),
                new Vector(new[] { new Number(5), new Number(6) })
            });

            var expected = new Matrix(new[]
            {
                new Vector(new[] { new Number(1), new Number(3), new Number(5) }),
                new Vector(new[] { new Number(2), new Number(4), new Number(6) })
            });
            var exp = new Transpose(matrix);

            Assert.Equal(expected, exp.Execute());
        }