public void SqlServerCreatesSqWithBooleanDefault()
		{
			var mapper = new ColumnPropertiesMapper(new SqlServerDialect(), "bit");
			mapper.MapColumnProperties(new Column("foo", DbType.Boolean, 0, false));
			Assert.AreEqual("foo bit DEFAULT 0", mapper.ColumnSql);

			mapper.MapColumnProperties(new Column("bar", DbType.Boolean, 0, true));
			Assert.AreEqual("bar bit DEFAULT 1", mapper.ColumnSql);
		}
        public void SqlServerCreatesSqWithBooleanDefault()
        {
            var mapper = new ColumnPropertiesMapper(new SqlServerDialect(), "bit");

            mapper.MapColumnProperties(new Column("foo", DbType.Boolean, 0, false));
            Assert.AreEqual("foo bit DEFAULT 0", mapper.ColumnSql);

            mapper.MapColumnProperties(new Column("bar", DbType.Boolean, 0, true));
            Assert.AreEqual("bar bit DEFAULT 1", mapper.ColumnSql);
        }
        public void SqlServerCreatesSqWithNullDefault()
        {
            var mapper = new ColumnPropertiesMapper(new SqlServerDialect(), "varchar(30)");

            mapper.MapColumnProperties(new Column("foo", DbType.String, 0, "NULL"));
            Assert.AreEqual("foo varchar(30) DEFAULT NULL", mapper.ColumnSql);
        }
        public void SqlServerCreatesNotNullSql()
        {
            var mapper = new ColumnPropertiesMapper(new SqlServerDialect(), "varchar(30)");

            mapper.MapColumnProperties(new Column("foo", DbType.String, ColumnProperty.NotNull));
            Assert.AreEqual("foo varchar(30) NOT NULL", mapper.ColumnSql);
        }
        public void PostgresIndexSqlIsNullWhenIndexedFalse()
        {
            var mapper = new ColumnPropertiesMapper(new PostgreSQLDialect(), "char(1)");

            mapper.MapColumnProperties(new Column("foo", DbType.StringFixedLength, 1, 0));
            Assert.IsNull(mapper.IndexSql);
        }
        public void OracleIndexSqlIsNoNullWhenIndexed()
        {
            var mapper = new ColumnPropertiesMapper(new OracleDialect(), "char(1)");

            mapper.MapColumnProperties(new Column("foo", DbType.StringFixedLength, 1, ColumnProperty.Indexed));
            Assert.IsNotNull(mapper.IndexSql);
        }
        public void OracleCreatesSql()
        {
            var mapper = new ColumnPropertiesMapper(new OracleDialect(), "varchar(30)");

            mapper.MapColumnProperties(new Column("foo", DbType.String, 0));
            Assert.AreEqual("foo varchar(30)", mapper.ColumnSql);
        }
예제 #8
0
        public void SqlServerCreatesSql()
        {
            var mapper = new ColumnPropertiesMapper(new SqlServerDialect(), "varchar(30)");

            mapper.MapColumnProperties(new Column("foo", DbType.String, 0));
            Assert.AreEqual("[foo] varchar(30)", mapper.ColumnSql);
        }
        public void SQLiteIndexSqlWithEmptyStringDefault()
        {
            var mapper = new ColumnPropertiesMapper(new SQLiteDialect(), "varchar(30)");

            mapper.MapColumnProperties(new Column("foo", DbType.String, 1, ColumnProperty.NotNull, string.Empty));
            Assert.AreEqual("foo varchar(30) NOT NULL DEFAULT ''", mapper.ColumnSql);
        }
 public void SqlServerCreatesSqWithDefault()
 {
     ColumnPropertiesMapper mapper = new ColumnPropertiesMapper(new SqlServerDialect(), "varchar(30)");
     mapper.MapColumnProperties(new Column("foo", DbType.String, 0, "'NEW'"));
     Assert.AreEqual("foo varchar(30) DEFAULT 'NEW'", mapper.ColumnSql);
 }
 public void SqlServerCreatesSql()
 {
     ColumnPropertiesMapper mapper = new ColumnPropertiesMapper(new SqlServerDialect(), "varchar(30)");
     mapper.MapColumnProperties(new Column("foo", DbType.String, 0));
     Assert.AreEqual("foo varchar(30)", mapper.ColumnSql);
 }
 public void PostgresIndexSqlIsNullWhenIndexedFalse()
 {
     ColumnPropertiesMapper mapper = new ColumnPropertiesMapper(new PostgreSQLDialect(), "char(1)");
     mapper.MapColumnProperties(new Column("foo", DbType.StringFixedLength, 1, 0));
     Assert.IsNull(mapper.IndexSql);
 }
 public void OracleIndexSqlIsNoNullWhenIndexed()
 {
     ColumnPropertiesMapper mapper = new ColumnPropertiesMapper(new OracleDialect(), "char(1)");
     mapper.MapColumnProperties(new Column("foo", DbType.StringFixedLength, 1, ColumnProperty.Indexed));
     Assert.IsNotNull(mapper.IndexSql);
 }
 public void OracleCreatesNotNullSql()
 {
     ColumnPropertiesMapper mapper = new ColumnPropertiesMapper(new OracleDialect(), "varchar(30)");
     mapper.MapColumnProperties(new Column("foo", DbType.String, ColumnProperty.NotNull));
     Assert.AreEqual("foo varchar(30) NOT NULL", mapper.ColumnSql);
 }
		public void SqlServerCreatesNotNullSql()
		{
			var mapper = new ColumnPropertiesMapper(new SqlServerDialect(), "varchar(30)");
			mapper.MapColumnProperties(new Column("foo", DbType.String, ColumnProperty.NotNull));
			Assert.AreEqual("[foo] varchar(30) NOT NULL", mapper.ColumnSql);
		}
 public void SQLiteIndexSqlWithEmptyStringDefault()
 {
     var mapper = new ColumnPropertiesMapper(new SQLiteDialect(), "varchar(30)");
     mapper.MapColumnProperties(new Column("foo", DbType.String, 1, ColumnProperty.NotNull, string.Empty));
     Assert.AreEqual("foo varchar(30) NOT NULL DEFAULT ''", mapper.ColumnSql);
 }