예제 #1
0
 public async void ShouldDecoratedTransactionHandlerAndThrowException()
 {
     var command            = new AnyCommand();
     var decorator          = new ExceptionCommandDcorator();
     var transactionHandler = new TransactionHandler <AnyCommand>(unitOfWork, decorator);
     await Assert.ThrowsAsync <Exception>(() => transactionHandler.ExecuteAsync(command));
 }
예제 #2
0
        public async void ShouldDecoratedTransactionHandlerAndSum()
        {
            var command            = new AnyCommand();
            var decorator          = new AnyCommandDcorator();
            var transactionHandler = new TransactionHandler <AnyCommand>(unitOfWork, decorator);
            await transactionHandler.ExecuteAsync(command);

            Assert.Equal(1, command.Cout);
        }