Esempio n. 1
0
        public void TestCreateSelectCommandWithDoubleCondition()
        {
            _sqlCommandBuilder.CreateSelectQuery(_table);

            var idField = _table.Fields.FirstOrDefault(x => x.Name == "gid");

            _sqlCommandBuilder.AddCondition(idField, "0");

            var brandField = _table.Fields.FirstOrDefault(x => x.Name == "Brand");

            _sqlCommandBuilder.AddCondition(brandField, "Audi");
            var sqlQuery = _sqlCommandBuilder.CompleteQuery();

            Assert.Equal("SELECT * FROM data.Car WHERE gid = '0' AND Brand = 'Audi'", sqlQuery);
        }