Пример #1
0
        public void Command_decorated_with_Transactional_attribute_mapped_to_constructor_should_be_executed_in_context_of_transaction()
        {
            bool executedInTransaction = false;
            var command = new TransactionalAggregateRootTargetCreateNewCommand { Title = "TransactionalAggregateRootTargetCreateNewCommand" };
            var executor = new TestAttributeMappedCommandExecutor<AggregateRootTarget>(command);
            executor.VerificationAction = () => executedInTransaction = Transaction.Current != null;

            executor.Execute();

            Assert.True(executedInTransaction);
        }
Пример #2
0
        public void Command_decorated_with_Transactional_attribute_mapped_to_constructor_should_be_executed_in_context_of_transaction()
        {
            bool executedInTransaction = false;
            var  command = new TransactionalAggregateRootTargetCreateNewCommand {
                Title = "TransactionalAggregateRootTargetCreateNewCommand"
            };
            var executor = new TestAttributeMappedCommandExecutor <AggregateRootTarget>(command);

            executor.VerificationAction = () => executedInTransaction = Transaction.Current != null;

            executor.Execute();

            Assert.IsTrue(executedInTransaction);
        }