Esempio n. 1
0
 public PaymentMethodPayloadTest()
 {
     Context  = TestHelper.MakeContext();
     Provider = ProviderFactory.GetVisa();
     Context.Providers.Add(Provider);
     Context.SaveChanges();
 }
Esempio n. 2
0
 public PaymentMethodLinkingTest(DatabaseFixture fixture)
 {
     Jaimito           = UserFactory.GetJaimito();
     Configuration     = Startup.Configuration;
     Context           = fixture.DatabaseContext;
     VisaProviderToken = Configuration["FakeProviderToken"];
     VisaProvider      = ProviderFactory.GetVisa();
     ApiFactory        = new StubProviderApiFactory {
         OnAssociation = conf => {
             if (conf.OperationTokenFromProvider.Equals(VisaProviderToken))
             {
                 return(new OkObjectResult("OK"));
             }
             return(new BadRequestObjectResult("BAD_REQUEST"));
         }
     };
     Setup();
     Controller = new PaymentMethodsController(Context, ApiFactory, GetClaimsExtractorFactoryFor(Jaimito));
 }