|
|
@@ -8,17 +8,18 @@ namespace DotNetCore.CAP.Test |
|
|
|
{ |
|
|
|
public class CapBuilderTest |
|
|
|
{ |
|
|
|
|
|
|
|
[Fact] |
|
|
|
public void CanCreateInstanceAndGetService() |
|
|
|
{ |
|
|
|
var services = new ServiceCollection(); |
|
|
|
|
|
|
|
|
|
|
|
services.AddSingleton<ICapPublisher, MyProducerService>(); |
|
|
|
var builder = new CapBuilder(services); |
|
|
|
Assert.NotNull(builder); |
|
|
|
|
|
|
|
var count = builder.Services.Count; |
|
|
|
Assert.Equal(1, count); |
|
|
|
Assert.Equal(1, count); |
|
|
|
|
|
|
|
var provider = services.BuildServiceProvider(); |
|
|
|
var capPublisher = provider.GetService<ICapPublisher>(); |
|
|
|