2020-04-25 20:01:26 -04:00
|
|
|
|
using Microsoft.EntityFrameworkCore;
|
|
|
|
|
using SharedLibraryCore.Database;
|
|
|
|
|
using SharedLibraryCore.Interfaces;
|
|
|
|
|
using System;
|
2020-11-27 22:52:52 -05:00
|
|
|
|
using SharedLibraryCore.Database.MigrationContext;
|
2020-04-25 20:01:26 -04:00
|
|
|
|
|
|
|
|
|
namespace ApplicationTests.Mocks
|
|
|
|
|
{
|
|
|
|
|
class DatabaseContextFactoryMock : IDatabaseContextFactory
|
|
|
|
|
{
|
|
|
|
|
public DatabaseContext CreateContext(bool? enableTracking)
|
|
|
|
|
{
|
2020-11-27 22:52:52 -05:00
|
|
|
|
var contextOptions = new DbContextOptionsBuilder<SqliteDatabaseContext>()
|
|
|
|
|
.UseInMemoryDatabase(databaseName: "database")
|
|
|
|
|
.Options;
|
2020-04-25 20:01:26 -04:00
|
|
|
|
|
2020-11-27 22:52:52 -05:00
|
|
|
|
return new SqliteDatabaseContext(contextOptions);
|
2020-04-25 20:01:26 -04:00
|
|
|
|
}
|
|
|
|
|
}
|
2020-11-27 22:52:52 -05:00
|
|
|
|
}
|