public void Should_Start_A_Transaction()
        {
            var innerBehavior = Substitute.For<IActionBehavior>();
            var unitOfWork = Substitute.For<IUnitOfWork>();

            var transactionScopeBehavior = new TransactionScopeBehavior(innerBehavior, unitOfWork);

            transactionScopeBehavior.Invoke();

            unitOfWork.Received().BeginTransaction();
        }
        public void Should_Commit_A_Transaction_When_There_Are_No_Exceptions()
        {
            var innerBehavior = Substitute.For<IActionBehavior>();
            var unitOfWork = Substitute.For<IUnitOfWork>();
            var transaction = Substitute.For<ITransaction>();

            unitOfWork.BeginTransaction().Returns(transaction);

            var transactionScopeBehavior = new TransactionScopeBehavior(innerBehavior, unitOfWork);

            transactionScopeBehavior.Invoke();

            transaction.Received().Commit();
            transaction.DidNotReceive().Rollback();
        }