Beispiel #1
0
        public void Validate_Scenarios(string input, string expected)
        {
            var result = CardNumberUtil.Mask(input);

            Assert.IsNotNull(result);
            Assert.AreEqual(expected, result);
        }
Beispiel #2
0
        public void Null_String_Throws_Exception()
        {
            var input = (string)null;

            Assert.ThrowsException <ArgumentNullException>(() =>
            {
                CardNumberUtil.Mask(input);
            });
        }
Beispiel #3
0
        public GetChargeResponse(Charge charge)
        {
            if (charge is null)
            {
                throw new ArgumentNullException(nameof(charge));
            }

            Id            = charge.Id;
            IdempotentKey = charge.IdempotentKey;
            CreatedOn     = charge.CreatedOn;
            Status        = charge.Status;
            Amount        = charge.Amount;
            Currency      = charge.Currency;
            Description   = charge.Description;
            CardNumber    = CardNumberUtil.Mask(charge.CardNumber);
        }