public async Task ShowEventSendsShowEventQueryWithCorrectData()
        {
            const string userId = "1";
            const int eventId = 1;

            var mediator = new Mock<IMediator>();

            var userManager = MockHelper.CreateUserManagerMock();
            userManager.Setup(x => x.GetUserAsync(It.IsAny<ClaimsPrincipal>())).ReturnsAsync(new ApplicationUser { Id = userId });
            
            var sut = new EventController(mediator.Object, userManager.Object);
            sut.SetFakeUser(userId);
            await sut.ShowEvent(eventId);

            mediator.Verify(x => x.SendAsync(It.Is<ShowEventQuery>(y => y.EventId == eventId)), Times.Once);
        }
        public async Task ShowEventReturnsHttpNotFoundResultWhenViewModelIsNull()
        {
            const string userId = "1";

            var mediator = new Mock<IMediator>();
            mediator.Setup(x => x.SendAsync(It.IsAny<ShowEventQuery>())).ReturnsAsync(null);

            var userManager = MockHelper.CreateUserManagerMock();
            userManager.Setup(x => x.GetUserAsync(It.IsAny<ClaimsPrincipal>())).ReturnsAsync(new ApplicationUser { Id = userId });

            var sut = new EventController(mediator.Object, userManager.Object);
            sut.SetFakeUser(userId);

            var result = await sut.ShowEvent(It.IsAny<int>());

            Assert.IsType<NotFoundResult>(result);
        }
        public async Task ShowEventReturnsCorrrectViewAndViewModelWhenViewModelIsNotNull()
        {
            const string userId = "1";

            var eventViewModel = new EventViewModel();

            var mediator = new Mock<IMediator>();
            mediator.Setup(x => x.SendAsync(It.IsAny<ShowEventQuery>())).ReturnsAsync(eventViewModel);

            var userManager = MockHelper.CreateUserManagerMock();
            userManager.Setup(x => x.GetUserAsync(It.IsAny<ClaimsPrincipal>())).ReturnsAsync(new ApplicationUser { Id = userId });

            var sut = new EventController(mediator.Object, userManager.Object);
            sut.SetFakeUser(userId);

            var result = await sut.ShowEvent(It.IsAny<int>()) as ViewResult;

            Assert.Equal(eventViewModel, result.Model);
            Assert.Equal("EventWithTasks", result.ViewName);
        }