Ejemplo n.º 1
0
        public void SetValues_SetsDBNull()
        {
            var table = new DataTable();

            table.Columns.Add(new DataColumn("I", typeof(int)));
            table.Columns.Add(new DataColumn("S", typeof(string)));
            DataRow row = table.Rows.Add(DBNull.Value, "Value");

            var setter    = new PropertySetter(typeof(TestClass));
            var testClass = new TestClass();

            setter.SetValues(testClass, new DataRowIndexer(row), false);
            Assert.AreEqual(null, testClass.I);
            Assert.AreEqual("Value", testClass.S);
        }