internal CallingServerClient CreateMockCallingServerClient(int responseCode, object?responseContent = null, HttpHeader[]?httpHeaders = null) { var mockResponse = new MockResponse(responseCode); if (responseContent != null) { if (responseContent is string responseContentString) { mockResponse.SetContent(responseContentString); } else if (responseContent is byte[] responseContentObjectArr) { mockResponse.SetContent(responseContentObjectArr); } } if (httpHeaders != null) { for (int i = 0; i < httpHeaders.Length; i++) { mockResponse.AddHeader(httpHeaders[i]); } } var callingServerClientOptions = new CallingServerClientOptions { Transport = new MockTransport(mockResponse) }; return(new CallingServerClient(connectionString, callingServerClientOptions)); }
private CallingServerClientOptions CreateServerCallingClientOptionsWithCorrelationVectorLogs() { CallingServerClientOptions callClientOptions = new CallingServerClientOptions(); callClientOptions.Diagnostics.LoggedHeaderNames.Add("MS-CV"); return(InstrumentClientOptions(callClientOptions)); }
internal CallingServerClient CreateMockCallingServerClient(params MockResponse[] mockResponses) { var callingServerClientOptions = new CallingServerClientOptions { Transport = new MockTransport(mockResponses) }; return(new CallingServerClient(connectionString, callingServerClientOptions)); }