Ejemplo n.º 1
0
        public async Task <Card> Add_New_Card_Success()
        {
            var options = new Services.Options.CardOptions()
            {
                CardNumber        = "1111222233334444",
                CardHolderName    = "Name1",
                CardHolderSurname = "Surname1"
            };

            var card = (await _card.RegisterCardAsync(options))?.Data;

            Assert.NotNull(card);

            var savedCard = _dbContext.Set <Card>()
                            .Where(c => c.ID == card.ID)
                            .SingleOrDefault();

            Assert.NotNull(savedCard);
            Assert.Equal(options.CardNumber, savedCard.CardNumber);
            Assert.Equal(options.CardHolderName, savedCard.CardHolderName);
            Assert.Equal(options.CardHolderSurname, savedCard.CardHolderSurname);

            return(card);
        }
Ejemplo n.º 2
0
        public async Task <Limit> Add_New_Limit_Success()
        {
            var options = new Services.Options.CardLimitOptions()
            {
                CardNumber       = "1111222233334444",
                AvailableBalance = Constants.AmountLimits.CardPresent,
                TrsansactionType = CardTransactionType.CardPresent
            };

            var limit = (await _limit.RegisterCardLimitAsync(options))?.Data;

            Assert.NotNull(limit);

            var savedLimit = _dbContext.Set <Limit>()
                             .Where(c => c.ID == limit.ID)
                             .SingleOrDefault();

            Assert.NotNull(savedLimit);
            Assert.Equal(options.CardNumber, savedLimit.CardNumber);
            Assert.Equal(options.AvailableBalance, savedLimit.AvailableBalance);
            Assert.Equal(options.TrsansactionType, savedLimit.TrsansactionType);

            return(limit);
        }