public void TestInsert_same_key_different_tables() { var nkv = TestConfiguration.CreateNkv(TestContext); var helper = TestConfiguration.TestHelpers[TestContext.DataRow["Helper"].ToString()]; using (var session = nkv.BeginSession()) { session.Init <Book>(); session.Init <BlogEntry>(); string key = Guid.NewGuid().ToString(); var book = Book.Generate(); book.Key = key; var blogEntry = BlogEntry.Generate(); blogEntry.Key = key; session.Insert(book); session.Insert(blogEntry); helper.AssertRowExists("Book", key); helper.AssertRowExists("BlogPosts", key); } }
public void TestSelect_keys_on_different_tables() { AdoNkv nkv; IAdoTestHelper helper; TestConfiguration.ParseContext(TestContext, out nkv, out helper); using (var session = nkv.BeginSession()) { session.Init <Book>(); session.Init <BlogEntry>(); var book = Book.Generate(); var blogEntry = BlogEntry.Generate(); session.Insert(book); session.Insert(blogEntry); Assert.IsNotNull(session.Select <Book>(book.Key)); Assert.IsNotNull(session.Select <BlogEntry>(blogEntry.Key)); Assert.IsNull(session.Select <Book>(blogEntry.Key)); Assert.IsNull(session.Select <BlogEntry>(book.Key)); } }