public async Task DeleteConfirmedReturnsUnauthorized_IfUserIsNotOrgAdmin()
        {
            var deleteResourceQuery = new ResourceDeleteViewModel {
                Id = 1, CampaignId = 4, UserIsOrgAdmin = false
            };
            var mockMediator = new Mock <IMediator>();

            var sut    = new ResourceController(mockMediator.Object);
            var result = await sut.DeleteConfirmed(deleteResourceQuery) as UnauthorizedResult;

            result.ShouldNotBeNull();
            result.ShouldBeOfType <UnauthorizedResult>();
            result.StatusCode.ShouldBe((int)HttpStatusCode.Unauthorized);
        }
        public async Task DeleteConfirmdedSendsDeleteResourceCommand_WithCorrectResourceId()
        {
            var deleteResourceQuery = new ResourceDeleteViewModel {
                Id = 1, CampaignId = 4, UserIsOrgAdmin = true
            };

            var mockMediator = new Mock <IMediator>();

            mockMediator.Setup(m => m.SendAsync(It.IsAny <DeleteResourceQuery>())).ReturnsAsync(It.IsAny <ResourceDeleteViewModel>());

            var sut    = new ResourceController(mockMediator.Object);
            var result = await sut.DeleteConfirmed(deleteResourceQuery) as RedirectToActionResult;

            result.ShouldNotBeNull();
            mockMediator.Verify(m => m.SendAsync(It.Is <DeleteResourceCommand>(d => d.ResourceId == deleteResourceQuery.Id)));
        }
        public async Task DeleteConfirmdedRedirectToCorrectAction_AfterDeleteHasBeenDone()
        {
            var deleteResourceQuery = new ResourceDeleteViewModel {
                Id = 1, CampaignId = 4, UserIsOrgAdmin = true
            };

            var mockMediator = new Mock <IMediator>();

            mockMediator.Setup(m => m.SendAsync(It.IsAny <DeleteResourceQuery>())).ReturnsAsync(It.IsAny <ResourceDeleteViewModel>());

            var sut    = new ResourceController(mockMediator.Object);
            var result = await sut.DeleteConfirmed(deleteResourceQuery) as RedirectToActionResult;

            result.ShouldNotBeNull();
            result.ActionName.ShouldBe(nameof(CampaignController.Details));
            result.ControllerName.ShouldBe("Campaign");
            result.RouteValues["area"].ShouldBe(AreaNames.Admin);
            result.RouteValues["id"].ShouldBe(deleteResourceQuery.CampaignId);
        }