public GivenClaimingAVoucher()
        {
            var voucherRepository = new VoucherRepository();

            _sutVoucherCreator = voucherRepository;
            _sutVoucherClaimer = voucherRepository;
            _sut = new ClaimVoucherUseCase(_sutVoucherClaimer);
        }
Ejemplo n.º 2
0
 /// <summary>ctor</summary>
 public VouchersController(
     CreateVoucherUseCase createVoucherUseCase,
     ClaimVoucherUseCase claimVoucherUseCase,
     ILogger logger)
 {
     _createVoucherUseCase = createVoucherUseCase;
     _claimVoucherUseCase  = claimVoucherUseCase;
     _logger = logger;
 }
        public void WhenTheAdapterThrowsException_TheUseCaseShouldWrapTheExceptionInACustomException()
        {
            var voucherClaimer = new MisbehavingVoucherClaimer();
            var sut            = new ClaimVoucherUseCase(voucherClaimer);

            Record.Exception(() =>
                             { sut.Claim(Guid.NewGuid()); })
            .Should()
            .BeOfType <CouldNotClaimVoucher>();
        }