From e5146ca3353feddfe815f3ee7101dde3641667b1 Mon Sep 17 00:00:00 2001 From: ajcvickers Date: Fri, 31 Jul 2020 08:10:06 -0700 Subject: [PATCH] Run two SaveChanges interception suites against different databases --- .../SaveChangesInterceptionSqlServerTest.cs | 10 ++++++---- .../SqlServerComplianceTest.cs | 7 ------- 2 files changed, 6 insertions(+), 11 deletions(-) diff --git a/test/EFCore.SqlServer.FunctionalTests/SaveChangesInterceptionSqlServerTest.cs b/test/EFCore.SqlServer.FunctionalTests/SaveChangesInterceptionSqlServerTest.cs index e7c42fe7131..3d3eba0c83b 100644 --- a/test/EFCore.SqlServer.FunctionalTests/SaveChangesInterceptionSqlServerTest.cs +++ b/test/EFCore.SqlServer.FunctionalTests/SaveChangesInterceptionSqlServerTest.cs @@ -20,8 +20,6 @@ protected SaveChangesInterceptionSqlServerTestBase(InterceptionSqlServerFixtureB public abstract class InterceptionSqlServerFixtureBase : InterceptionFixtureBase { - protected override string StoreName => "SaveChangesInterception"; - protected override ITestStoreFactory TestStoreFactory => SqlServerTestStoreFactory.Instance; protected override IServiceCollection InjectInterceptors( @@ -30,7 +28,7 @@ protected override IServiceCollection InjectInterceptors( => base.InjectInterceptors(serviceCollection.AddEntityFrameworkSqlServer(), injectedInterceptors); } - internal class SaveChangesInterceptionSqlServerTest + public class SaveChangesInterceptionSqlServerTest : SaveChangesInterceptionSqlServerTestBase, IClassFixture { public SaveChangesInterceptionSqlServerTest(InterceptionSqlServerFixture fixture) @@ -40,6 +38,8 @@ public SaveChangesInterceptionSqlServerTest(InterceptionSqlServerFixture fixture public class InterceptionSqlServerFixture : InterceptionSqlServerFixtureBase { + protected override string StoreName => "SaveChangesInterception"; + protected override bool ShouldSubscribeToDiagnosticListener => false; public override DbContextOptionsBuilder AddOptions(DbContextOptionsBuilder builder) @@ -51,7 +51,7 @@ public override DbContextOptionsBuilder AddOptions(DbContextOptionsBuilder build } } - internal class SaveChangesInterceptionWithDiagnosticsSqlServerTest + public class SaveChangesInterceptionWithDiagnosticsSqlServerTest : SaveChangesInterceptionSqlServerTestBase, IClassFixture { @@ -62,6 +62,8 @@ public SaveChangesInterceptionWithDiagnosticsSqlServerTest(InterceptionSqlServer public class InterceptionSqlServerFixture : InterceptionSqlServerFixtureBase { + protected override string StoreName => "SaveChangesInterceptionWithDiagnostics"; + protected override bool ShouldSubscribeToDiagnosticListener => true; public override DbContextOptionsBuilder AddOptions(DbContextOptionsBuilder builder) diff --git a/test/EFCore.SqlServer.FunctionalTests/SqlServerComplianceTest.cs b/test/EFCore.SqlServer.FunctionalTests/SqlServerComplianceTest.cs index 3bb7e02f303..c7a1bb0b267 100644 --- a/test/EFCore.SqlServer.FunctionalTests/SqlServerComplianceTest.cs +++ b/test/EFCore.SqlServer.FunctionalTests/SqlServerComplianceTest.cs @@ -1,19 +1,12 @@ // 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 System; -using System.Collections.Generic; using System.Reflection; namespace Microsoft.EntityFrameworkCore { public class SqlServerComplianceTest : RelationalComplianceTestBase { - protected override ICollection IgnoredTestBases => new List - { - typeof(SaveChangesInterceptionTestBase) - }; - protected override Assembly TargetAssembly { get; } = typeof(SqlServerComplianceTest).Assembly; } }