Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
using Xunit;
using Marten;
using Microsoft.Data.SqlClient;
using Microsoft.Extensions.DependencyInjection;
using Weasel.SqlServer;
using Wolverine.Marten;
using Wolverine.Persistence;
Expand Down Expand Up @@ -181,6 +182,25 @@ public async Task has_all_the_expected_databases()
);
}

[Fact]
public async Task using_db_context_outbox()
{
Func<IMessageContext, Task> action = async c =>
{
using var scope = theHost.Services.CreateScope();
var outbox = scope.ServiceProvider.GetRequiredService<IDbContextOutbox<ItemsDbContext>>();
var entity = new Item { Id = Guid.NewGuid() };
outbox.DbContext.Items.Add(entity);
await outbox.PublishAsync(new ApproveItem1(entity.Id));
await outbox.SaveChangesAndFlushMessagesAsync();
};

var tracked = await theHost.TrackActivity()
.ExecuteAndWaitAsync(action);

tracked.Sent.SingleEnvelope<ApproveItem1>().ShouldNotBeNull();
}

[Fact]
public async Task use_outbox_with_ancillary_store_with_ef_core()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,14 @@
using Weasel.Postgresql;
using Weasel.Postgresql.Migrations;
using Wolverine;
using Wolverine.EntityFrameworkCore;
using Wolverine.Marten;
using Wolverine.Persistence;
using Wolverine.Persistence.Durability;
using Wolverine.Postgresql;
using Wolverine.Runtime;
using Wolverine.SqlServer;
using Wolverine.SqlServer.Persistence;
using Wolverine.Tracking;
using Xunit;
using Xunit.Abstractions;
Expand Down
Loading