예제 #1
0
        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());
        }
예제 #2
0
	    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);
 }