9 references to WriteAsJsonAsync
Microsoft.AspNetCore.Http.Extensions.Tests (9)
HttpResponseJsonExtensionsTests.cs (9)
167await context.Response.WriteAsJsonAsync(1, typeof(int));
186await context.Response.WriteAsJsonAsync(value: null, typeof(int?));
204await Assert.ThrowsAsync<ArgumentNullException>(async () => await context.Response.WriteAsJsonAsync(value: null, type: null!));
216await Assert.ThrowsAsync<ArgumentNullException>(async () => await HttpResponseJsonExtensions.WriteAsJsonAsync(response: null!, value: null, typeof(int?)));
232await context.Response.WriteAsJsonAsync(value, typeof(TestObject));
249await context.Response.WriteAsJsonAsync(1, typeof(int));
290await context.Response.WriteAsJsonAsync(AsyncEnumerable(), typeof(IAsyncEnumerable<int>));
352await context.Response.WriteAsJsonAsync(AsyncEnumerable(), typeof(IAsyncEnumerable<int>));
386await Assert.ThrowsAnyAsync<OperationCanceledException>(() => context.Response.WriteAsJsonAsync(AsyncEnumerable(), typeof(IAsyncEnumerable<int>), cts.Token));