本文整理汇总了C#中AllReady.Controllers.TaskApiController.GetAttributesOn方法的典型用法代码示例。如果您正苦于以下问题:C# TaskApiController.GetAttributesOn方法的具体用法?C# TaskApiController.GetAttributesOn怎么用?C# TaskApiController.GetAttributesOn使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类AllReady.Controllers.TaskApiController
的用法示例。
在下文中一共展示了TaskApiController.GetAttributesOn方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ChangeStatusHasValidateAntiForgeryTokenAttribute
public void ChangeStatusHasValidateAntiForgeryTokenAttribute()
{
var sut = new TaskApiController(null, null);
var attribute = sut.GetAttributesOn(x => x.ChangeStatus(It.IsAny<TaskChangeModel>())).OfType<ValidateAntiForgeryTokenAttribute>().SingleOrDefault();
Assert.NotNull(attribute);
}
示例2: ChangeStatusHasRouteAttributeWithCorrectTemplate
public void ChangeStatusHasRouteAttributeWithCorrectTemplate()
{
var sut = new TaskApiController(null, null);
var attribute = sut.GetAttributesOn(x => x.ChangeStatus(It.IsAny<TaskChangeModel>())).OfType<RouteAttribute>().SingleOrDefault();
Assert.NotNull(attribute);
Assert.Equal(attribute.Template, "changestatus");
}
示例3: UnregisterTaskHasAuthorizeAttrbiute
public void UnregisterTaskHasAuthorizeAttrbiute()
{
var sut = new TaskApiController(null, null);
var attribute = sut.GetAttributesOn(x => x.UnregisterTask(It.IsAny<int>())).OfType<AuthorizeAttribute>().SingleOrDefault();
Assert.NotNull(attribute);
}
示例4: UnregisterTaskHasHttpDeleteAttributeWithCorrectTemplate
public void UnregisterTaskHasHttpDeleteAttributeWithCorrectTemplate()
{
var sut = new TaskApiController(null, null);
var attribute = sut.GetAttributesOn(x => x.UnregisterTask(It.IsAny<int>())).OfType<HttpDeleteAttribute>().SingleOrDefault();
Assert.NotNull(attribute);
Assert.Equal(attribute.Template, "{id}/signup");
}
示例5: RegisterTaskHasHasProducesAtttributeWithTheCorrectContentType
public void RegisterTaskHasHasProducesAtttributeWithTheCorrectContentType()
{
var sut = new TaskApiController(null, null);
var attribute = sut.GetAttributesOn(x => x.RegisterTask(It.IsAny<EventSignupViewModel>())).OfType<ProducesAttribute>().SingleOrDefault();
Assert.NotNull(attribute);
Assert.Equal(attribute.ContentTypes.Select(x => x.MediaType).First(), "application/json");
}
示例6: RegisterTaskHasHttpPostAttributeWithCorrectTemplate
public void RegisterTaskHasHttpPostAttributeWithCorrectTemplate()
{
var sut = new TaskApiController(null, null);
var attribute = sut.GetAttributesOn(x => x.RegisterTask(It.IsAny<EventSignupViewModel>())).OfType<HttpPostAttribute>().SingleOrDefault();
Assert.NotNull(attribute);
Assert.Equal(attribute.Template, "signup");
}
示例7: RegisterTaskHasValidateAntiForgeryTokenAttrbiute
public void RegisterTaskHasValidateAntiForgeryTokenAttrbiute()
{
var sut = new TaskApiController(null, null);
var attribute = sut.GetAttributesOn(x => x.RegisterTask(It.IsAny<EventSignupViewModel>())).OfType<ValidateAntiForgeryTokenAttribute>().SingleOrDefault();
Assert.NotNull(attribute);
}
示例8: PutHasHttpPutAttributeWithCorrectTemplate
public void PutHasHttpPutAttributeWithCorrectTemplate()
{
var sut = new TaskApiController(null, null);
var attribute = sut.GetAttributesOn(x => x.Put(It.IsAny<int>(), It.IsAny<TaskViewModel>())).OfType<HttpPutAttribute>().SingleOrDefault();
Assert.NotNull(attribute);
Assert.Equal(attribute.Template, "{id}");
}
示例9: PostHasHttpPostAttribute
public void PostHasHttpPostAttribute()
{
var sut = new TaskApiController(null, null);
var attribute = sut.GetAttributesOn(x => x.Post(It.IsAny<TaskViewModel>())).OfType<HttpPostAttribute>().SingleOrDefault();
Assert.NotNull(attribute);
}