Azavea.Open.DAO.Tests.SqlUtilTests.TestGetNullableTableMappingFromSchema C# (CSharp) Method

TestGetNullableTableMappingFromSchema() public static method

Tests the classmapping generation off the nullable table schema.
public static TestGetNullableTableMappingFromSchema ( AbstractSqlConnectionDescriptor connDesc, string nullableTableName ) : void
connDesc Azavea.Open.DAO.SQL.AbstractSqlConnectionDescriptor Connection descriptor for your particular database.
nullableTableName string Correctly-cased name of the nullable table (some DBs /// are case sensitive (cough oracle, postgresql cough)
return void
        public static void TestGetNullableTableMappingFromSchema(AbstractSqlConnectionDescriptor connDesc,
            string nullableTableName)
        {
            ClassMapping map = SqlConnectionUtilities.GenerateMappingFromSchema(connDesc, nullableTableName);
            Assert.AreEqual(map.TypeName, nullableTableName, "Wrong 'type' name on the generated class map.");
            Assert.AreEqual(map.Table, nullableTableName, "Wrong table name on the generated class map.");
            Assert.AreEqual(5, map.AllObjAttrsByDataCol.Count, "Wrong number of mapped fields.");
            Assert.AreEqual("ID", map.AllObjAttrsByDataCol["ID"], "Column was mapped incorrectly.");
            Assert.AreEqual("BOOLCOL", map.AllObjAttrsByDataCol["BoolCol"], "Column was mapped incorrectly.");
            Assert.AreEqual("INTCOL", map.AllObjAttrsByDataCol["IntCol"], "Column was mapped incorrectly.");
            Assert.AreEqual("FLOATCOL", map.AllObjAttrsByDataCol["FloatCol"], "Column was mapped incorrectly.");
            Assert.AreEqual("DATECOL", map.AllObjAttrsByDataCol["DateCol"], "Column was mapped incorrectly.");
        }