Skip to content

Commit

Permalink
Update movies test
Browse files Browse the repository at this point in the history
Signed-off-by: Uilian Ries <[email protected]>
  • Loading branch information
uilianries committed May 24, 2024
1 parent 1c1bf5e commit 371aaf5
Showing 1 changed file with 7 additions and 12 deletions.
19 changes: 7 additions & 12 deletions tests/modules/movie/MovieTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -24,30 +19,30 @@ 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; }));
}

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; }));
}

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; }));
}

Expand All @@ -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; }));
}

0 comments on commit 371aaf5

Please sign in to comment.