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


C# EventApiController.GetAttributesOn方法代码示例

本文整理汇总了C#中AllReady.Controllers.EventApiController.GetAttributesOn方法的典型用法代码示例。如果您正苦于以下问题:C# EventApiController.GetAttributesOn方法的具体用法?C# EventApiController.GetAttributesOn怎么用?C# EventApiController.GetAttributesOn使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在AllReady.Controllers.EventApiController的用法示例。


在下文中一共展示了EventApiController.GetAttributesOn方法的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: GetByIdHasProducesAttributeWithCorrectContentTypes

 public void GetByIdHasProducesAttributeWithCorrectContentTypes()
 {
     var sut = new EventApiController(null, null);
     var attribute = sut.GetAttributesOn(x => x.Get(It.IsAny<int>())).OfType<ProducesAttribute>().SingleOrDefault();
     Assert.NotNull(attribute);
     Assert.Equal(attribute.Type, typeof(EventViewModel));
     Assert.Equal(attribute.ContentTypes.Select(x => x).First(), "application/json");
 }
开发者ID:gftrader,项目名称:allReady,代码行数:8,代码来源:EventApiControllerTests.cs

示例2: UnregisterEventHasAuthorizeAttribute

 public void UnregisterEventHasAuthorizeAttribute()
 {
     var sut = new EventApiController(null, null);
     var attribute = (AuthorizeAttribute)sut.GetAttributesOn(x => x.UnregisterEvent(It.IsAny<int>())).SingleOrDefault(x => x.GetType() == typeof(AuthorizeAttribute));
     Assert.NotNull(attribute);
 }
开发者ID:gftrader,项目名称:allReady,代码行数:6,代码来源:EventApiControllerTests.cs

示例3: GetByIdHasHttpGetAttributeWithCorrectTemplate

 public void GetByIdHasHttpGetAttributeWithCorrectTemplate()
 {
     var sut = new EventApiController(null, null);
     var attribute = sut.GetAttributesOn(x => x.Get(It.IsAny<int>())).OfType<HttpGetAttribute>().SingleOrDefault();
     Assert.NotNull(attribute);
     Assert.Equal(attribute.Template, "{id}");
 }
开发者ID:gftrader,项目名称:allReady,代码行数:7,代码来源:EventApiControllerTests.cs

示例4: GetHasHttpGetAttribute

 public void GetHasHttpGetAttribute()
 {
     var sut = new EventApiController(null, null);
     var attribute = sut.GetAttributesOn(x => x.Get()).OfType<HttpGetAttribute>().SingleOrDefault();
     Assert.NotNull(attribute);
 }
开发者ID:gftrader,项目名称:allReady,代码行数:6,代码来源:EventApiControllerTests.cs

示例5: UnregisterEventHasHttpDeleteAttributeWithCorrectTemplate

 public void UnregisterEventHasHttpDeleteAttributeWithCorrectTemplate()
 {
     var sut = new EventApiController(null, null);
     var attribute = (HttpDeleteAttribute)sut.GetAttributesOn(x => x.UnregisterEvent(It.IsAny<int>())).SingleOrDefault(x => x.GetType() == typeof(HttpDeleteAttribute));
     Assert.NotNull(attribute);
     Assert.Equal(attribute.Template, "{id}/signup");
 }
开发者ID:gftrader,项目名称:allReady,代码行数:7,代码来源:EventApiControllerTests.cs

示例6: RegisterEventHasValidateAntiForgeryTokenAttribute

 public void RegisterEventHasValidateAntiForgeryTokenAttribute()
 {
     var sut = new EventApiController(null, null);
     var attribute = (ValidateAntiForgeryTokenAttribute)sut.GetAttributesOn(x => x.RegisterEvent(It.IsAny<EventSignupViewModel>())).SingleOrDefault(x => x.GetType() == typeof(ValidateAntiForgeryTokenAttribute));
     Assert.NotNull(attribute);
 }
开发者ID:gftrader,项目名称:allReady,代码行数:6,代码来源:EventApiControllerTests.cs

