public PaymentServiceTests()
        {
            accountBuilder = new AccountBuilder();

            config = Substitute.For <IConfiguration>();

            accountDataStores      = Substitute.For <IIndex <DataStoreType, IProvideAccountData> >();
            accountDataStore       = Substitute.For <IProvideAccountData>();
            backupAccountDataStore = Substitute.For <IProvideAccountData>();
            accountDataStores[DataStoreType.Account].Returns(accountDataStore);
            accountDataStores[DataStoreType.BackupAccount].Returns(backupAccountDataStore);

            accountValidators = Substitute.For <IIndex <PaymentScheme, IValidatePaymentRequest> >();
            bacsValidator     = Substitute.For <IValidatePaymentRequest>();
            accountValidators[PaymentScheme.Bacs].Returns(bacsValidator);
            bacsValidator.Validate(Arg.Any <Account>(), Arg.Any <MakePaymentRequest>())
            .Returns(MakePaymentResult.Failure);
        }
示例#2
0
 public PaymentController(IValidatePaymentRequest validatePayment)
 {
     _validatePayment = validatePayment;
 }