9 references to WriteAsJsonAsync
Microsoft.AspNetCore.Http.Extensions.Tests (9)
HttpResponseJsonExtensionsTests.cs (9)
170await context.Response.WriteAsJsonAsync(1, typeof(int)); 189await context.Response.WriteAsJsonAsync(value: null, typeof(int?)); 207await Assert.ThrowsAsync<ArgumentNullException>(async () => await context.Response.WriteAsJsonAsync(value: null, type: null!)); 219await Assert.ThrowsAsync<ArgumentNullException>(async () => await HttpResponseJsonExtensions.WriteAsJsonAsync(response: null!, value: null, typeof(int?))); 235await context.Response.WriteAsJsonAsync(value, typeof(TestObject)); 252await context.Response.WriteAsJsonAsync(1, typeof(int)); 293await context.Response.WriteAsJsonAsync(AsyncEnumerable(), typeof(IAsyncEnumerable<int>)); 355await context.Response.WriteAsJsonAsync(AsyncEnumerable(), typeof(IAsyncEnumerable<int>)); 389await Assert.ThrowsAnyAsync<OperationCanceledException>(() => context.Response.WriteAsJsonAsync(AsyncEnumerable(), typeof(IAsyncEnumerable<int>), cts.Token));