Skip to content

Commit

Permalink
renamed types to plantTypes
Browse files Browse the repository at this point in the history
  • Loading branch information
sjadhav07 committed Jun 10, 2024
1 parent 549c771 commit 3561fbc
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion include/faker-cxx/Plant.h
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,6 @@ class Plant
* Plant::type() // "tree"
* @endcode
*/
static std::string_view type();
static std::string_view plantType();
};
}
4 changes: 2 additions & 2 deletions src/modules/plant/Plant.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@ std::string_view Plant::vine()
return Helper::arrayElement(vines);
}

std::string_view Plant::type()
std::string_view Plant::plantType()
{
return Helper::arrayElement(types);
return Helper::arrayElement(plantTypes);
}
}
2 changes: 1 addition & 1 deletion src/modules/plant/PlantData.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -701,5 +701,5 @@ const std::array<std::string_view, 24> vines = {"Bougainvillea",
"Star Jasmine",
"Virginia Creeper"};

const std::array<std::string_view, 7> types = {"tree", "flower", "shrub", "grass", "fern", "succulent", "vine"};
const std::array<std::string_view, 7> plantTypes = {"tree", "flower", "shrub", "grass", "fern", "succulent", "vine"};
}
2 changes: 1 addition & 1 deletion src/modules/plant/PlantData.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,5 @@ extern const std::array<std::string_view, 97> grasses;
extern const std::array<std::string_view, 87> ferns;
extern const std::array<std::string_view, 132> succulents;
extern const std::array<std::string_view, 24> vines;
extern const std::array<std::string_view, 7> types;
extern const std::array<std::string_view, 7> plantTypes;
}
4 changes: 2 additions & 2 deletions tests/modules/plant/PlantTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,8 @@ TEST_F(PlantTest, shouldGenerateVine)

TEST_F(PlantTest, shouldGenerateType)
{
const auto generatedType = Plant::type();
const auto generatedType = Plant::plantType();

ASSERT_TRUE(
std::ranges::any_of(types, [generatedType](const std::string_view& type) { return type == generatedType; }));
std::ranges::any_of(plantTypes, [generatedType](const std::string_view& plantType) { return plantType == generatedType; }));
}

0 comments on commit 3561fbc

Please sign in to comment.