public void Can_create_store_tables() { //--- Arrange --- // set up DataCatalog expectations _catalog.ExpectNewQuery(@" CREATE TABLE IF NOT EXISTS teststore_store ( id int primary key auto_increment not null, revision int not null default 1, doc_id varchar(255) unique not null, doc text not null )", 1).Execute(); _catalog.ExpectNewQuery(@" CREATE TABLE IF NOT EXISTS teststore_store_indicies ( idx_name varchar(255) primary key not null, idx_xpath text not null )", 1).Execute(); _catalog.ExpectNewQuery(@"SELECT idx_name, idx_xpath FROM teststore_store_indicies", 1) .Execute(new MockDataCatalog.MockDataReader(new[] { "idx_name", "idx_xpath" }, new object[0][])); //--- Act --- MysqlDocStoreManager manager = new MysqlDocStoreManager(_catalog, new XDoc("config").Elem("name", testStore).Elem("id-xpath", "@id")); //--- Assert --- // check datacatalog expectations were met Assert.IsTrue(_catalog.Verify(), _catalog.VerificationFailure); }
public void Can_execute_query_without_return() { _mockCatalog.ExpectNewQuery("blah", 1).Execute(); _catalog.NewQuery("blah").Execute(); Assert.IsTrue(_mockCatalog.Verify(), _mockCatalog.VerificationFailure); }