示例7: RegisterEventHasHttpPostAttributeWithCorrectTemplate

 public void RegisterEventHasHttpPostAttributeWithCorrectTemplate()
 {
     var sut = new EventApiController(null, null);
     var attribute = (HttpPostAttribute)sut.GetAttributesOn(x => x.RegisterEvent(It.IsAny<EventSignupViewModel>())).SingleOrDefault(x => x.GetType() == typeof(HttpPostAttribute));
     Assert.NotNull(attribute);
     Assert.Equal(attribute.Template, "signup");
 }
开发者ID:gftrader,项目名称:allReady,代码行数:7,代码来源:EventApiControllerTests.cs

示例8: PutCheckinHasHttpPutAttributeWithCorrectTemplate

 public void PutCheckinHasHttpPutAttributeWithCorrectTemplate()
 {
     var sut = new EventApiController(null, null);
     var attribute = (HttpPutAttribute)sut.GetAttributesOn(x => x.PutCheckin(It.IsAny<int>())).SingleOrDefault(x => x.GetType() == typeof(HttpPutAttribute));
     Assert.NotNull(attribute);
     Assert.Equal(attribute.Template, "{id}/checkin");
 }
开发者ID:gftrader,项目名称:allReady,代码行数:7,代码来源:EventApiControllerTests.cs

示例9: GetEventsByLocationHasRouteAttributeWithCorrectRoute

 public void GetEventsByLocationHasRouteAttributeWithCorrectRoute()
 {
     var sut = new EventApiController(null, null);
     var attribute = sut.GetAttributesOn(x => x.GetEventsByGeography(It.IsAny<double>(), It.IsAny<double>(), It.IsAny<int>())).OfType<RouteAttribute>().SingleOrDefault();
     Assert.NotNull(attribute);
     Assert.Equal(attribute.Template, "searchbylocation");
 }
开发者ID:gftrader,项目名称:allReady,代码行数:7,代码来源:EventApiControllerTests.cs

示例10: GetEventsByPostalCodeHasRouteAttributeWithRoute

 public void GetEventsByPostalCodeHasRouteAttributeWithRoute()
 {
     var sut = new EventApiController(null, null);
     var attribute = sut.GetAttributesOn(x => x.GetEventsByPostalCode(It.IsAny<string>(), It.IsAny<int>())).OfType<RouteAttribute>().SingleOrDefault();
     Assert.NotNull(attribute);
     Assert.Equal(attribute.Template, "search");
 }
开发者ID:gftrader,项目名称:allReady,代码行数:7,代码来源:EventApiControllerTests.cs

示例11: GetEventsByDateRangeHasProducesAttribute

 public void GetEventsByDateRangeHasProducesAttribute()
 {
     var sut = new EventApiController(null);
     var attribute = sut.GetAttributesOn(x => x.GetEventsByDateRange(It.IsAny<DateTimeOffset>(), It.IsAny<DateTimeOffset>())).OfType<ProducesAttribute>().SingleOrDefault();
     Assert.NotNull(attribute);
     Assert.Equal(attribute.ContentTypes[0], "application/json");
     Assert.Equal(attribute.Type, typeof(EventViewModel));
 }
开发者ID:nicolastarzia,项目名称:allReady,代码行数:8,代码来源:EventApiControllerTests.cs

示例12: GetEventsByDateRangeHasHttpGetAttributeWithCorrectTemplate

 public void GetEventsByDateRangeHasHttpGetAttributeWithCorrectTemplate()
 {
     var sut = new EventApiController(null);
     var attribute = sut.GetAttributesOn(x => x.GetEventsByDateRange(It.IsAny<DateTimeOffset>(), It.IsAny<DateTimeOffset>())).OfType<HttpGetAttribute>().SingleOrDefault();
     Assert.NotNull(attribute);
     Assert.Equal(attribute.Template, "{start}/{end}");
 }
开发者ID:nicolastarzia,项目名称:allReady,代码行数:7,代码来源:EventApiControllerTests.cs


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