27 lines
861 B
C#
27 lines
861 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 HttpOptionsAttributeTest
|
|||
|
{
|
|||
|
[Fact]
|
|||
|
public void IsValidForRequestReturnsFalseIfHttpVerbIsNotOptions()
|
|||
|
{
|
|||
|
HttpVerbAttributeHelper.TestHttpVerbAttributeWithInvalidVerb<HttpOptionsAttribute>("GET");
|
|||
|
}
|
|||
|
|
|||
|
[Fact]
|
|||
|
public void IsValidForRequestReturnsTrueIfHttpVerbIsOptions()
|
|||
|
{
|
|||
|
HttpVerbAttributeHelper.TestHttpVerbAttributeWithValidVerb<HttpOptionsAttribute>("OPTIONS");
|
|||
|
}
|
|||
|
|
|||
|
[Fact]
|
|||
|
public void IsValidForRequestThrowsIfControllerContextIsNull()
|
|||
|
{
|
|||
|
HttpVerbAttributeHelper.TestHttpVerbAttributeNullControllerContext<HttpOptionsAttribute>();
|
|||
|
}
|
|||
|
}
|
|||
|
}
|