public HttpRequestHeadersBuilderMiddlewareTests() { _addHeaders = new Mock <IAddHeadersToRequest>(); _downstreamContext = new DownstreamContext(new DefaultHttpContext()); _loggerFactory = new Mock <IOcelotLoggerFactory>(); _logger = new Mock <IOcelotLogger>(); _loggerFactory.Setup(x => x.CreateLogger <HttpRequestHeadersBuilderMiddleware>()).Returns(_logger.Object); _next = context => Task.CompletedTask; _middleware = new HttpRequestHeadersBuilderMiddleware(_next, _loggerFactory.Object, _addHeaders.Object); _downstreamContext.DownstreamRequest = new DownstreamRequest(new HttpRequestMessage(HttpMethod.Get, "http://test.com")); }
public HttpRequestHeadersBuilderMiddlewareTests() { _addHeaders = new Mock <IAddHeadersToRequest>(); _downstreamContext = new DownstreamContext(new DefaultHttpContext()); _loggerFactory = new Mock <IOcelotLoggerFactory>(); _logger = new Mock <IOcelotLogger>(); _loggerFactory.Setup(x => x.CreateLogger <HttpRequestHeadersBuilderMiddleware>()).Returns(_logger.Object); _next = async context => { //do nothing }; _middleware = new HttpRequestHeadersBuilderMiddleware(_next, _loggerFactory.Object, _addHeaders.Object); _downstreamContext.DownstreamRequest = new HttpRequestMessage(); }