An action result that returns an empty HttpStatusCode.Conflict response.
Inheritance: HttpStatusCodeResult
        public async Task ConflictResult_SetsStatusCode()
        {
            // Arrange
            var context = new ActionContext(new DefaultHttpContext(), new RouteData(), new ActionDescriptor());
            var result = new ConflictResult();

            // Act
            await result.ExecuteResultAsync(context);

            // Assert
            Assert.Equal(StatusCodes.Status409Conflict, context.HttpContext.Response.StatusCode);
        }
Esempio n. 2
0
        public async Task ConflictResult_SetsStatusCode()
        {
            // Arrange
            var context = new ActionContext(new DefaultHttpContext(), new RouteData(), new ActionDescriptor());
            var result  = new ConflictResult();

            // Act
            await result.ExecuteResultAsync(context);

            // Assert
            Assert.Equal(StatusCodes.Status409Conflict, context.HttpContext.Response.StatusCode);
        }