Skip to content

Commit ce55119

Browse files
committed
Fix Http Results test to respond to dotnet/runtime#87093
1 parent ba05754 commit ce55119

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/Http/Http.Results/test/ResultsTests.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1009,15 +1009,15 @@ public void Json_WithNullSerializerContext_ThrowsArgException()
10091009
[Fact]
10101010
public void Json_WithInvalidSerializerContext_ThrowsInvalidOperationException()
10111011
{
1012-
var ex = Assert.Throws<InvalidOperationException>(() => Results.Json(null, type: typeof(object), context: StringJsonContext.Default));
1013-
Assert.Equal(ex.Message, $"Unable to obtain the JsonTypeInfo for type 'System.Object' from the context '{typeof(StringJsonContext).FullName}'.");
1012+
var ex = Assert.Throws<InvalidOperationException>(() => Results.Json(null, type: typeof(Todo), context: StringJsonContext.Default));
1013+
Assert.Equal(ex.Message, $"Unable to obtain the JsonTypeInfo for type 'Microsoft.AspNetCore.Http.HttpResults.ResultsTests+Todo' from the context '{typeof(StringJsonContext).FullName}'.");
10141014
}
10151015

10161016
[Fact]
10171017
public void JsonOfT_WithInvalidSerializerContext_ThrowsInvalidOperationException()
10181018
{
1019-
var ex = Assert.Throws<InvalidOperationException>(() => Results.Json<object>(null, context: StringJsonContext.Default));
1020-
Assert.Equal(ex.Message, $"Unable to obtain the JsonTypeInfo for type 'System.Object' from the context '{typeof(StringJsonContext).FullName}'.");
1019+
var ex = Assert.Throws<InvalidOperationException>(() => Results.Json<Todo>(null, context: StringJsonContext.Default));
1020+
Assert.Equal(ex.Message, $"Unable to obtain the JsonTypeInfo for type 'Microsoft.AspNetCore.Http.HttpResults.ResultsTests+Todo' from the context '{typeof(StringJsonContext).FullName}'.");
10211021
}
10221022

10231023
[Fact]

0 commit comments

Comments
 (0)