Skip to content

Commit

Permalink
Run BuiltInDataTypesNpgsqlTest again with the NodaTime plugin activat…
Browse files Browse the repository at this point in the history
…ed to verify that all BCL date/time types are properly supported.

Closes npgsql#1490
  • Loading branch information
davidroth committed Oct 12, 2020
1 parent 795cb6b commit 01874ea
Showing 1 changed file with 29 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
using Microsoft.EntityFrameworkCore;
using Microsoft.Extensions.DependencyInjection;
using Npgsql.EntityFrameworkCore.PostgreSQL.Infrastructure;
using Xunit;
using Xunit.Abstractions;

namespace Npgsql.EntityFrameworkCore.PostgreSQL
{
public class BuiltInDataTypesWithNodaTimePluginEnabledTest : BuiltInDataTypesNpgsqlTest, IClassFixture<BuiltInDataTypesWithNodaTimePluginEnabledTest.BuiltInDataTypesWithNodaTimePluginEnabledFixture>
{
public BuiltInDataTypesWithNodaTimePluginEnabledTest(BuiltInDataTypesWithNodaTimePluginEnabledFixture fixture, ITestOutputHelper testOutputHelper)
: base(fixture, testOutputHelper)
{ }

public class BuiltInDataTypesWithNodaTimePluginEnabledFixture : BuiltInDataTypesNpgsqlFixture
{
protected override IServiceCollection AddServices(IServiceCollection serviceCollection)
=> base.AddServices(serviceCollection).AddEntityFrameworkNpgsqlNodaTime();

public override DbContextOptionsBuilder AddOptions(DbContextOptionsBuilder builder)
{
var optionsBuilder = base.AddOptions(builder);
new NpgsqlDbContextOptionsBuilder(optionsBuilder).UseNodaTime();

return optionsBuilder;
}
}
}
}

0 comments on commit 01874ea

Please sign in to comment.