10 references to StringJsonContext
Microsoft.AspNetCore.Http.Results.Tests (10)
ResultsTests.cs (10)
984var result = Results.Json(null, StringJsonContext.Default.String as JsonTypeInfo) as JsonHttpResult<object>;
991Assert.Equal(StringJsonContext.Default.String, result.JsonTypeInfo);
998var result = Results.Json(null, typeof(string), StringJsonContext.Default) as JsonHttpResult<object>;
1012var result = Results.Json(null, StringJsonContext.Default.String) as JsonHttpResult<string>;
1019Assert.Equal(StringJsonContext.Default.String, result.JsonTypeInfo);
1026var result = Results.Json<string>(null, StringJsonContext.Default) as JsonHttpResult<string>;
1051var ex = Assert.Throws<InvalidOperationException>(() => Results.Json(null, type: typeof(Todo), context: StringJsonContext.Default));
1052Assert.Equal(ex.Message, $"Unable to obtain the JsonTypeInfo for type 'Microsoft.AspNetCore.Http.HttpResults.ResultsTests+Todo' from the context '{typeof(StringJsonContext).FullName}'.");
1058var ex = Assert.Throws<InvalidOperationException>(() => Results.Json<Todo>(null, context: StringJsonContext.Default));
1059Assert.Equal(ex.Message, $"Unable to obtain the JsonTypeInfo for type 'Microsoft.AspNetCore.Http.HttpResults.ResultsTests+Todo' from the context '{typeof(StringJsonContext).FullName}'.");