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


C# ItineraryController.MakeUserNotAnOrgAdmin方法代码示例

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

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

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

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

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


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