public ApiKeyRepository(
     PaymentGatewayDBContext ctx,
     ILogger <IApiKeyRepository> logger)
 {
     _ctx    = ctx;
     _logger = logger;
 }
Beispiel #2
0
        public ApiKeysRepositoryShould()
        {
            _fakeLogger = new Mock <ILogger <IApiKeyRepository> >();
            _options    = InMemorySQLLite.CreateOptions <PaymentGatewayDBContext>();
            _context    = new PaymentGatewayDBContext(_options);
            _sut        = new ApiKeyRepository(_context, _fakeLogger.Object);

            _context.Database.EnsureCreated();
        }
Beispiel #3
0
        public static void SeedKeys(
            this PaymentGatewayDBContext ctx,
            string key)
        {
            if (ctx.ApiKeys.Any())
            {
                return;
            }

            ctx.Add(new ApiKey
            {
                ID  = 1,
                Key = key
            });

            ctx.SaveChanges();
        }
Beispiel #4
0
        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;
 }