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

ToArrayTest1() private method

private ToArrayTest1 ( ) : void
return void
        public void ToArrayTest1()
        {
            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 =
            {
                new double[] {  4.20,  42, 1 },
                new double[] { -3.14, -17, 0 },
                new double[] { 21.00,   0, 0 },
            };

            double[][] actual = table.ToArray();

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


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

            table.ToArray(out actualNames);

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