Files
EFCore.NamingConventions/EFCore.NamingConventions.Test/TestUtilities/InMemoryTestHelpers.cs
Shay Rojansky 3f62586c3f Big overhaul for 5.0 (#47)
* Use EF Core 5.0
* Fixes around TPH, owned entity management
* Redid tests

Fixes #45
Closes #46
Fixes #41
2020-12-10 14:52:26 +02:00

30 lines
1.1 KiB
C#

// Copyright (c) .NET Foundation. All rights reserved.
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
using Microsoft.EntityFrameworkCore.Diagnostics;
using Microsoft.EntityFrameworkCore.InMemory.Diagnostics.Internal;
using Microsoft.Extensions.DependencyInjection;
#pragma warning disable EF1001
// ReSharper disable once CheckNamespace
namespace Microsoft.EntityFrameworkCore.TestUtilities
{
public class InMemoryTestHelpers : TestHelpers
{
protected InMemoryTestHelpers()
{
}
public static InMemoryTestHelpers Instance { get; } = new();
public override IServiceCollection AddProviderServices(IServiceCollection services)
=> services.AddEntityFrameworkInMemoryDatabase();
public override void UseProviderOptions(DbContextOptionsBuilder optionsBuilder)
=> optionsBuilder.UseInMemoryDatabase(nameof(InMemoryTestHelpers));
public override LoggingDefinitions LoggingDefinitions { get; } = new InMemoryLoggingDefinitions();
}
}