public void TestRollBackVersionNumberOnError()
        {
            //---------------Set up test pack-------------------
            //Create object in DB
            ContactPersonOptimisticLockingVersionNumberDB contactPerson = CreateSavedCntactPersonOptimisticLockingVersionNumberDB();

            int versionNumber = contactPerson.VersionNumber;

            //---------------Execute Test ----------------------
            contactPerson.Surname = Guid.NewGuid().ToString();
            Assert.AreEqual(versionNumber, contactPerson.VersionNumber);
            try
            {
                TransactionCommitterStubDB trnCommitter = new TransactionCommitterStubDB(DatabaseConnection.CurrentConnection);
                trnCommitter.AddBusinessObject(contactPerson);
                trnCommitter.AddTransaction(new StubDatabaseFailureTransaction());
                trnCommitter.CommitTransaction();
                Assert.Fail();
            }
            //---------------Test Result -----------------------
            catch (NotImplementedException)
            {
                Assert.AreEqual(versionNumber, contactPerson.VersionNumber);
            }
        }
        public void TestRollBackVersionNumberOnError()
        {
            //---------------Set up test pack-------------------
            //Create object in DB
            ContactPersonOptimisticLockingVersionNumberDB contactPerson = CreateSavedCntactPersonOptimisticLockingVersionNumberDB();

            int versionNumber = contactPerson.VersionNumber;

            //---------------Execute Test ----------------------
            contactPerson.Surname = Guid.NewGuid().ToString();
            Assert.AreEqual(versionNumber, contactPerson.VersionNumber);
            try
            {
                TransactionCommitterStubDB trnCommitter = new TransactionCommitterStubDB(DatabaseConnection.CurrentConnection);
                trnCommitter.AddBusinessObject(contactPerson);
                trnCommitter.AddTransaction(new StubDatabaseFailureTransaction());
                trnCommitter.CommitTransaction();
                Assert.Fail();
            }
                //---------------Test Result -----------------------
            catch (NotImplementedException)
            {
                Assert.AreEqual(versionNumber, contactPerson.VersionNumber);
            }
        }