public ApiKeyRepository( PaymentGatewayDBContext ctx, ILogger <IApiKeyRepository> logger) { _ctx = ctx; _logger = logger; }
public ApiKeysRepositoryShould() { _fakeLogger = new Mock <ILogger <IApiKeyRepository> >(); _options = InMemorySQLLite.CreateOptions <PaymentGatewayDBContext>(); _context = new PaymentGatewayDBContext(_options); _sut = new ApiKeyRepository(_context, _fakeLogger.Object); _context.Database.EnsureCreated(); }
public static void SeedKeys( this PaymentGatewayDBContext ctx, string key) { if (ctx.ApiKeys.Any()) { return; } ctx.Add(new ApiKey { ID = 1, Key = key }); ctx.SaveChanges(); }
public static void SeedPayments( this PaymentGatewayDBContext ctx, string identifier) { if (ctx.Payments.Any()) { return; } ctx.Add(new Payment { ID = 1, PaymentIdentifier = identifier, CardHolderName = "Igor", CardNumber = "12345", CVV = 12345, Amount = 1.0M, Currency = "EUR" }); ctx.SaveChanges(); }
public PaymentAPIController(PaymentGatewayDBContext context) { _context = context; }
public void SetUp() { this.subPaymentGatewayDBContext = Substitute.For <PaymentGatewayDBContext>(); }
public PaymentHelper(PaymentGatewayDBContext context) { _context = context; }