Exemplo n.º 1
0
        public void CreateSubTransactionInReadOnlyRootTransaction_IsForbidden()
        {
            Assert.That(ReadOnlyRootTransaction.SubTransaction, Is.SameAs(ReadOnlyMiddleTransaction));
            Assert.That(ReadOnlyMiddleTransaction.SubTransaction, Is.SameAs(WriteableSubTransaction));

            CheckForbidden(() => ReadOnlyRootTransaction.CreateSubTransaction(), "SubTransactionCreating");

            Assert.That(ReadOnlyRootTransaction.SubTransaction, Is.SameAs(ReadOnlyMiddleTransaction));
            Assert.That(ReadOnlyMiddleTransaction.SubTransaction, Is.SameAs(WriteableSubTransaction));
        }
        public override void SetUp()
        {
            base.SetUp();

            _listenerDynamicMock = MockRepository.GenerateMock <IClientTransactionListener> ();
            _extensionStrictMock = MockRepository.GenerateStrictMock <IClientTransactionExtension> ();

            _readOnlyRootTransaction = ClientTransaction.CreateRootTransaction();
            ExecuteInReadOnlyRootTransaction(InitializeReadOnlyRootTransaction);
            _readOnlyMiddleTransaction = ReadOnlyRootTransaction.CreateSubTransaction();
            ExecuteInReadOnlyMiddleTransaction(InitializeReadOnlyMiddleTransaction);
            _writeableSubTransaction = ReadOnlyMiddleTransaction.CreateSubTransaction();
            ExecuteInWriteableSubTransaction(InitializeWriteableSubTransaction);
        }