28 lines
844 B
C#
28 lines
844 B
C#
|
// Copyright (c) Microsoft Corporation. All rights reserved. See License.txt in the project root for license information.
|
|||
|
|
|||
|
using Xunit;
|
|||
|
|
|||
|
namespace System.Web.Mvc.Test
|
|||
|
{
|
|||
|
public class HttpPostAttributeTest
|
|||
|
{
|
|||
|
[Fact]
|
|||
|
public void IsValidForRequestReturnsFalseIfHttpVerbIsNotPost()
|
|||
|
{
|
|||
|
HttpVerbAttributeHelper.TestHttpVerbAttributeWithInvalidVerb<HttpPostAttribute>("DELETE");
|
|||
|
}
|
|||
|
|
|||
|
[Fact]
|
|||
|
public void IsValidForRequestReturnsTrueIfHttpVerbIsPost()
|
|||
|
{
|
|||
|
HttpVerbAttributeHelper.TestHttpVerbAttributeWithValidVerb<HttpPostAttribute>("POST");
|
|||
|
}
|
|||
|
|
|||
|
[Fact]
|
|||
|
public void IsValidForRequestThrowsIfControllerContextIsNull()
|
|||
|
{
|
|||
|
HttpVerbAttributeHelper.TestHttpVerbAttributeNullControllerContext<HttpPostAttribute>();
|
|||
|
}
|
|||
|
}
|
|||
|
}
|