Accord.Tests.Math.MatrixTest.ToMatrixTest2 C# (CSharp) Method

ToMatrixTest2() private method

private ToMatrixTest2 ( ) : void
return void
        public void ToMatrixTest2()
        {
            DataTable table = new DataTable("myData");
            table.Columns.Add("Double", typeof(double));
            table.Columns.Add("Integer", typeof(int));
            table.Columns.Add("Boolean", typeof(bool));

            table.Rows.Add(4.20, 42, true);
            table.Rows.Add(-3.14, -17, false);
            table.Rows.Add(21.00, 0, false);

            double[,] expected =
            {
                {  4.20,  42, 1 },
                { -3.14, -17, 0 },
                { 21.00,   0, 0 },
            };

            double[,] actual = table.ToMatrix();

            Assert.IsTrue(expected.IsEqual(actual));


            string[] expectedNames = { "Double", "Integer", "Boolean" };
            string[] actualNames;

            table.ToMatrix(out actualNames);

            Assert.IsTrue(expectedNames.IsEqual(actualNames));
        }
MatrixTest