public async Task HttpOkResult_SetsStatusCode() { // Arrange var context = new ActionContext(new DefaultHttpContext(), new RouteData(), new ActionDescriptor()); var result = new HttpOkResult(); // Act await result.ExecuteResultAsync(context); // Assert Assert.Equal(StatusCodes.Status200OK, context.HttpContext.Response.StatusCode); }
public async Task HttpOkResult_SetsStatusCode() { // Arrange var context = new ActionContext(new DefaultHttpContext(), new RouteData(), new ActionDescriptor()); var result = new HttpOkResult(); // Act await result.ExecuteResultAsync(context); // Assert Assert.Equal(StatusCodes.Status200OK, context.HttpContext.Response.StatusCode); }
public async Task HttpOkResult_SetsStatusCode() { // Arrange var httpContext = new DefaultHttpContext(); httpContext.RequestServices = CreateServices().BuildServiceProvider(); var context = new ActionContext(httpContext, new RouteData(), new ActionDescriptor()); var result = new HttpOkResult(); // Act await result.ExecuteResultAsync(context); // Assert Assert.Equal(StatusCodes.Status200OK, context.HttpContext.Response.StatusCode); }
public async Task HttpOkResult_SetsStatusCode() { // Arrange var httpContext = new DefaultHttpContext(); httpContext.RequestServices = CreateServices().BuildServiceProvider(); var context = new ActionContext(httpContext, new RouteData(), new ActionDescriptor()); var result = new HttpOkResult(); // Act await result.ExecuteResultAsync(context); // Assert Assert.Equal(StatusCodes.Status200OK, context.HttpContext.Response.StatusCode); }