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/MigrationsJetFixture.cs

34 lines
1.3 KiB
C#

// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
using EntityFrameworkCore.Jet.Data;
using EntityFrameworkCore.Jet.FunctionalTests.TestUtilities;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Migrations;
using Microsoft.EntityFrameworkCore.TestUtilities;
namespace EntityFrameworkCore.Jet.FunctionalTests
{
public class MigrationsJetFixture : MigrationsInfrastructureFixtureBase
{
protected override ITestStoreFactory TestStoreFactory => JetTestStoreFactory.Instance;
public MigrationsJetFixture()
{
((JetTestStore)TestStore).ExecuteNonQuery(
@"USE master
IF EXISTS(select * from sys.databases where name='TransactionSuppressed')
DROP DATABASE TransactionSuppressed");
}
public override MigrationsContext CreateContext()
{
var options = AddOptions(
new DbContextOptionsBuilder()
.UseJet(TestStore.ConnectionString, TestEnvironment.DataAccessProviderFactory, b => b.ApplyConfiguration()))
.UseInternalServiceProvider(ServiceProvider)
.Options;
return new MigrationsContext(options);
}
}
}