/// <summary> /// Основной конструктор. /// </summary> /// <param name="options">Настройки.</param> /// <param name="httpClient">Готовый и сконфигурированный HTTP Client (рекомендуется использовать HttpClientFactory).</param> /// <param name="logger">Логгер.</param> public LikePharmaClient(LikePharmaClientOptions options, HttpClient httpClient, ILogger <LikePharmaClient> logger) { this.options = options ?? throw new ArgumentNullException(nameof(options)); this.validator = new LikePharmaValidator(options.ProtocolSettings); this.httpClient = httpClient ?? throw new ArgumentNullException(nameof(httpClient)); this.logger = logger ?? throw new ArgumentNullException(nameof(logger)); }
public ResponseBaseValidationTests() { ProtocolSettings = ProtocolSettings.CreateEmpty(); Validator = new LikePharmaValidator(ProtocolSettings); ValidValue.Status = Globals.StatusSuccess; ValidValue.ErrorCode = Globals.ErrorCodeNoError; #pragma warning disable CA1303 // Do not pass literals as localized parameters ValidValue.Message = "Hello, World"; #pragma warning restore CA1303 // Do not pass literals as localized parameters }
public RegisterRequestValidationTests() { this.protocolSettings = ProtocolSettings.CreateEmpty(); this.validator = new LikePharmaValidator(protocolSettings); validValue = new RegisterRequest { PosId = "A12BC", CardNumber = "12345", PhoneNumber = "12345", TrustKey = "abc", }; }
public ConfirmPurchaseRequestValidationTests() { this.protocolSettings = ProtocolSettings.CreateEmpty(); this.validator = new LikePharmaValidator(protocolSettings); validValue = new ConfirmPurchaseRequest { PosId = "A12BC", CardNumber = "1234567890123", Transactions = new List <string>() { "abc123", "abcd1234" }, }; }
public GetDiscountRequestValidationTests() { this.protocolSettings = ProtocolSettings.CreateEmpty(); this.validator = new LikePharmaValidator(protocolSettings); validValue = new GetDiscountRequest { PosId = PosIdAttributeTests.ValidPosIdValue, CardNumber = "12345", AnyData = "Hello, World!", Orders = new List <GetDiscountRequest.Order> { new GetDiscountRequest.Order { Barcode = "1234567890123", Count = 11, Price = 123.45M, AnyData = "AnyData1", }, }, }; }