IW4M-Admin/Tests/ApplicationTests/Mocks/DatabaseContextFactoryMock.cs
RaidMax 36a02b3d7b update for database provider specific migrations
fix issues with live radar
2020-11-27 21:52:52 -06:00

20 lines
612 B
C#

using Microsoft.EntityFrameworkCore;
using SharedLibraryCore.Database;
using SharedLibraryCore.Interfaces;
using System;
using SharedLibraryCore.Database.MigrationContext;
namespace ApplicationTests.Mocks
{
class DatabaseContextFactoryMock : IDatabaseContextFactory
{
public DatabaseContext CreateContext(bool? enableTracking)
{
var contextOptions = new DbContextOptionsBuilder<SqliteDatabaseContext>()
.UseInMemoryDatabase(databaseName: "database")
.Options;
return new SqliteDatabaseContext(contextOptions);
}
}
}