public async Task CreateMovie_WhenAnExceptionIsThrownInTheDomainLayer_ShouldThrow()
        {
            // Arrange
            var expectedMessage   = "Some Exception Message";
            var expectedException = new DuplicateMovieException(expectedMessage);
            var moviesController  = new MovieControllerForTest(expectedException);
            var movieResource     = new MovieResource
            {
                Title    = "Some Title",
                Genre    = GenreParser.ToString(Genre.Action),
                ImageUrl = "Some Url",
                Year     = 1900
            };

            // Act
            try
            {
                await moviesController.CreateMovie(movieResource);

                Assert.Fail("We were expecting an exception of type: DuplicateMovieException to be thrown, but no exception was thrown");
            }
            catch (DuplicateMovieException e)
            {
                // Assert
                Assert.AreEqual(expectedMessage, e.Message);
            }
        }
        public async Task GetMovies_WhenThereAreNoExceptions_ReturnsAllMovies()
        {
            // Arrange
            var expectedMovies   = RandomMovieGenerator.GenerateRandomMovies(50);
            var moviesController = new MovieControllerForTest(expectedMovies);

            // Act
            var actualMovieResources = await moviesController.GetMovies();

            // Assert
            var actualMovies = MapToMvoies(actualMovieResources);

            MovieAssertions.AssertMoviesAreEqual(expectedMovies, actualMovies);
        }
        public async Task GetMoviesByGenre_WhenProvidedWithAValidGenre_ReturnsMoviesByGenre()
        {
            // Arrange
            //// It is not the controller's responsibility to filter by genre
            ///  or ensure all movies being returned have the genre specified
            var expectedMovies     = RandomMovieGenerator.GenerateRandomMovies(50);
            var moviesController   = new MovieControllerForTest(expectedMovies);
            var validGenreAsString = GenreParser.ToString(Genre.SciFi);

            // Act
            var actualMovieResources = await moviesController.GetMoviesByGenre(validGenreAsString);

            // Assert
            var actualMovies = MapToMvoies(actualMovieResources);

            MovieAssertions.AssertMoviesAreEqual(expectedMovies, actualMovies);
        }
        public async Task GetMoviesByGenre_WhenProvidedWithAInValidGenre_ShouldThrow()
        {
            // Arrange
            var moviesController     = new MovieControllerForTest(movies: null);
            var invalidGenreAsString = "xxxxx";

            // Act
            try
            {
                await moviesController.GetMoviesByGenre(invalidGenreAsString);

                Assert.Fail("We were expecting an exception of type InvalidGenreException to be thrown, but no exception was thrown");
            }
            catch (InvalidGenreException e)
            {
                // Assert
                StringAssert.Contains(e.Message, invalidGenreAsString);
            }
        }
        public async Task GetMovies_WhenAnExceptionIsThrownInTheDomainLayer_ShouldThrow()
        {
            // Arrange
            var expectedMessage   = "Some Exception Message";
            var expectedException = new ConfigurationSettingMissingException(expectedMessage);
            var moviesController  = new MovieControllerForTest(expectedException);

            // Act
            try
            {
                await moviesController.GetMovies();

                Assert.Fail("We were expecting an exception of type: ConfigurationSettingMissingException to be thrown, but no exception was thrown");
            }
            catch (ConfigurationSettingMissingException e)
            {
                // Assert
                Assert.AreEqual(expectedMessage, e.Message);
            }
        }
        public async Task CreateMovie_WhenProvidedWithAValidMovieResource_Succeeds()
        {
            // Arrange
            var movieResource = new MovieResource
            {
                Title    = "Some Title",
                Genre    = GenreParser.ToString(Genre.Action),
                ImageUrl = "Some Url",
                Year     = 1900
            };

            var moviesController = new MovieControllerForTest(movies: null);

            // Act
            await moviesController.CreateMovie(movieResource);

            // Assert
            // Nothing to Assert
            Assert.IsTrue(true);
        }