Closed Wind010 closed 4 years ago
Try this in stead:
var httpClient = new HttpClient(handlerMock.Object);
httpClient.BaseAddress = new Uri("https://localhost:44315/");
var accessor = new CorrelationContextAccessor();
var factory = new CorrelationContextFactory(accessor);
var context = factory.Create(Guid.NewGuid().ToString(), "X-Correlation-ID");
_yourHttpClient = new EmployeePlanningClient(httpClient, accessor);
Added support for this by making the ctor public and adding a sample test project
Would like to mock the ICorrelationContextAccessor to provide back a CorrelationContext, so I can access the CorrelationId property. Unfortunately there CorrelationContext does not inherit from an interface and the constructor is internal.