Skip to content

Commit

Permalink
Add Vietnamese people names (#418)
Browse files Browse the repository at this point in the history
Co-authored-by: Michał Cieślar <[email protected]>
  • Loading branch information
joshhn and cieslarmichal authored Jan 7, 2024
1 parent 8497f3b commit e28b6b5
Show file tree
Hide file tree
Showing 6 changed files with 51 additions and 4 deletions.
4 changes: 3 additions & 1 deletion include/faker-cxx/types/Country.h
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ enum class Country
Iceland,
Palestine,
Israel,
Vietnam,
Monaco,
};

Expand All @@ -72,7 +73,7 @@ const std::vector<Country> countries{
Country::Australia, Country::Serbia, Country::Macedonia, Country::Albania, Country::Latvia,
Country::Ireland, Country::Belarus, Country::Estonia, Country::Iran, Country::Bulgaria,
Country::Moldova, Country::Lithuania, Country::Iceland, Country::Palestine, Country::Israel,
Country::Monaco,
Country::Vietnam, Country::Monaco,
};

inline std::string toString(Country country)
Expand Down Expand Up @@ -128,6 +129,7 @@ inline std::string toString(Country country)
{Country::Iceland, "Iceland"},
{Country::Palestine, "Palestine"},
{Country::Israel, "Israel"},
{Country::Vietnam, "Vietnam"},
{Country::Monaco, "Monaco"},
};

Expand Down
3 changes: 2 additions & 1 deletion src/modules/person/Person.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@
#include "data/poland/PolishPeopleNames.h"
#include "data/palestine/PalestinianPeopleNames.h"
#include "data/portugal/PortuguesePeopleNames.h"
#include "data/vietnam/VietnamesePeopleNames.h"
#include "data/romania/RomanianPeopleNames.h"
#include "data/russia/RussianPeopleNames.h"
#include "data/serbia/SerbianPeopleNames.h"
Expand Down Expand Up @@ -99,7 +100,7 @@ const std::map<Country, PeopleNames> countryToPeopleNamesMapping{
{Country::Bulgaria, bulgarianPeopleNames}, {Country::Moldova, moldovanPeopleNames},
{Country::Lithuania, lithuanianPeopleNames}, {Country::Iceland, icelandicPeopleNames},
{Country::Palestine, palestinianPeopleNames}, {Country::Israel, israeliPeopleNames},
{Country::Monaco, monacanPeopleNames},
{Country::Vietnam, vietnamesePeopleNames}, {Country::Monaco, monacanPeopleNames},
};

std::string middleNameForCountry(Country country, std::optional<Sex> sex);
Expand Down
5 changes: 3 additions & 2 deletions src/modules/person/PersonTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@
#include "data/spain/SpanishPeopleNames.h"
#include "data/sweden/SwedishPeopleNames.h"
#include "data/switzerland/SwissPeopleNames.h"
#include "data/vietnam/VietnamesePeopleNames.h"
#include "data/turkey/TurkishPeopleNames.h"
#include "data/ukraine/UkrainianPeopleNames.h"
#include "data/ZodiacSigns.h"
Expand Down Expand Up @@ -97,7 +98,7 @@ const std::map<Country, PeopleNames> countryToPeopleNamesMapping{
{Country::Bulgaria, bulgarianPeopleNames}, {Country::Moldova, moldovanPeopleNames},
{Country::Lithuania, lithuanianPeopleNames}, {Country::Iceland, icelandicPeopleNames},
{Country::Palestine, palestinianPeopleNames}, {Country::Israel, israeliPeopleNames},
{Country::Monaco, monacanPeopleNames},
{Country::Vietnam, vietnamesePeopleNames}, {Country::Monaco, monacanPeopleNames},
};

const std::map<Country, std::string> generatedTestName{
Expand Down Expand Up @@ -126,7 +127,7 @@ const std::map<Country, std::string> generatedTestName{
{Country::Bulgaria, "shouldGenerateBulgarianName"}, {Country::Moldova, "shouldGenerateMoldovanName"},
{Country::Lithuania, "shouldGenerateLithuanianName"}, {Country::Iceland, "shouldGenerateIcelandicName"},
{Country::Palestine, "shouldGeneratePalestinianName"}, {Country::Israel, "shouldGenerateIsraeliName"},
{Country::Monaco, "shouldGenerateMonacanName"},
{Country::Vietnam, "shouldGenerateVietnameseName"}, {Country::Monaco, "shouldGenerateMonacanName"},
};
}

Expand Down
Loading

0 comments on commit e28b6b5

Please sign in to comment.