Exemplo n.º 1
0
        public void GetDeleteCommandTest()
        {
            TestModel model = new TestModel {
                Id = 1
            };
            MySQLTranslator translator = new MySQLTranslator();
            QueryProvider   provider   = new QueryProvider(new DbProvider(DbType.Sql, "Server=127.0.0.1;Database=fakedb;User Id=FakeUser;Password=fake.password;"));
            IDbCommand      cmd        = provider.GetDeleteCommand(model.Id, "TestModels", Mapper.GetTableMapping <TestModel>());

            Assert.Equal("DELETE FROM TestModels WHERE Id = @id;", cmd.CommandText);
        }