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


C# ItineraryController.RemoveRequest方法代码示例

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


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

示例1: RemoveRequestSendsRemoveRequestCommandWithCorrectData

        public async Task RemoveRequestSendsRemoveRequestCommandWithCorrectData()
        {
            var viewModel = new RequestSummaryViewModel { Id = Guid.NewGuid(), ItineraryId = 1, UserIsOrgAdmin = true };

            var mediator = new Mock<IMediator>();
            var sut = new ItineraryController(mediator.Object, null);

            await sut.RemoveRequest(viewModel);

            mediator.Verify(x => x.SendAsync(It.Is<RemoveRequestCommand>(y => y.RequestId == viewModel.Id && y.ItineraryId == viewModel.ItineraryId)));
        }
开发者ID:dpaquette,项目名称:allReady,代码行数:11,代码来源:ItineraryAdminControllerTests.cs

示例2: RemoveRequestRedirectsToCorrectActionWithCorrrectRouteValues

        public async Task RemoveRequestRedirectsToCorrectActionWithCorrrectRouteValues()
        {
            var viewModel = new RequestSummaryViewModel { ItineraryId = 1, UserIsOrgAdmin = true };

            var mediator = new Mock<IMediator>();
            var sut = new ItineraryController(mediator.Object, null);

            var result = await sut.RemoveRequest(viewModel) as RedirectToActionResult;

            var routeValueDictionary = new RouteValueDictionary { ["id"] = viewModel.ItineraryId };

            Assert.Equal(result.ActionName, "Details");
            Assert.Equal(result.RouteValues, routeValueDictionary);
        }
开发者ID:dpaquette,项目名称:allReady,代码行数:14,代码来源:ItineraryAdminControllerTests.cs

示例3: RemoveRequestReturnsUnathorizedResult_WhenUserIsNotOrgAdmin

 public async Task RemoveRequestReturnsUnathorizedResult_WhenUserIsNotOrgAdmin()
 {
     var sut = new ItineraryController(null, null);
     var result = await sut.RemoveRequest(new RequestSummaryViewModel { UserIsOrgAdmin = false });
     Assert.IsType<UnauthorizedResult>(result);
 }
开发者ID:dpaquette,项目名称:allReady,代码行数:6,代码来源:ItineraryAdminControllerTests.cs


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