Skip to content

Commit b78ca79

Browse files
committed
Fixed failing tests
1 parent eb8ad6f commit b78ca79

File tree

4 files changed

+6
-4
lines changed

4 files changed

+6
-4
lines changed

src/MyTested.AspNetCore.Mvc.Abstractions/Internal/TestFramework.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,7 @@
77
public static class TestFramework
88
{
99
public const string TestFrameworkName = "MyTested.AspNetCore.Mvc";
10-
public const string ReleaseDate = "2023-11-19";
11-
public const string VersionPrefix = "8.0";
10+
public const string VersionPrefix = "9.0";
1211

1312
internal static void EnsureCorrectVersion(DependencyContext dependencyContext)
1413
{

src/MyTested.AspNetCore.Mvc.EntityFrameworkCore/ServiceCollectionEntityFrameworkCoreExtensions.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,9 @@ public static IServiceCollection ReplaceDbContext(this IServiceCollection servic
7272
private static void AddScopedDatabase<TDbContextService, TDbContextImplementation>(IServiceCollection serviceCollection)
7373
where TDbContextImplementation : DbContext, TDbContextService
7474
{
75+
// See: https://github.com/dotnet/efcore/issues/35126#issuecomment-2576387727
76+
serviceCollection.RemoveAll<IDbContextOptionsConfiguration<TDbContextImplementation>>();
77+
7578
serviceCollection.AddScoped(s => s.GetRequiredService<TDbContextService>() as DbContext);
7679

7780
if (typeof(TDbContextService) != typeof(TDbContextImplementation))

test/MyTested.AspNetCore.Mvc.Routing.Test/InternalTests/RoutingTests/MvcRouteResolverTests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -310,7 +310,7 @@ public void ResolveShouldReturnProperErrorWhenTwoActionsAreMatched()
310310

311311
Assert.False(routeInfo.IsResolved);
312312
Assert.Equal(
313-
"exception was thrown when trying to select an action: 'Multiple actions matched. The following actions matched route data and had all constraints satisfied:\r\n\r\nMyTested.AspNetCore.Mvc.Test.Setups.Routing.NormalController.ActionWithOverloads (MyTested.AspNetCore.Mvc.Test.Setups)\r\nMyTested.AspNetCore.Mvc.Test.Setups.Routing.NormalController.ActionWithOverloads (MyTested.AspNetCore.Mvc.Test.Setups)'",
313+
"exception was thrown when trying to select an action: 'Multiple actions matched. The following actions matched route data and had all constraints satisfied:\n\nMyTested.AspNetCore.Mvc.Test.Setups.Routing.NormalController.ActionWithOverloads (MyTested.AspNetCore.Mvc.Test.Setups)\nMyTested.AspNetCore.Mvc.Test.Setups.Routing.NormalController.ActionWithOverloads (MyTested.AspNetCore.Mvc.Test.Setups)'",
314314
routeInfo.UnresolvedError);
315315
Assert.Null(routeInfo.ControllerType);
316316
Assert.Null(routeInfo.ControllerName);

test/MyTested.AspNetCore.Mvc.ViewData.Test/PluginsTests/ViewDataTestPluginTests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ public void ShouldInvokeMethodOfTypeVoidWithValidServiceCollection()
3333

3434
testPlugin.DefaultServiceRegistrationDelegate(serviceCollection);
3535

36-
Assert.True(serviceCollection.Count == 191);
36+
Assert.Equal(194, serviceCollection.Count);
3737
}
3838
}
3939
}

0 commit comments

Comments
 (0)