From 371aaf568106806d39a2876b91acbd79f93e3944 Mon Sep 17 00:00:00 2001 From: Uilian Ries Date: Fri, 24 May 2024 21:12:29 +0200 Subject: [PATCH] Update movies test Signed-off-by: Uilian Ries --- tests/modules/movie/MovieTest.cpp | 19 +++++++------------ 1 file changed, 7 insertions(+), 12 deletions(-) diff --git a/tests/modules/movie/MovieTest.cpp b/tests/modules/movie/MovieTest.cpp index 4069ef8ee..ea02dcc50 100644 --- a/tests/modules/movie/MovieTest.cpp +++ b/tests/modules/movie/MovieTest.cpp @@ -4,12 +4,7 @@ #include "gtest/gtest.h" -#include "movie/data/Actors.h" -#include "movie/data/Actresses.h" -#include "movie/data/Directors.h" -#include "movie/data/Genres.h" -#include "movie/data/Movies.h" -#include "movie/data/TvShows.h" +#include "movie/MovieData.h" using namespace ::testing; using namespace faker; @@ -24,14 +19,14 @@ TEST_F(MovieTest, shouldGenerateGenre) const auto generatedGenre = Movie::genre(); ASSERT_TRUE( - std::ranges::any_of(genres, [generatedGenre](const std::string& genre) { return generatedGenre == genre; })); + std::ranges::any_of(genres, [generatedGenre](const std::string_view& genre) { return generatedGenre == genre; })); } TEST_F(MovieTest, shouldGenerateMovieTitle) { const auto generatedMovieTitle = Movie::movieTitle(); - ASSERT_TRUE(std::ranges::any_of(movies, [generatedMovieTitle](const std::string& movieTitle) + ASSERT_TRUE(std::ranges::any_of(movies, [generatedMovieTitle](const std::string_view& movieTitle) { return generatedMovieTitle == movieTitle; })); } @@ -39,7 +34,7 @@ TEST_F(MovieTest, shouldGenerateTvShow) { const auto generatedTvShow = Movie::tvShow(); - ASSERT_TRUE(std::ranges::any_of(tvShows, [generatedTvShow](const std::string& tvShow) + ASSERT_TRUE(std::ranges::any_of(tvShows, [generatedTvShow](const std::string_view& tvShow) { return generatedTvShow == tvShow; })); } @@ -47,7 +42,7 @@ TEST_F(MovieTest, shouldGenerateDirector) { const auto generatedDirector = Movie::director(); - ASSERT_TRUE(std::ranges::any_of(directors, [generatedDirector](const std::string& director) + ASSERT_TRUE(std::ranges::any_of(directors, [generatedDirector](const std::string_view& director) { return generatedDirector == director; })); } @@ -56,13 +51,13 @@ TEST_F(MovieTest, shouldGenerateActor) const auto generatedActor = Movie::actor(); ASSERT_TRUE( - std::ranges::any_of(actors, [generatedActor](const std::string& actor) { return generatedActor == actor; })); + std::ranges::any_of(actors, [generatedActor](const std::string_view& actor) { return generatedActor == actor; })); } TEST_F(MovieTest, shouldGenerateActress) { const auto generatedActress = Movie::actress(); - ASSERT_TRUE(std::ranges::any_of(actresses, [generatedActress](const std::string& actress) + ASSERT_TRUE(std::ranges::any_of(actresses, [generatedActress](const std::string_view& actress) { return generatedActress == actress; })); }