Пример #1
0
        public void TestSimpleCase()
        {
            var dt         = DataReaderTests.GetTestDataSet();
            int fieldCount = dt[0].Count;
            var odr1       = new Kull.Data.DataReader.ObjectDataReader(dt);
            var result     = RowHelper.FromTable <TestClass>(odr1, false);

            Assert.AreEqual(result[0].FirstName, "peter");
            Assert.AreEqual(result[2].SomeId, 66);
        }
Пример #2
0
        public void TestMissingField()
        {
            var dt         = DataReaderTests.GetTestDataSet();
            int fieldCount = dt[0].Count;
            var odr1       = new Kull.Data.DataReader.ObjectDataReader(dt);
            var result     = RowHelper.FromTable <TestClass2>(odr1, true);

            Assert.AreEqual(result[0].FirstName, "peter");
            Assert.IsNull(result[0].MissingField);
            Assert.AreEqual(result[2].SomeId, 66);
        }