From 3561fbc60fcfa940f71321362d9e8a3f31f9d56a Mon Sep 17 00:00:00 2001 From: sjadhav07 Date: Mon, 10 Jun 2024 14:51:53 +0530 Subject: [PATCH] renamed types to plantTypes --- include/faker-cxx/Plant.h | 2 +- src/modules/plant/Plant.cpp | 4 ++-- src/modules/plant/PlantData.cpp | 2 +- src/modules/plant/PlantData.h | 2 +- tests/modules/plant/PlantTest.cpp | 4 ++-- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/include/faker-cxx/Plant.h b/include/faker-cxx/Plant.h index f3347ba1a..be763340f 100644 --- a/include/faker-cxx/Plant.h +++ b/include/faker-cxx/Plant.h @@ -93,6 +93,6 @@ class Plant * Plant::type() // "tree" * @endcode */ - static std::string_view type(); + static std::string_view plantType(); }; } diff --git a/src/modules/plant/Plant.cpp b/src/modules/plant/Plant.cpp index 322025775..c58ed46c3 100644 --- a/src/modules/plant/Plant.cpp +++ b/src/modules/plant/Plant.cpp @@ -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); } } \ No newline at end of file diff --git a/src/modules/plant/PlantData.cpp b/src/modules/plant/PlantData.cpp index d2fadb344..b1691367e 100644 --- a/src/modules/plant/PlantData.cpp +++ b/src/modules/plant/PlantData.cpp @@ -701,5 +701,5 @@ const std::array vines = {"Bougainvillea", "Star Jasmine", "Virginia Creeper"}; -const std::array types = {"tree", "flower", "shrub", "grass", "fern", "succulent", "vine"}; +const std::array plantTypes = {"tree", "flower", "shrub", "grass", "fern", "succulent", "vine"}; } \ No newline at end of file diff --git a/src/modules/plant/PlantData.h b/src/modules/plant/PlantData.h index 4ee31e9ac..371dd50a2 100644 --- a/src/modules/plant/PlantData.h +++ b/src/modules/plant/PlantData.h @@ -12,5 +12,5 @@ extern const std::array grasses; extern const std::array ferns; extern const std::array succulents; extern const std::array vines; -extern const std::array types; +extern const std::array plantTypes; } \ No newline at end of file diff --git a/tests/modules/plant/PlantTest.cpp b/tests/modules/plant/PlantTest.cpp index 7b6df8f58..2e1f1ebdd 100644 --- a/tests/modules/plant/PlantTest.cpp +++ b/tests/modules/plant/PlantTest.cpp @@ -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; })); } \ No newline at end of file