Example #1
0
        public void AnyDataToDataTableTest()
        {
            var test = new TestClass[]{
                new TestClass(){ Int = 1, String = "Test1" },
                new TestClass(){ Int = 2, String = "Test2" },
            };

            var table = test.AnyDataToDataTable();

            Assert.AreEqual(table.Rows[0]["Int"], 1);
            Assert.AreEqual(table.Rows[0]["String"], "Test1");
            Assert.AreEqual(table.Rows[1]["Int"], 2);
            Assert.AreEqual(table.Rows[1]["String"], "Test2");
        }