You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
EntityFrameworkCore.Jet/test/EFCore.Jet.FunctionalTests/NullKeysJetTest.cs

45 lines
1.6 KiB
C#

using System;
using EntityFramework.Jet.FunctionalTests.TestUtilities;
using EntityFrameworkCore.Jet;
using Extensions.DependencyInjection;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Query;
using Microsoft.Extensions.DependencyInjection;
namespace EntityFramework.Jet.FunctionalTests
{
public class NullKeysJetTest : NullKeysTestBase<NullKeysJetTest.NullKeysJetFixture>
{
public NullKeysJetTest(NullKeysJetFixture fixture)
: base(fixture)
{
}
public class NullKeysJetFixture : NullKeysFixtureBase, IDisposable
{
private readonly DbContextOptions _options;
private readonly JetTestStore _testStore;
public NullKeysJetFixture()
{
var name = "StringsContext";
var connectionString = JetTestStore.CreateConnectionString(name);
_options = new DbContextOptionsBuilder()
.UseJet(connectionString, b => b.ApplyConfiguration())
.UseInternalServiceProvider(new ServiceCollection()
.AddEntityFrameworkJet()
.AddSingleton(TestModelSource.GetFactory(OnModelCreating))
.BuildServiceProvider())
.Options;
_testStore = JetTestStore.GetOrCreateShared(name, EnsureCreated);
}
public override DbContext CreateContext()
=> new DbContext(_options);
public void Dispose() => _testStore.Dispose();
}
}
}