Skip to content

Commit 3b5f153

Browse files
committed
fix: fix code smell
1 parent 0f6f850 commit 3b5f153

File tree

2 files changed

+2
-11
lines changed

2 files changed

+2
-11
lines changed

src/Contrib/Ddd/Domain/Masa.Contrib.Ddd.Domain/DomainEventBus.cs

+1-4
Original file line numberDiff line numberDiff line change
@@ -8,20 +8,17 @@ public class DomainEventBus : IDomainEventBus
88
private readonly IEventBus _eventBus;
99
private readonly IIntegrationEventBus _integrationEventBus;
1010
private readonly IUnitOfWork _unitOfWork;
11-
private readonly DispatcherOptions _options;
1211

1312
private readonly ConcurrentQueue<IDomainEvent> _eventQueue = new();
1413

1514
public DomainEventBus(
1615
IEventBus eventBus,
1716
IIntegrationEventBus integrationEventBus,
18-
IUnitOfWork unitOfWork,
19-
IOptions<DispatcherOptions> options)
17+
IUnitOfWork unitOfWork)
2018
{
2119
_eventBus = eventBus;
2220
_integrationEventBus = integrationEventBus;
2321
_unitOfWork = unitOfWork;
24-
_options = options.Value;
2522
}
2623

2724
public async Task PublishAsync<TEvent>(TEvent @event, CancellationToken cancellationToken = default) where TEvent : IEvent

src/Contrib/Ddd/Domain/Tests/Masa.Contrib.Ddd.Domain.Tests/DomainEventBusTest.cs

+1-7
Original file line numberDiff line numberDiff line change
@@ -18,15 +18,9 @@ public void Test()
1818
_integrationEventBus = new();
1919
_integrationEventBus.Setup(bus => bus.PublishAsync(It.IsAny<IIntegrationEvent>(), default)).Verifiable();
2020
Mock<IUnitOfWork> unitOfWork = new();
21-
IOptions<DispatcherOptions> options =
22-
Microsoft.Extensions.Options.Options.Create(
23-
new DispatcherOptions(
24-
new ServiceCollection(),
25-
AppDomain.CurrentDomain.GetAssemblies()));
2621
_domainEventBus = new DomainEventBus(_eventBus.Object,
2722
_integrationEventBus.Object,
28-
unitOfWork.Object,
29-
options
23+
unitOfWork.Object
3024
);
3125
}
3226

0 commit comments

Comments
 (0)