Esempio n. 1
0
        public void TestCheckLockDefaultOk()
        {
            INakedObjectAdapter testAdapter = new NakedObjectAdapter(metamodel, session, persistor, lifecycleManager, nakedObjectManager, poco, oid, loggerFactory, logger);
            var testNullVersion             = new NullVersion(vLogger);

            testAdapter.CheckLock(testNullVersion);
        }
Esempio n. 2
0
        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);
        }
Esempio n. 3
0
        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
            }
        }