本文整理汇总了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)));
}
示例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);
}
示例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);
}