public async Task GetById_ReturnsAObjectResult_WithAEpisodeViewModel()
        {
            var mapper = CreateAutoMapper();

            var episode = new Episode
            {
                Id      = 1,
                Title   = "Best of the Worst #1",
                VideoId = "adfjl"
            };

            var episodeServiceMock = new Mock <IEpisodeService>();

            episodeServiceMock.Setup(s => s.GetByIdAsync(It.IsAny <long>()))
            .Returns(Task.FromResult(episode));

            var controller = new EpisodeController(mapper, episodeServiceMock.Object);

            var result = await controller.GetById(1);

            var objectResult = Assert.IsType <ObjectResult>(result);
            var model        = Assert.IsAssignableFrom <EpisodeViewModel>(objectResult.Value);

            Assert.Equal(1, model.Id);
        }
        public async Task GetById_ReturnsNotFound_WhenEpisodeIsNull()
        {
            var mapper = CreateAutoMapper();

            var episodeServiceMock = new Mock <IEpisodeService>();

            episodeServiceMock.Setup(s => s.GetByIdAsync(It.IsAny <long>()))
            .Returns(Task.FromResult((Episode)null));

            var controller = new EpisodeController(mapper, episodeServiceMock.Object);

            var result = await controller.GetById(23);

            Assert.IsType <NotFoundResult>(result);
        }