31 lines
949 B
C#
31 lines
949 B
C#
// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved.
|
|
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
|
|
|
|
using Microsoft.AspNet.Http.Core;
|
|
using Microsoft.AspNet.Routing;
|
|
using Xunit;
|
|
|
|
namespace Microsoft.AspNet.Mvc
|
|
{
|
|
public class HttpStatusCodeResultTests
|
|
{
|
|
[Fact]
|
|
public void HttpStatusCodeResult_ExecuteResultSetsResponseStatusCode()
|
|
{
|
|
// Arrange
|
|
var result = new HttpStatusCodeResult(404);
|
|
|
|
var httpContext = new DefaultHttpContext();
|
|
var routeData = new RouteData();
|
|
var actionDescriptor = new ActionDescriptor();
|
|
|
|
var context = new ActionContext(httpContext, routeData, actionDescriptor);
|
|
|
|
// Act
|
|
result.ExecuteResult(context);
|
|
|
|
// Assert
|
|
Assert.Equal(404, httpContext.Response.StatusCode);
|
|
}
|
|
}
|
|
} |