Browse Source

Fix unit test

master
Savorboard 5 years ago
parent
commit
7580ae66b2
1 changed files with 6 additions and 4 deletions
  1. +6
    -4
      test/DotNetCore.CAP.Test/ConsumerServiceSelectorTest.cs

+ 6
- 4
test/DotNetCore.CAP.Test/ConsumerServiceSelectorTest.cs View File

@@ -8,16 +8,18 @@ namespace DotNetCore.CAP.Test
{ {
public class ConsumerServiceSelectorTest public class ConsumerServiceSelectorTest
{ {
private IServiceProvider _provider;
private readonly IServiceProvider _provider;


public ConsumerServiceSelectorTest() public ConsumerServiceSelectorTest()
{ {
var services = new ServiceCollection();
//services.AddSingleton<IConsumerServiceSelector, DefaultConsumerServiceSelector>();
var services = new ServiceCollection();
ServiceCollectionExtensions.ServiceCollection = services;
services.AddOptions();
services.PostConfigure<CapOptions>(x=>{});
services.AddSingleton<IConsumerServiceSelector, DefaultConsumerServiceSelector>();
services.AddScoped<IFooTest, CandidatesFooTest>(); services.AddScoped<IFooTest, CandidatesFooTest>();
services.AddScoped<IBarTest, CandidatesBarTest>(); services.AddScoped<IBarTest, CandidatesBarTest>();
services.AddLogging(); services.AddLogging();
services.AddCap(x => { });
_provider = services.BuildServiceProvider(); _provider = services.BuildServiceProvider();
} }




Loading…
Cancel
Save