public void TestCheckLockDefaultOk() { INakedObjectAdapter testAdapter = new NakedObjectAdapter(metamodel, session, persistor, lifecycleManager, nakedObjectManager, poco, oid, loggerFactory, logger); var testNullVersion = new NullVersion(vLogger); testAdapter.CheckLock(testNullVersion); }
public void TestCheckLockNewVersionOk() { INakedObjectAdapter testAdapter = new NakedObjectAdapter(metamodel, session, persistor, lifecycleManager, nakedObjectManager, poco, oid, loggerFactory, logger); var testCcVersion = new ConcurrencyCheckVersion("", DateTime.Now, new object()); testAdapter.OptimisticLock = testCcVersion; testAdapter.CheckLock(testCcVersion); }
public void TestCheckLockDefaultFail() { INakedObjectAdapter testAdapter = new NakedObjectAdapter(metamodel, session, persistor, lifecycleManager, nakedObjectManager, poco, oid, loggerFactory, logger); var testCcVersionVersion = new ConcurrencyCheckVersion("", DateTime.Now, new object()); try { testAdapter.CheckLock(testCcVersionVersion); Assert.Fail("exception expected"); } catch (ConcurrencyException) { // expected } }