Exemple #1
0
        public void ArrayToTable()
        {
            Point[] ps = new Point[] {
                new Point {
                    x = 11, y = 12
                },
                new Point {
                    x = 21, y = 22
                },
                new Point {
                    x = 31, y = 32
                }
            };

            // Tests converting an array of structs into a table
            MutableDataTable dt = DataTable.New.FromEnumerable(ps);


            StringWriter sw = new StringWriter();

            dt.SaveToStream(sw);
            AnalyzeTests.AssertEquals(
                @"x,y
11,12
21,22
31,32
", sw.ToString());
        }