private static void ExecuteDaoOperations(ITestObjectDao dao) { TestObject toGeorge = new TestObject(); toGeorge.Name = "George"; toGeorge.Age = 33; dao.Create(toGeorge); TestObject to = dao.FindByName("George"); Assert.IsNotNull(to, "FindByName for George should not return null"); Assert.AreEqual("George", to.Name); Assert.AreEqual(33, to.Age); to.Age = 34; dao.Update(to); TestObject to2 = dao.FindByName("George"); Assert.AreEqual(34, to2.Age); dao.Delete(to); TestObject to3 = dao.FindByName("George"); Assert.IsNull(to3, "Should not have found TestObject with name George. TestObject = " + to.ToString()); }
private static void ExecuteDaoOperations(ITestObjectDao dao) { TestObject toGeorge = new TestObject(); toGeorge.Name = "George"; toGeorge.Age = 33; dao.Create(toGeorge); TestObject to = dao.FindByName("George"); Assert.IsNotNull(to, "FindByName for George should not return null"); Assert.AreEqual("George", to.Name); Assert.AreEqual(33, to.Age); to.Age=34; dao.Update(to); TestObject to2 = dao.FindByName("George"); Assert.AreEqual(34, to2.Age); dao.Delete(to); TestObject to3 = dao.FindByName("George"); Assert.IsNull(to3, "Should not have found TestObject with name George. TestObject = " + to.ToString() ); }
public void DeleteTwoTestObjects(string name1, string name2) { testObjectDao.Delete(name1); testObjectDao.Delete(name2); }