Exemplo n.º 1
0
        internal static ResponseLogFactory CreateResponseLogFactory(IHttpContextAccessor httpContextAccessor          = null,
                                                                    ResponseLogFactoryConfig responseLogFactoryConfig = null, ITrafficCometMiddlewaresAccessor trafficCometMiddlewaresAccessor = null)
        {
            if (httpContextAccessor == null)
            {
                httpContextAccessor = CreateHttpContextAccessor();
            }

            var options = CreateOptionsForResponseLogFactory(responseLogFactoryConfig);

            if (trafficCometMiddlewaresAccessor == null)
            {
                trafficCometMiddlewaresAccessor = ITrafficCometMiddlewaresAccessorMockFactory.CreateObjectMock(
                    requestCustomParams: MockStaticData.RequestCustomParams,
                    responseCustomParams: MockStaticData.ResponseCustomParams);
            }

            var requestLogFactory = new ResponseLogFactory(httpContextAccessor, options, trafficCometMiddlewaresAccessor);

            return(requestLogFactory);
        }
Exemplo n.º 2
0
 internal static IOptions <ResponseLogFactoryConfig> CreateOptionsForResponseLogFactory(ResponseLogFactoryConfig responseLogFactoryConfig = null)
 {
     return(CreateOptionsMock(responseLogFactoryConfig ?? MockStaticData.ResponseLogFactoryConfig));
 }