public void TestFind() { using (Model.Context db = new Model.Context("mdbConnectionString")) { Post p = new Post(); p.Content = "Dummy post"; db.InsertOnSubmit <Post>(p); db.SubmitChanges(); Post found = db.Find <Post>(x => { return(x.Content == "Dummy post"); }).FirstOrDefault(); Assert.AreNotEqual(found, null); Assert.AreEqual(found.Content, p.Content); Assert.IsTrue(found.Id > 0); } }
public void TestFind() { using (Model.Context db = new Model.Context("mdbConnectionString")) { Post p = new Post(); p.Content = "Dummy post"; db.InsertOnSubmit<Post>(p); db.SubmitChanges(); Post found = db.Find<Post>(x => { return x.Content == "Dummy post"; }).FirstOrDefault(); Assert.AreNotEqual(found, null); Assert.AreEqual(found.Content, p.Content); Assert.IsTrue(found.Id > 0); } }