mirror of
https://github.com/nsnail/Ocelot.git
synced 2025-06-18 21:28:16 +08:00
removed fake service tracer (#511)
* removed fake service tracer * removed comments
This commit is contained in:
@ -1,4 +1,6 @@
|
||||
using System;
|
||||
using Butterfly.Client.Tracing;
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
using Moq;
|
||||
using Ocelot.Infrastructure.RequestData;
|
||||
using Ocelot.Requester;
|
||||
@ -11,13 +13,18 @@ namespace Ocelot.UnitTests.Requester
|
||||
{
|
||||
private TracingHandlerFactory _factory;
|
||||
private Mock<IServiceTracer> _tracer;
|
||||
private IServiceCollection _serviceCollection;
|
||||
private IServiceProvider _serviceProvider;
|
||||
private Mock<IRequestScopedDataRepository> _repo;
|
||||
|
||||
public TracingHandlerFactoryTests()
|
||||
{
|
||||
_tracer = new Mock<IServiceTracer>();
|
||||
_serviceCollection = new ServiceCollection();
|
||||
_serviceCollection.AddSingleton<IServiceTracer>(_tracer.Object);
|
||||
_serviceProvider = _serviceCollection.BuildServiceProvider();
|
||||
_repo = new Mock<IRequestScopedDataRepository>();
|
||||
_factory = new TracingHandlerFactory(_tracer.Object, _repo.Object);
|
||||
_factory = new TracingHandlerFactory(_serviceProvider, _repo.Object);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
@ -27,4 +34,4 @@ namespace Ocelot.UnitTests.Requester
|
||||
handler.ShouldBeOfType<OcelotHttpTracingHandler>();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user