public void Validate_ConfigurationIsNull_ThrowsException() { ExceptionAssert.ThrowsArgumentNullException("configuration", () => { PaymentResponseValidator.Validate(null, new PaymentResponse()); }); }
public void Validate_ResponseIsNull_ThrowsException() { ExceptionAssert.ThrowsArgumentNullException("response", () => { PaymentResponseValidator.Validate(new KassaConfiguration(), null); }); }
public void Validate_IsValid_NoException() { PaymentResponse response = new PaymentResponse() { MerchantId = "123456789012345" }; PaymentResponseValidator.Validate(_configuration, response); }
internal IPaymentResponse GetResponse(IPaymentPostData response) { PaymentPostDataValidator.Validate(Configuration, response); IPaymentResponse result = PaymentResponse.Create(response.Data); PaymentResponseValidator.Validate(Configuration, result); return(result); }
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); }); }