本文整理汇总了C#中AllReady.Areas.Admin.Controllers.ItineraryController.MakeUserNotAnOrgAdmin方法的典型用法代码示例。如果您正苦于以下问题:C# ItineraryController.MakeUserNotAnOrgAdmin方法的具体用法?C# ItineraryController.MakeUserNotAnOrgAdmin怎么用?C# ItineraryController.MakeUserNotAnOrgAdmin使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类AllReady.Areas.Admin.Controllers.ItineraryController
的用法示例。
在下文中一共展示了ItineraryController.MakeUserNotAnOrgAdmin方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: AddRequestsReturnsHttpUnauthorizedWhenUserIsNotOrgAdmin
public async Task AddRequestsReturnsHttpUnauthorizedWhenUserIsNotOrgAdmin()
{
var itineraryId = It.IsAny<int>();
var selectedRequests = new List<string> { "request1", "request2" };
var mockMediator = new Mock<IMediator>();
mockMediator.Setup(x => x.SendAsync(It.IsAny<OrganizationIdQuery>())).ReturnsAsync(1);
var sut = new ItineraryController(mockMediator.Object, null);
sut.MakeUserNotAnOrgAdmin();
Assert.IsType<UnauthorizedResult>(await sut.AddRequests(itineraryId, selectedRequests));
}
示例2: DetailsReturnsHttpUnauthorizedResultWhenUserIsNotOrgAdmin
public async Task DetailsReturnsHttpUnauthorizedResultWhenUserIsNotOrgAdmin()
{
var mediator = new Mock<IMediator>();
mediator.Setup(x => x.SendAsync(It.IsAny<ItineraryDetailQuery>())).ReturnsAsync(new ItineraryDetailsViewModel());
var sut = new ItineraryController(mediator.Object, null);
sut.MakeUserNotAnOrgAdmin();
Assert.IsType<UnauthorizedResult>(await sut.Details(It.IsAny<int>()));
}
示例3: EditPost_ReturnsHttpUnauthorizedResult_WhenUserIsNotOrgAdminForEventOrg
public async Task EditPost_ReturnsHttpUnauthorizedResult_WhenUserIsNotOrgAdminForEventOrg()
{
const int orgId = 1;
var mediator = new Mock<IMediator>();
mediator.Setup(x => x.SendAsync(It.IsAny<ItinerarySummaryQuery>())).ReturnsAsync(new ItinerarySummaryViewModel { OrganizationId = orgId });
var sut = new ItineraryController(mediator.Object, MockSuccessValidation().Object);
sut.MakeUserNotAnOrgAdmin();
Assert.IsType<UnauthorizedResult>(await sut.Edit(new ItineraryEditViewModel { Id = 50 }));
}
示例4: SelectRequestsGetReturnsUnauthorizedResult_WhenUserIsNotOrgAdmin
public async Task SelectRequestsGetReturnsUnauthorizedResult_WhenUserIsNotOrgAdmin()
{
var mediator = new Mock<IMediator>();
mediator.Setup(x => x.SendAsync(It.IsAny<OrganizationIdQuery>())).ReturnsAsync(1);
var sut = new ItineraryController(mediator.Object, null);
sut.MakeUserNotAnOrgAdmin();
var result = await sut.SelectRequests(It.IsAny<int>());
Assert.IsType<UnauthorizedResult>(result);
}
示例5: MarkCompleteReturnsHttpUnauthorizedWhenUserIsNotOrgAdmin
public async Task MarkCompleteReturnsHttpUnauthorizedWhenUserIsNotOrgAdmin()
{
var mockMediator = new Mock<IMediator>();
mockMediator.Setup(x => x.SendAsync(It.IsAny<OrganizationIdQuery>())).ReturnsAsync(1);
var sut = new ItineraryController(mockMediator.Object, null);
sut.MakeUserNotAnOrgAdmin();
Assert.IsType<UnauthorizedResult>(await sut.MarkComplete(It.IsAny<int>(), It.IsAny<Guid>()));
}