当前位置: 首页>>代码示例>>C#>>正文


C# TaskApiController.GetAttributesOn方法代码示例

本文整理汇总了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);
 }
开发者ID:codethug,项目名称:allReady,代码行数:6,代码来源:TaskApiControllerTests.cs

示例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");
 }
开发者ID:codethug,项目名称:allReady,代码行数:7,代码来源:TaskApiControllerTests.cs

示例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);
 }
开发者ID:codethug,项目名称:allReady,代码行数:6,代码来源:TaskApiControllerTests.cs

示例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");
 }
开发者ID:codethug,项目名称:allReady,代码行数:7,代码来源:TaskApiControllerTests.cs

示例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");
        }
开发者ID:codethug,项目名称:allReady,代码行数:8,代码来源:TaskApiControllerTests.cs

示例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");
        }
开发者ID:codethug,项目名称:allReady,代码行数:8,代码来源:TaskApiControllerTests.cs

示例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);
 }
开发者ID:codethug,项目名称:allReady,代码行数:6,代码来源:TaskApiControllerTests.cs

示例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}");
 }
开发者ID:codethug,项目名称:allReady,代码行数:7,代码来源:TaskApiControllerTests.cs

示例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);
 }
开发者ID:codethug,项目名称:allReady,代码行数:6,代码来源:TaskApiControllerTests.cs


注:本文中的AllReady.Controllers.TaskApiController.GetAttributesOn方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。