Skip to content

Commit 9cae77c

Browse files
committed
Fixed WithRouteData exception message (closes #197)
1 parent 5a0f6fb commit 9cae77c

File tree

4 files changed

+3
-4
lines changed

4 files changed

+3
-4
lines changed

src/MyTested.AspNetCore.Mvc.Controllers/Utilities/Validators/ActionValidator.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ public static void CheckForException(Exception exception)
3434
var exceptionAsArgumentOutOfRangeException = exception as ArgumentOutOfRangeException;
3535
if (exceptionAsArgumentOutOfRangeException != null && exceptionAsArgumentOutOfRangeException.StackTrace.Contains("Microsoft.AspNetCore.Mvc.Routing"))
3636
{
37-
throw new InvalidOperationException("Route values are not present in the action call but are needed for successful pass of this test case. Consider calling 'WithResolvedRouteValues' on the controller builder to resolve them from the provided lambda expression or set the HTTP request path by using 'WithHttpRequest'.");
37+
throw new InvalidOperationException("Route values are not present in the method call but are needed for successful pass of this test case. Consider calling 'WithRouteData' on the component builder to resolve them from the provided lambda expression or set the HTTP request path by using 'WithHttpRequest'.");
3838
}
3939

4040
throw new ActionCallAssertionException(string.Format(

src/MyTested.AspNetCore.Mvc/MyTested.AspNetCore.Mvc.xproj

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818
<SchemaVersion>2.0</SchemaVersion>
1919
</PropertyGroup>
2020
<Import Project="$(VSToolsPath)\DotNet\Microsoft.DotNet.targets" Condition="'$(VSToolsPath)' != ''" />
21-
2221
<Target Name="AfterBuild">
2322
<Exec Condition="'$(Configuration)|$(Platform)'=='Release|AnyCPU'" Command="dotnet pack --configuration Release --output ../../artifacts --no-build"/>
2423
</Target>

test/MyTested.AspNetCore.Mvc.Controllers.Test/BuildersTests/ControllersTests/ControllerBuilderTests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ public void UnresolvedRouteValuesShouldHaveFriendlyException()
159159
.Ok()
160160
.WithModel("");
161161
},
162-
"Route values are not present in the action call but are needed for successful pass of this test case. Consider calling 'WithResolvedRouteValues' on the controller builder to resolve them from the provided lambda expression or set the HTTP request path by using 'WithHttpRequest'.");
162+
"Route values are not present in the method call but are needed for successful pass of this test case. Consider calling 'WithRouteData' on the component builder to resolve them from the provided lambda expression or set the HTTP request path by using 'WithHttpRequest'.");
163163
}
164164

165165
[Fact]

test/MyTested.AspNetCore.Mvc.ViewFeatures.Test/BuildersTests/ControllersTests/ControllerBuilderTests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -519,7 +519,7 @@ public void UnresolvedRouteValuesShouldHaveFriendlyExceptionForPocoController()
519519
.Ok()
520520
.WithModel("");
521521
},
522-
"Route values are not present in the action call but are needed for successful pass of this test case. Consider calling 'WithResolvedRouteValues' on the controller builder to resolve them from the provided lambda expression or set the HTTP request path by using 'WithHttpRequest'.");
522+
"Route values are not present in the method call but are needed for successful pass of this test case. Consider calling 'WithRouteData' on the component builder to resolve them from the provided lambda expression or set the HTTP request path by using 'WithHttpRequest'.");
523523

524524
MyApplication.IsUsingDefaultConfiguration();
525525
}

0 commit comments

Comments
 (0)