public void TestAcceptanceTransactionLog_SaveMultipleTimes() { //---------------Cleanup databse ------------------ CleanDB(); //---------------Set up test pack------------------- ContactPersonTransactionLogging cp = CreateUnsavedContactPersonTransactionLogging(); cp.Save(); //---------------Execute Test ---------------------- cp.Surname = Guid.NewGuid().ToString(); cp.Save(); cp.Surname = Guid.NewGuid().ToString(); cp.Save(); cp.Surname = Guid.NewGuid().ToString(); cp.Save(); cp.Surname = Guid.NewGuid().ToString(); cp.Save(); cp.MarkForDelete(); cp.Save(); BusinessObjectCollection <TransactionLogBusObj> colTransactions = new BusinessObjectCollection <TransactionLogBusObj>(); colTransactions.LoadAll(); //cp = CreateUnsavedContactPersonTransactionLogging(); //cp.Save(); //---------------Test Result ----------------------- //Test that a transaction Log was created with Assert.AreEqual(6, colTransactions.Count); //---------------Tear Down ------------------------- }
public void TestDirtyXml() { ContactPersonTransactionLogging myContact_1 = new ContactPersonTransactionLogging(); //Edit first object and save myContact_1.Surname = "My Surname 1"; myContact_1.Save(); // myContact_1.Surname = "My Surname New"; Assert.AreEqual( "<ContactPersonTransactionLogging ID='" + myContact_1.ID + "'><Properties><Surname><PreviousValue>My Surname 1</PreviousValue><NewValue>My Surname New</NewValue></Surname></Properties></ContactPersonTransactionLogging>", myContact_1.DirtyXML); }