diff --git a/include/faker-cxx/Food.h b/include/faker-cxx/Food.h new file mode 100644 index 00000000..5dfe72e5 --- /dev/null +++ b/include/faker-cxx/Food.h @@ -0,0 +1,164 @@ +#pragma once + +#include + +namespace faker { + +class Food { + +public: + /** + * @brief Returns a random alcoholic beverage name. + * + * @returns Alcoholic beverage. + * + * @code + * Food::alcoholicBeverage() // "champain" + * @endcode + */ + static std::string alcoholicBeverage(); + + /** + * @brief Returns a random grain measurement. + * + * @returns Grain. + * + * @code + * Food::grain() // "1 Lt" + * @endcode + */ + static std::string grain(); + + /** + * @brief Returns a random milk product's name. + * + * @returns Milk product. + * + * @code + * Food::milkProduct() // "mozzarella" + * @endcode + */ + static std::string milkProduct(); + + /** + * @brief Returns a random fruit's name. + * + * @returns Fruit. + * + * @code + * Food::fruit() // "apple" + * @endcode + */ + static std::string fruit(); + + /** + * @brief Returns a random meat's name. + * + * @returns Meat. + * + * @code + * Food::meat() // "antrikot" + * @endcode + */ + static std::string meat(); + + /** + * @brief Returns a random seafood's name. + * + * @returns Seafood. + * + * @code + * Food::seafood() // "lobster" + * @endcode + */ + static std::string seafood(); + + /** + * @brief Returns a random vegetable's name. + * + * @returns Vegetable. + * + * @code + * Food::vegetable() // "watermelon" + * @endcode + */ + static std::string vegetable(); + + /** + * @brief Returns a random oil's name. + * + * @returns Oil. + * + * @code + * Food::oil() // "olive oil" + * @endcode + */ + static std::string oil(); + + /** + * @brief Returns a random nut's name. + * + * @returns Nuts. + * + * @code + * Food::nut() // "walnut" + * @endcode + */ + static std::string nut(); + + /** + * @brief Returns a random seed's name. + * + * @returns Seed. + * + * @code + * Food::seed() // "mozzarella" + * @endcode + */ + static std::string seed(); + + /** + * @brief Returns a random sugar product's name. + * + * @returns Sugar product. + * + * @code + * Food::sugarProduct() // "honey harmony" + * @endcode + */ + static std::string sugarProduct(); + + /** + * @brief Returns a random non-alcoholic beverage's name. + * + * @returns Non-alcoholic Beverage. + * + * @code + * Food::nonalcoholicBeverage() // "water" + * @endcode + */ + static std::string nonalcoholicBeverage(); + + /** + * @brief Returns a random dish's name. + * + * @returns Dish. + * + * @code + * Food::dishName() // "beef wellington" + * @endcode + */ + static std::string dishName(); + + /** + * @brief Returns a random food categories' name. + * + * @returns Food Category. + * + * @code + * Food::foodCategory() // "Dairy" + * @endcode + */ + static std::string foodCategory(); +}; +} diff --git a/src/modules/food/Food.cpp b/src/modules/food/Food.cpp new file mode 100644 index 00000000..32cb9908 --- /dev/null +++ b/src/modules/food/Food.cpp @@ -0,0 +1,77 @@ +#include "faker-cxx/Food.h" + +#include "data/alcoholicBeverages.h" +#include "data/dishNames.h" +#include "data/foodCategories.h" +#include "data/fruits.h" +#include "data/grains.h" +#include "data/meats.h" +#include "data/milkProducts.h" +#include "data/nonalcoholicBeverages.h" +#include "data/nuts.h" +#include "data/oils.h" +#include "data/seafoods.h" +#include "data/seeds.h" +#include "data/sugarProducts.h" +#include "data/vegetables.h" + +#include "faker-cxx/Helper.h" + +namespace faker { + +std::string Food::alcoholicBeverage() { + return Helper::arrayElement(alcoholicBeverages); +} + +std::string Food::dishName() { + return Helper::arrayElement(dishNames); +} + +std::string Food::foodCategory() { + return Helper::arrayElement(foodCategories); +} + +std::string Food::fruit() { + return Helper::arrayElement(fruits); +} + +std::string Food::grain() { + return Helper::arrayElement(grains); +} + +std::string Food::meat() { + return Helper::arrayElement(meats); +} + +std::string Food::milkProduct() { + return Helper::arrayElement(milkProducts); +} + +std::string Food::nonalcoholicBeverage() { + return Helper::arrayElement(nonalcoholicBeverages); +} + +std::string Food::nut() { + return Helper::arrayElement(nuts); +} + +std::string Food::oil() { + return Helper::arrayElement(oils); +} + +std::string Food::seafood() { + return Helper::arrayElement(seafoods); +} + +std::string Food::seed() { + return Helper::arrayElement(seeds); +} + +std::string Food::sugarProduct() { + return Helper::arrayElement(sugarProducts); +} + +std::string Food::vegetable() { + return Helper::arrayElement(vegetables); +} +} \ No newline at end of file diff --git a/src/modules/food/FoodTest.cpp b/src/modules/food/FoodTest.cpp new file mode 100644 index 00000000..3a2dd402 --- /dev/null +++ b/src/modules/food/FoodTest.cpp @@ -0,0 +1,132 @@ +#include "faker-cxx/Food.h" + +#include + +#include "gtest/gtest.h" + +#include "data/alcoholicBeverages.h" +#include "data/dishNames.h" +#include "data/foodCategories.h" +#include "data/fruits.h" +#include "data/grains.h" +#include "data/meats.h" +#include "data/milkProducts.h" +#include "data/nonalcoholicBeverages.h" +#include "data/nuts.h" +#include "data/oils.h" +#include "data/seafoods.h" +#include "data/seeds.h" +#include "data/sugarProducts.h" +#include "data/vegetables.h" + +using namespace ::testing; +using namespace faker; + +class FoodTest : public Test +{ +public: +}; + +TEST_F(FoodTest, shouldGenerateAlcoholicBeverage) +{ + const auto generatedAlcoholicBeverage = Food::alcoholicBeverage(); + + ASSERT_TRUE( + std::ranges::any_of(alcoholicBeverages, [generatedAlcoholicBeverage](const std::string& alcoholicBeverage) { return generatedAlcoholicBeverage == alcoholicBeverage; })); +} + +TEST_F(FoodTest, shouldGenerateDishName) +{ + const auto generatedDishName = Food::dishName(); + + ASSERT_TRUE(std::ranges::any_of(dishNames, [generatedDishName](const std::string& dishName) + { return generatedDishName == dishName; })); +} + +TEST_F(FoodTest, shouldGenerateFoodCategories) +{ + const auto generatedFoodCategory = Food::foodCategory(); + + ASSERT_TRUE(std::ranges::any_of(foodCategories, [generatedFoodCategory](const std::string& foodCategory) + { return generatedFoodCategory == foodCategory; })); +} + +TEST_F(FoodTest, shouldGenerateFruit) +{ + const auto generatedFruit = Food::fruit(); + + ASSERT_TRUE( + std::ranges::any_of(fruits, [generatedFruit](const std::string& fruit) { return generatedFruit == fruit; })); +} + +TEST_F(FoodTest, shouldGenerateMeat) +{ + const auto generatedMeat = Food::meat(); + + ASSERT_TRUE(std::ranges::any_of(meats, [generatedMeat](const std::string& meat) + { return generatedMeat == meat; })); +} + +TEST_F(FoodTest, shouldGenerateMilkProduct) +{ + const auto generatedMilkProduct = Food::milkProduct(); + + ASSERT_TRUE(std::ranges::any_of(milkProducts, [generatedMilkProduct](const std::string& milkProduct) + { return generatedMilkProduct == milkProduct; })); +} + +TEST_F(FoodTest, shouldGenerateNonalcoholicBeverages) +{ + const auto generatedNonalcoholicBeverages = Food::nonalcoholicBeverage(); + + ASSERT_TRUE(std::ranges::any_of(nonalcoholicBeverages, [generatedNonalcoholicBeverages](const std::string& nonalcoholicBeverage) + { return generatedNonalcoholicBeverages == nonalcoholicBeverage; })); +} + +TEST_F(FoodTest, shouldGenerateNut) +{ + const auto generatedNut = Food::nut(); + + ASSERT_TRUE(std::ranges::any_of(nuts, [generatedNut](const std::string& nut) + { return generatedNut == nut; })); +} + +TEST_F(FoodTest, shouldGenerateOil) +{ + const auto generatedOil = Food::oil(); + + ASSERT_TRUE(std::ranges::any_of(oils, [generatedOil](const std::string& oil) + { return generatedOil == oil; })); +} + +TEST_F(FoodTest, shouldGenerateSeafood) +{ + const auto generatedSeafood = Food::seafood(); + + ASSERT_TRUE(std::ranges::any_of(seafoods, [generatedSeafood](const std::string& seafood) + { return generatedSeafood == seafood; })); +} + +TEST_F(FoodTest, shouldGenerateSeed) +{ + const auto generatedSeed = Food::seed(); + + ASSERT_TRUE(std::ranges::any_of(seeds, [generatedSeed](const std::string& seed) + { return generatedSeed == seed; })); +} + +TEST_F(FoodTest, shouldGenerateSugarProduct) +{ + const auto generatedSugarProduct = Food::sugarProduct(); + + ASSERT_TRUE(std::ranges::any_of(sugarProducts, [generatedSugarProduct](const std::string& sugarProduct) + { return generatedSugarProduct == sugarProduct; })); +} + +TEST_F(FoodTest, shouldGenerateVegetable) +{ + const auto generatedVegetable = Food::vegetable(); + + ASSERT_TRUE(std::ranges::any_of(vegetables, [generatedVegetable](const std::string& vegetable) + { return generatedVegetable == vegetable; })); +} diff --git a/src/modules/food/data/alcoholicBeverages.h b/src/modules/food/data/alcoholicBeverages.h new file mode 100644 index 00000000..b0b68958 --- /dev/null +++ b/src/modules/food/data/alcoholicBeverages.h @@ -0,0 +1,56 @@ +#pragma once + +#include +#include + +namespace faker { + const std::vector alcoholicBeverages = { + "Beer", + "Wine", + "Vodka", + "Rum", + "Gin", + "Whiskey", + "Tequila", + "Brandy", + "Champagne", + "Cider", + "Sake", + "Absinthe", + "Cognac", + "Schnapps", + "Mead", + "Bourbon", + "Scotch", + "Irish Cream", + "Jägermeister", + "Pisco", + "Port Wine", + "Sherry", + "Grappa", + "Sambuca", + "Midori", + "Kahlúa", + "Baileys Irish Cream", + "Pina Colada", + "Margarita", + "Cosmopolitan", + "Mai Tai", + "Negroni", + "Martini", + "Old Fashioned", + "Mojito", + "Caipirinha", + "Piña Colada", + "Bloody Mary", + "Tom Collins", + "Singapore Sling", + "Manhattan", + "Moscow Mule", + "Paloma", + "Bellini", + "Mimosa", + "White Russian", + "Black Russian", + }; +} \ No newline at end of file diff --git a/src/modules/food/data/dishNames.h b/src/modules/food/data/dishNames.h new file mode 100644 index 00000000..fa48ad08 --- /dev/null +++ b/src/modules/food/data/dishNames.h @@ -0,0 +1,94 @@ +#pragma once + +#include +#include + +namespace faker { + const std::vector dishNames = { + "Sushi", + "Paella", + "Biryani", + "Poutine", + "Kebab", + "Kimchi", + "Rendang", + "Pad Krapow Moo Saap", + "Goulash", + "Pho", + "Tacos", + "Pierogi", + "Tagine", + "Moussaka", + "Feijoada", + "Dim Sum", + "Ceviche", + "Jollof Rice", + "Pierogi", + "Borscht", + "Pavlova", + "Katsudon", + "Chimichurri", + "Laksa", + "Tandoori Chicken", + "Haggis", + "Baklava", + "Caponata", + "Tom Kha Gai", + "Ramen", + "Arroz con Pollo", + "Baklava", + "Dolma", + "Samosa", + "Bánh Mì", + "Lobster Thermidor", + "Perogies", + "Arepas", + "Nasi Goreng", + "Pav Bhaji", + "Causa Rellena", + "Baba Ganoush", + "Chicken Piccata", + "Penne alla Vodka", + "Beef and Broccoli", + "Shrimp Fried Rice", + "Butter Chicken", + "Egg Fried Rice", + "Stuffed Bell Peppers", + "Chicken Tikka Masala", + "Lemon Herb Roast Chicken", + "Shrimp Scampi Pasta", + "Beef Bulgogi", + "Tom Yum Soup", + "Chicken Katsu", + "Vegetable Curry", + "Chicken Quesadilla", + "Pho", + "Honey Garlic Glazed Salmon", + "Eggplant Rollatini", + "Lemon Butter Shrimp", + "Chicken Teriyaki", + "Mango Salsa Chicken", + "Cauliflower Fried Rice", + "Chicken Fajitas", + "Sausage and Mushroom Risotto", + "Tomato Basil Mozzarella Skewers", + "Garlic Parmesan Roasted Brussels Sprouts", + "Beef Chimichanga", + "Pulled Pork Sandwich", + "Tandoori Chicken", + "Mongolian Beef", + "Vegetarian Paella", + "Chicken Enchiladas", + "Lemon Herb Grilled Fish", + "Spinach and Feta Stuffed Chicken Breast", + "Cajun Shrimp Pasta", + "Teriyaki Salmon", + "Baked Ziti", + "Chicken Alfredo Pizza", + "Caprese Stuffed Avocado", + "Lobster Roll", + "Chicken Caesar Salad", + "Beef and Mushroom Pie", + "Garlic Herb Roasted Potatoes", + }; +} \ No newline at end of file diff --git a/src/modules/food/data/foodCategories.h b/src/modules/food/data/foodCategories.h new file mode 100644 index 00000000..56501364 --- /dev/null +++ b/src/modules/food/data/foodCategories.h @@ -0,0 +1,21 @@ +#pragma once + +#include +#include + +namespace faker +{ + const std::vector foodCategories = { + "Vegetables", + "Fruits", + "Meat", + "Seafood", + "Dairy", + "Grains", + "Beverages", + "Desserts", + "Snacks", + "Condiments", + "Frozen Foods", + }; +} \ No newline at end of file diff --git a/src/modules/food/data/fruits.h b/src/modules/food/data/fruits.h new file mode 100644 index 00000000..5f8a5e17 --- /dev/null +++ b/src/modules/food/data/fruits.h @@ -0,0 +1,50 @@ +#pragma once + +#include +#include + +namespace faker { + const std::vector fruits = { + "Apple", + "Banana", + "Orange", + "Strawberry", + "Pineapple", + "Mango", + "Grapes", + "Kiwi", + "Peach", + "Pear", + "Cherry", + "Blueberry", + "Raspberry", + "Blackberry", + "Avocado", + "Lemon", + "Lime", + "Grapefruit", + "Cantaloupe", + "Honeydew", + "Pomegranate", + "Apricot", + "Plum", + "Nectarine", + "Fig", + "Papaya", + "Passion Fruit", + "Guava", + "Coconut", + "Dragon Fruit", + "Persimmon", + "Cranberry", + "Date", + "Lychee", + "Mulberry", + "Kumquat", + "Jackfruit", + "Starfruit", + "Rambutan", + "Gooseberry", + "Elderberry", + }; +} \ No newline at end of file diff --git a/src/modules/food/data/grains.h b/src/modules/food/data/grains.h new file mode 100644 index 00000000..654225e1 --- /dev/null +++ b/src/modules/food/data/grains.h @@ -0,0 +1,37 @@ +#pragma once + +#include +#include + +namespace faker { + const std::vector grains = { + "Wheat", + "Rice", + "Barley", + "Oats", + "Quinoa", + "Corn", + "Rye", + "Millet", + "Buckwheat", + "Sorghum", + "Amaranth", + "Triticale", + "Spelt", + "Farro", + "Kamut", + "Emmer", + "Freekeh", + "Teff", + "Job's Tears", + "Einkorn", + "Bulgur", + "Maize", + "Semolina", + "Soy", + "Lentils", + "Chia Seeds", + "Flaxseeds", + "Sunflower Seeds", + }; +} \ No newline at end of file diff --git a/src/modules/food/data/meats.h b/src/modules/food/data/meats.h new file mode 100644 index 00000000..9bb43e5a --- /dev/null +++ b/src/modules/food/data/meats.h @@ -0,0 +1,30 @@ +#pragma once + +#include +#include + +namespace faker { + const std::vector meats = { + "Chicken", + "Beef", + "Pork", + "Lamb", + "Turkey", + "Fish", + "Venison", + "Duck", + "Quail", + "Goose", + "Salmon", + "Shrimp", + "Crab", + "Lobster", + "Bison", + "Veal", + "Haddock", + "Trout", + "Tuna", + "Sausage", + "Ham", + }; +} \ No newline at end of file diff --git a/src/modules/food/data/milkProducts.h b/src/modules/food/data/milkProducts.h new file mode 100644 index 00000000..89658d2a --- /dev/null +++ b/src/modules/food/data/milkProducts.h @@ -0,0 +1,41 @@ +#pragma once + +#include +#include + +namespace faker { + const std::vector milkProducts = { + "Milk", + "Cheese", + "Yogurt", + "Butter", + "Cream", + "Sour Cream", + "Cottage Cheese", + "Whipped Cream", + "Ice Cream", + "Condensed Milk", + "Evaporated Milk", + "Mozzarella", + "Feta", + "Parmesan", + "Provolone", + "Cheddar", + "Gouda", + "Blue Cheese", + "Swiss Cheese", + "Brie", + "Camembert", + "Ricotta", + "Goat Cheese", + "Mascarpone", + "Quark", + "Havarti", + "Colby", + "Monterey Jack", + "Gruyère", + "Havarti", + "Cream Cheese", + "Neufchâtel", + }; +} \ No newline at end of file diff --git a/src/modules/food/data/nonalcoholicBeverages.h b/src/modules/food/data/nonalcoholicBeverages.h new file mode 100644 index 00000000..fee35f1f --- /dev/null +++ b/src/modules/food/data/nonalcoholicBeverages.h @@ -0,0 +1,40 @@ +#pragma once + +#include +#include + +namespace faker { + const std::vector nonalcoholicBeverages = { + "Water", + "Tea", + "Coffee", + "Milk", + "Orange Juice", + "Apple Juice", + "Lemonade", + "Iced Tea", + "Cranberry Juice", + "Grape Juice", + "Pineapple Juice", + "Coconut Water", + "Tomato Juice", + "Ginger Ale", + "Hot Chocolate", + "Limeade", + "Grapefruit Juice", + "Club Soda", + "Root Beer", + "Fruit Punch", + "Pomegranate Juice", + "Chai Tea", + "Almond Milk", + "Soy Milk", + "Raspberry Lemonade", + "Peach Iced Tea", + "Hibiscus Tea", + "Green Smoothie", + "Vegetable Juice", + "Pear Nectar", + "Mango Lassi", + }; +} \ No newline at end of file diff --git a/src/modules/food/data/nuts.h b/src/modules/food/data/nuts.h new file mode 100644 index 00000000..44065677 --- /dev/null +++ b/src/modules/food/data/nuts.h @@ -0,0 +1,20 @@ +#pragma once + +#include +#include + +namespace faker { + const std::vector nuts = { + "Almond", + "Walnut", + "Pecan", + "Cashew", + "Pistachio", + "Hazelnut", + "Macadamia", + "Brazil Nut", + "Pine Nut", + "Chestnut", + "Peanut", + }; +} \ No newline at end of file diff --git a/src/modules/food/data/oils.h b/src/modules/food/data/oils.h new file mode 100644 index 00000000..e76cd2c9 --- /dev/null +++ b/src/modules/food/data/oils.h @@ -0,0 +1,29 @@ +#pragma once + +#include +#include + +namespace faker { + const std::vector oils = { + "Olive Oil", + "Coconut Oil", + "Vegetable Oil", + "Canola Oil", + "Sesame Oil", + "Sunflower Oil", + "Peanut Oil", + "Grapeseed Oil", + "Avocado Oil", + "Corn Oil", + "Flaxseed Oil", + "Walnut Oil", + "Safflower Oil", + "Hazelnut Oil", + "Almond Oil", + "Palm Oil", + "Mustard Oil", + "Chia Seed Oil", + "Hemp Oil", + "Pumpkin Seed Oil", + }; +} \ No newline at end of file diff --git a/src/modules/food/data/seafoods.h b/src/modules/food/data/seafoods.h new file mode 100644 index 00000000..261ef35f --- /dev/null +++ b/src/modules/food/data/seafoods.h @@ -0,0 +1,37 @@ +#pragma once + +#include +#include + +namespace faker { + const std::vector seafoods = { + "Salmon", + "Shrimp", + "Tuna", + "Cod", + "Lobster", + "Crab", + "Scallops", + "Mussels", + "Oysters", + "Sardines", + "Trout", + "Haddock", + "Swordfish", + "Halibut", + "Mahi-Mahi", + "Clams", + "Catfish", + "Anchovies", + "Sole", + "Octopus", + "Squid", + "Caviar", + "Sea Bass", + "Herring", + "Pollock", + "Snapper", + "Surimi", + "Whitefish", + }; +} \ No newline at end of file diff --git a/src/modules/food/data/seeds.h b/src/modules/food/data/seeds.h new file mode 100644 index 00000000..32475db1 --- /dev/null +++ b/src/modules/food/data/seeds.h @@ -0,0 +1,38 @@ +#pragma once + +#include +#include + +namespace faker { + const std::vector seeds = { + "Chia Seeds", + "Flaxseeds", + "Sunflower Seeds", + "Pumpkin Seeds", + "Sesame Seeds", + "Poppy Seeds", + "Hemp Seeds", + "Quinoa", + "Pomegranate Seeds", + "Pine Nuts", + "Hemp Hearts", + "Sacha Inchi Seeds", + "Watermelon Seeds", + "Sunflower Kernels", + "Safflower Seeds", + "Alfalfa Seeds", + "Mustard Seeds", + "Coriander Seeds", + "Cumin Seeds", + "Fennel Seeds", + "Cardamom Seeds", + "Caraway Seeds", + "Ajwain Seeds", + "Nigella Seeds", + "Fenugreek Seeds", + "Anise Seeds", + "Celery Seeds", + "Dill Seeds", + "Cotton Seeds", + }; +} \ No newline at end of file diff --git a/src/modules/food/data/sugarProducts.h b/src/modules/food/data/sugarProducts.h new file mode 100644 index 00000000..fc42047f --- /dev/null +++ b/src/modules/food/data/sugarProducts.h @@ -0,0 +1,33 @@ +#pragma once + +#include +#include + +namespace faker { + const std::vector sugarProducts = { + "Granulated Sugar", + "Brown Sugar", + "Powdered Sugar", + "Demerara Sugar", + "Turbinado Sugar", + "Coconut Sugar", + "Maple Syrup", + "Agave Nectar", + "Molasses", + "Date Syrup", + "Golden Syrup", + "Corn Syrup", + "Barley Malt Syrup", + "Rice Syrup", + "Blackstrap Molasses", + "Palm Sugar", + "Muscovado Sugar", + "Lollipop", + "Candies", + "Chocolates", + "Cookies", + "Cakes", + "Soda", + "Ice Cream", + }; +} \ No newline at end of file diff --git a/src/modules/food/data/vegetables.h b/src/modules/food/data/vegetables.h new file mode 100644 index 00000000..4994d4e9 --- /dev/null +++ b/src/modules/food/data/vegetables.h @@ -0,0 +1,39 @@ +#pragma once + +#include +#include + +namespace faker { + const std::vector vegetables = { + "Carrot", + "Broccoli", + "Spinach", + "Tomato", + "Bell Pepper", + "Cucumber", + "Lettuce", + "Kale", + "Cabbage", + "Zucchini", + "Eggplant", + "Radish", + "Celery", + "Asparagus", + "Cauliflower", + "Green Beans", + "Peas", + "Brussels Sprouts", + "Artichoke", + "Sweet Potato", + "Potato", + "Onion", + "Garlic", + "Ginger", + "Mushroom", + "Leek", + "Scallion", + "Beets", + "Turnip", + "Rutabaga", + }; +} \ No newline at end of file