public QoSFactoryTests() { _services = new ServiceCollection(); _loggerFactory = new Mock <IOcelotLoggerFactory>(); var provider = _services.BuildServiceProvider(); _factory = new QoSFactory(provider, _loggerFactory.Object); }
public void should_return_handler() { _services = new ServiceCollection(); DelegatingHandler QosDelegatingHandlerDelegate(DownstreamRoute a, IOcelotLoggerFactory b) => new FakeDelegatingHandler(); _services.AddSingleton <QosDelegatingHandlerDelegate>(QosDelegatingHandlerDelegate); var provider = _services.BuildServiceProvider(); _factory = new QoSFactory(provider, _loggerFactory.Object); var downstreamRoute = new DownstreamRouteBuilder().Build(); var handler = _factory.Get(downstreamRoute); handler.IsError.ShouldBeFalse(); handler.Data.ShouldBeOfType <FakeDelegatingHandler>(); }