Publish() public method

public Publish ( int id ) : Task
id int
return Task
        public async Task PublishReturnsCorrectViewModelWhenUserIsOrgAdmin()
        {
            const int organizationId = 99;
            const int campaignId = 100;

            var mockMediator = new Mock<IMediator>();
            mockMediator.Setup(mock => mock.SendAsync(It.Is<PublishViewModelQuery>(c => c.CampaignId == campaignId))).ReturnsAsync(new PublishViewModel { Id = campaignId, OrganizationId = organizationId });

            var sut = new CampaignController(mockMediator.Object, null);
            sut.MakeUserAnOrgAdmin(organizationId.ToString());

            var view = (ViewResult)await sut.Publish(campaignId);
            var viewModel = (PublishViewModel)view.ViewData.Model;

            Assert.Equal(viewModel.Id, campaignId);
        }
        public async Task PublishReturnsHttpUnauthorizedResultWhenUserIsNotOrgAdmin()
        {
            var mediator = new Mock<IMediator>();
            mediator.Setup(x => x.SendAsync(It.IsAny<PublishViewModelQuery>())).ReturnsAsync(new PublishViewModel());

            var sut = new CampaignController(mediator.Object, null);
            sut.MakeUserNotAnOrgAdmin();

            Assert.IsType<UnauthorizedResult>(await sut.Publish(It.IsAny<int>()));
        }
        public async Task PublishReturnsCorrectViewWhenUserIsOrgAdmin()
        {
            const int organizationId = 1;

            var mediator = new Mock<IMediator>();
            mediator.Setup(x => x.SendAsync(It.IsAny<PublishViewModelQuery>())).ReturnsAsync(new PublishViewModel { OrganizationId = organizationId });

            var sut = new CampaignController(mediator.Object, null);
            sut.MakeUserAnOrgAdmin(organizationId.ToString());

            Assert.IsType<ViewResult>(await sut.Publish(It.IsAny<int>()));
        }
        public async Task PublishSendsPublishQueryWithCorrectCampaignId()
        {
            const int organizationId = 99;
            const int campaignId = 100;

            var mockMediator = new Mock<IMediator>();
            mockMediator.Setup(mock => mock.SendAsync(It.Is<PublishViewModelQuery>(c => c.CampaignId == campaignId))).ReturnsAsync(new PublishViewModel { Id = campaignId, OrganizationId = organizationId });

            var sut = new CampaignController(mockMediator.Object, null);
            sut.MakeUserAnOrgAdmin(organizationId.ToString());
            await sut.Publish(campaignId);

            mockMediator.Verify(mock => mock.SendAsync(It.Is<PublishViewModelQuery>(c => c.CampaignId == campaignId)), Times.Once);
        }