Skip to content

Commit

Permalink
Enable dynamic json mappings in Postgres tests
Browse files Browse the repository at this point in the history
  • Loading branch information
artiomchi committed Nov 20, 2023
1 parent bf868c1 commit 7f5190a
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
using FlexLabs.EntityFrameworkCore.Upsert.Tests.EF;
using FluentAssertions;
using Microsoft.EntityFrameworkCore;
using Npgsql;
using Testcontainers.PostgreSql;
using Xunit;

Expand All @@ -23,7 +24,9 @@ protected override void ConfigureContextOptions(DbContextOptionsBuilder<TestDbCo
{
var connectionString = (TestContainer as IDatabaseContainer)?.GetConnectionString()
?? (BuildEnvironment.IsGitHub ? "Server=localhost;Port=5432;Database=testuser;Username=postgres;Password=root" : null);
builder.UseNpgsql(connectionString);
builder.UseNpgsql(new NpgsqlDataSourceBuilder(connectionString)
.EnableDynamicJsonMappings()
.Build());
}
}

Expand Down

0 comments on commit 7f5190a

Please sign in to comment.