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/TransactionInterceptionJetT...

61 lines
2.3 KiB
C#

// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
using System.Collections.Generic;
using EntityFrameworkCore.Jet.FunctionalTests.TestUtilities;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Diagnostics;
using Microsoft.EntityFrameworkCore.TestUtilities;
using Microsoft.Extensions.DependencyInjection;
using Xunit;
namespace EntityFrameworkCore.Jet.FunctionalTests
{
public abstract class TransactionInterceptionJetTestBase : TransactionInterceptionTestBase
{
protected TransactionInterceptionJetTestBase(InterceptionJetFixtureBase fixture)
: base(fixture)
{
}
public abstract class InterceptionJetFixtureBase : InterceptionFixtureBase
{
protected override string StoreName => "TransactionInterception";
protected override ITestStoreFactory TestStoreFactory => JetTestStoreFactory.Instance;
protected override IServiceCollection InjectInterceptors(
IServiceCollection serviceCollection,
IEnumerable<IInterceptor> injectedInterceptors)
=> base.InjectInterceptors(serviceCollection.AddEntityFrameworkJet(), injectedInterceptors);
}
public class TransactionInterceptionJetTest
: TransactionInterceptionJetTestBase, IClassFixture<TransactionInterceptionJetTest.InterceptionJetFixture>
{
public TransactionInterceptionJetTest(InterceptionJetFixture fixture)
: base(fixture)
{
}
public class InterceptionJetFixture : InterceptionJetFixtureBase
{
protected override bool ShouldSubscribeToDiagnosticListener => false;
}
}
public class TransactionInterceptionWithDiagnosticsJetTest
: TransactionInterceptionJetTestBase,
IClassFixture<TransactionInterceptionWithDiagnosticsJetTest.InterceptionJetFixture>
{
public TransactionInterceptionWithDiagnosticsJetTest(InterceptionJetFixture fixture)
: base(fixture)
{
}
public class InterceptionJetFixture : InterceptionJetFixtureBase
{
protected override bool ShouldSubscribeToDiagnosticListener => true;
}
}
}
}