Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Run dependency object tests automatically for all dependency objects #20684

Merged
merged 1 commit into from
Apr 20, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -293,7 +293,7 @@ public StateManagerDependencies With([NotNull] IInternalEntityEntryNotifier inte
/// </summary>
/// <param name="valueGenerationManager"> A replacement for the current dependency of this type. </param>
/// <returns> A new parameter object with the given service replaced. </returns>
public StateManagerDependencies With([NotNull] ValueGenerationManager valueGenerationManager)
public StateManagerDependencies With([NotNull] IValueGenerationManager valueGenerationManager)
=> new StateManagerDependencies(
InternalEntityEntryFactory,
InternalEntityEntrySubscriber,
Expand Down
12 changes: 9 additions & 3 deletions test/EFCore.Cosmos.Tests/CosmosApiConsistencyTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
using System.Collections.Generic;
using System.Reflection;
using Microsoft.EntityFrameworkCore.Cosmos.Storage.Internal;
using Microsoft.EntityFrameworkCore.Cosmos.TestUtilities;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Metadata;
using Microsoft.Extensions.DependencyInjection;
Expand All @@ -19,14 +20,19 @@ public CosmosApiConsistencyTest(CosmosApiConsistencyFixture fixture)
}

protected override void AddServices(ServiceCollection serviceCollection)
{
serviceCollection.AddEntityFrameworkCosmos();
}
=> serviceCollection.AddEntityFrameworkCosmos();

protected override Assembly TargetAssembly => typeof(CosmosDatabaseWrapper).Assembly;

public class CosmosApiConsistencyFixture : ApiConsistencyFixtureBase
{
public override bool TryGetProviderOptionsDelegate(out Action<DbContextOptionsBuilder> configureOptions)
{
configureOptions = b => CosmosTestHelpers.Instance.UseProviderOptions(b);

return true;
}

public override HashSet<Type> FluentApiTypes { get; } = new HashSet<Type>
{
typeof(CosmosModelBuilderExtensions),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ protected CosmosTestHelpers()
public override IServiceCollection AddProviderServices(IServiceCollection services)
=> services.AddEntityFrameworkCosmos();

protected override void UseProviderOptions(DbContextOptionsBuilder optionsBuilder)
public override void UseProviderOptions(DbContextOptionsBuilder optionsBuilder)
=> optionsBuilder.UseCosmos(
TestEnvironment.DefaultConnection,
TestEnvironment.AuthToken,
Expand Down
8 changes: 8 additions & 0 deletions test/EFCore.Design.Tests/DesignApiConsistencyTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
using System.Collections.Generic;
using System.Reflection;
using Microsoft.EntityFrameworkCore.Design;
using Microsoft.EntityFrameworkCore.TestUtilities;
using Microsoft.Extensions.DependencyInjection;

namespace Microsoft.EntityFrameworkCore
Expand All @@ -24,6 +25,13 @@ protected override void AddServices(ServiceCollection serviceCollection)

public class DesignApiConsistencyFixture : ApiConsistencyFixtureBase
{
public override bool TryGetProviderOptionsDelegate(out Action<DbContextOptionsBuilder> configureOptions)
{
configureOptions = b => InMemoryTestHelpers.Instance.UseProviderOptions(b);

return true;
}

public override HashSet<Type> FluentApiTypes { get; } = new HashSet<Type>()
{
typeof(DesignTimeServiceCollectionExtensions)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ protected InMemoryTestHelpers()
public override IServiceCollection AddProviderServices(IServiceCollection services)
=> services.AddEntityFrameworkInMemoryDatabase();

protected override void UseProviderOptions(DbContextOptionsBuilder optionsBuilder)
public override void UseProviderOptions(DbContextOptionsBuilder optionsBuilder)
=> optionsBuilder.UseInMemoryDatabase(nameof(InMemoryTestHelpers));

public override LoggingDefinitions LoggingDefinitions { get; } = new InMemoryLoggingDefinitions();
Expand Down
12 changes: 9 additions & 3 deletions test/EFCore.InMemory.Tests/InMemoryApiConsistencyTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
using System.Reflection;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.InMemory.Storage.Internal;
using Microsoft.EntityFrameworkCore.TestUtilities;
using Microsoft.Extensions.DependencyInjection;

namespace Microsoft.EntityFrameworkCore
Expand All @@ -18,14 +19,19 @@ public InMemoryApiConsistencyTest(InMemoryApiConsistencyFixture fixture)
}

protected override void AddServices(ServiceCollection serviceCollection)
{
serviceCollection.AddEntityFrameworkInMemoryDatabase();
}
=> serviceCollection.AddEntityFrameworkInMemoryDatabase();

protected override Assembly TargetAssembly => typeof(InMemoryDatabase).Assembly;

public class InMemoryApiConsistencyFixture : ApiConsistencyFixtureBase
{
public override bool TryGetProviderOptionsDelegate(out Action<DbContextOptionsBuilder> configureOptions)
{
configureOptions = b => InMemoryTestHelpers.Instance.UseProviderOptions(b);

return true;
}

public override HashSet<Type> FluentApiTypes { get; } = new HashSet<Type>()
{
typeof(InMemoryServiceCollectionExtensions),
Expand Down
12 changes: 9 additions & 3 deletions test/EFCore.Proxies.Tests/ProxiesApiConsistencyTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
using System;
using System.Collections.Generic;
using System.Reflection;
using Microsoft.EntityFrameworkCore.TestUtilities;
using Microsoft.Extensions.DependencyInjection;

namespace Microsoft.EntityFrameworkCore
Expand All @@ -16,14 +17,19 @@ public ProxiesApiConsistencyTest(ProxiesApiConsistencyFixture fixture)
}

protected override void AddServices(ServiceCollection serviceCollection)
{
serviceCollection.AddEntityFrameworkProxies();
}
=> serviceCollection.AddEntityFrameworkProxies();

protected override Assembly TargetAssembly => typeof(ProxiesExtensions).Assembly;

public class ProxiesApiConsistencyFixture : ApiConsistencyFixtureBase
{
public override bool TryGetProviderOptionsDelegate(out Action<DbContextOptionsBuilder> configureOptions)
{
configureOptions = b => InMemoryTestHelpers.Instance.UseProviderOptions(b);

return true;
}

public override HashSet<Type> FluentApiTypes { get; } = new HashSet<Type>()
{
typeof(ProxiesServiceCollectionExtensions)
Expand Down
4 changes: 4 additions & 0 deletions test/EFCore.Relational.Tests/EFCore.Relational.Tests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,8 @@
<Compile Update="TestUtilities\FakeProvider\FakeDbConnection.cs" />
</ItemGroup>

<ItemGroup>
<Folder Include="Query" />
</ItemGroup>

</Project>

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

Loading