public void GetWhereClause_wrap_only_spaces() { Dictionary <string, string> d = new Dictionary <string, string>(); d.Add("first name", "'john'"); d.Add("last", "'smith'"); SqlGeneratorConfig config = new SqlGeneratorConfig("table"); config.NameWrappingPattern = IdentifierWrappingPattern.WrapOnlyObjectNamesThatContainSpaces; string where = DataRowExtensions.GetWhereClause(config, d); Assert.Equal("WHERE `first name` = 'john' AND last = 'smith'", where); }
public void GetWhereClause_wrap_all_prefix_columns() { Dictionary <string, string> d = new Dictionary <string, string>(); d.Add("first name", "'john'"); d.Add("last", "'smith'"); SqlGeneratorConfig config = new SqlGeneratorConfig("table"); config.NameWrappingPattern = IdentifierWrappingPattern.WrapAllObjectNames; config.PrefixColumnNameWithTableName = true; string where = DataRowExtensions.GetWhereClause(config, d); Assert.Equal("WHERE `table`.`first name` = 'john' AND `table`.`last` = 'smith'", where); }