-
Notifications
You must be signed in to change notification settings - Fork 78
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Host.Outbox] Fails to retrieve bus when no child buses are in use #294
Signed-off-by: Tomasz Maruszak <[email protected]>
- Loading branch information
Showing
6 changed files
with
190 additions
and
112 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
19 changes: 19 additions & 0 deletions
19
src/Tests/SlimMessageBus.Host.Outbox.DbContext.Test/BaseOutboxIntegrationTest.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
namespace SlimMessageBus.Host.Outbox.DbContext.Test; | ||
|
||
public abstract class BaseOutboxIntegrationTest<T>(ITestOutputHelper testOutputHelper) : BaseIntegrationTest<T>(testOutputHelper) | ||
{ | ||
protected async Task PerformDbOperation(Func<CustomerContext, IOutboxMigrationService, Task> action) | ||
{ | ||
var scope = ServiceProvider!.CreateScope(); | ||
try | ||
{ | ||
var context = scope.ServiceProvider.GetRequiredService<CustomerContext>(); | ||
var outboxMigrationService = scope.ServiceProvider.GetRequiredService<IOutboxMigrationService>(); | ||
await action(context, outboxMigrationService); | ||
} | ||
finally | ||
{ | ||
await ((IAsyncDisposable)scope).DisposeAsync(); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.