public async Task setup_scenario() { _currentRequestId = Guid.NewGuid().ToString(); _newRequestId = Guid.NewGuid().ToString(); _correlationId = Guid.NewGuid().ToString(); _sessionId = Guid.NewGuid().ToString(); _service = "my-service"; _version = "1.0.1-client"; var sessionIdAccessor = new StubSessionIdAccessor { Response = _sessionId }; var correlationIdAccessor = new StubCorrelationIdAccessor { Response = _correlationId }; var outboundRequestIdAccessor = new StubOutboundRequestIdAccessor { OutboundRequestId = _currentRequestId }; var guidGenerator = new StubGuidGenerator(Guid.Parse(_newRequestId)); var applicationInfo = new StubApplicationInfo { Name = _service, Version = _version, OperatingSystem = "my-os" }; using (var webApi = new GetIdsFromHeadersHttpApi()) using (var httpClient = webApi.CreateClientWithTagging(sessionIdAccessor, correlationIdAccessor, outboundRequestIdAccessor, guidGenerator, applicationInfo)) { var response = await httpClient.GetAsync("/get-ids-from-headers"); var content = await response.Content.ReadAsStringAsync(); _idsFromHeaders = JObject.Parse(content); } }
public async Task setup_scenario() { var sessionIdAccessor = new StubSessionIdAccessor(); var correlationIdAccessor = new StubCorrelationIdAccessor(); var outboundRequestIdAccessor = new StubOutboundRequestIdAccessor(); var guidGenerator = new StubGuidGenerator(Guid.NewGuid()); var applicationInfo = new StubApplicationInfo { Name = "my-service", Version = "1.1.2", Environment = "Staging", OperatingSystem = "my-os" }; using (var webApi = new GetIdsFromHeadersHttpApi()) using (var httpClient = webApi.CreateClientWithTagging(sessionIdAccessor, correlationIdAccessor, outboundRequestIdAccessor, guidGenerator, applicationInfo)) { var response = await httpClient.GetAsync("/get-ids-from-headers"); var content = await response.Content.ReadAsStringAsync(); _idsFromHeaders = JObject.Parse(content); } }