Beispiel #1
0
 public void Validate_ConfigurationIsNull_ThrowsException()
 {
     ExceptionAssert.ThrowsArgumentNullException("configuration", () =>
     {
         PaymentResponseValidator.Validate(null, new PaymentResponse());
     });
 }
Beispiel #2
0
 public void Validate_ResponseIsNull_ThrowsException()
 {
     ExceptionAssert.ThrowsArgumentNullException("response", () =>
     {
         PaymentResponseValidator.Validate(new KassaConfiguration(), null);
     });
 }
Beispiel #3
0
        public void Validate_IsValid_NoException()
        {
            PaymentResponse response = new PaymentResponse()
            {
                MerchantId = "123456789012345"
            };

            PaymentResponseValidator.Validate(_configuration, response);
        }
Beispiel #4
0
        internal IPaymentResponse GetResponse(IPaymentPostData response)
        {
            PaymentPostDataValidator.Validate(Configuration, response);

            IPaymentResponse result = PaymentResponse.Create(response.Data);

            PaymentResponseValidator.Validate(Configuration, result);

            return(result);
        }
Beispiel #5
0
        public void Validate_MerchantIdIsInvalid_ThrowwsException()
        {
            PaymentResponse response = new PaymentResponse()
            {
                MerchantId = "test"
            };

            ExceptionAssert.Throws <InvalidOperationException>($"Invalid merchant id.{Environment.NewLine}Expected value: {_configuration.MerchantId}.", () =>
            {
                PaymentResponseValidator.Validate(_configuration, response);
            });
        }