From 9b43eb5c71525aac721b59dc3a0c7411bc1fdf6c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Cie=C5=9Blar?= Date: Sun, 26 May 2024 21:51:01 +0200 Subject: [PATCH] refactor company module data (#595) --- CMakeLists.txt | 1 + include/faker-cxx/Company.h | 18 +- src/modules/company/Company.cpp | 47 +- src/modules/company/CompanyData.cpp | 585 ++++++++++++++++++ src/modules/company/CompanyData.h | 17 + src/modules/company/data/BuzzAdjectives.h | 73 --- src/modules/company/data/BuzzNouns.h | 49 -- src/modules/company/data/BuzzVerbs.h | 18 - .../company/data/CatchPhraseAdjectives.h | 108 ---- .../company/data/CatchPhraseDescriptors.h | 109 ---- src/modules/company/data/CatchPhraseNouns.h | 112 ---- src/modules/company/data/CompanyTypes.h | 13 - src/modules/company/data/Industries.h | 155 ----- src/modules/company/data/Suffixes.h | 9 - tests/modules/company/CompanyTest.cpp | 44 +- 15 files changed, 650 insertions(+), 708 deletions(-) create mode 100644 src/modules/company/CompanyData.cpp create mode 100644 src/modules/company/CompanyData.h delete mode 100644 src/modules/company/data/BuzzAdjectives.h delete mode 100644 src/modules/company/data/BuzzNouns.h delete mode 100644 src/modules/company/data/BuzzVerbs.h delete mode 100644 src/modules/company/data/CatchPhraseAdjectives.h delete mode 100644 src/modules/company/data/CatchPhraseDescriptors.h delete mode 100644 src/modules/company/data/CatchPhraseNouns.h delete mode 100644 src/modules/company/data/CompanyTypes.h delete mode 100644 src/modules/company/data/Industries.h delete mode 100644 src/modules/company/data/Suffixes.h diff --git a/CMakeLists.txt b/CMakeLists.txt index 22ae2752e..3da115a24 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -28,6 +28,7 @@ set(FAKER_SOURCES src/modules/commerce/Commerce.cpp src/modules/commerce/CommerceData.cpp src/modules/company/Company.cpp + src/modules/company/CompanyData.cpp src/modules/computer/Computer.cpp src/modules/crypto/Crypto.cpp src/modules/database/Database.cpp diff --git a/include/faker-cxx/Company.h b/include/faker-cxx/Company.h index cb80c1fd1..e6d86bcb3 100644 --- a/include/faker-cxx/Company.h +++ b/include/faker-cxx/Company.h @@ -1,6 +1,6 @@ #pragma once -#include +#include namespace faker { @@ -27,7 +27,7 @@ class Company * Company::type() // "Nonprofit" * @endcode */ - static std::string type(); + static std::string_view type(); /** * @brief Returns a random company industry. @@ -38,7 +38,7 @@ class Company * Company::industry() // "Biotechnology" * @endcode */ - static std::string industry(); + static std::string_view industry(); /** * @brief Returns a random buzz phrase. @@ -60,7 +60,7 @@ class Company * Company::buzzAdjective() // "one-to-one" * @endcode */ - static std::string buzzAdjective(); + static std::string_view buzzAdjective(); /** * @brief Returns a random buzz noun. @@ -71,7 +71,7 @@ class Company * Company::buzzNoun() // "paradigms" * @endcode */ - static std::string buzzNoun(); + static std::string_view buzzNoun(); /** * @brief Returns a random buzz verb. @@ -82,7 +82,7 @@ class Company * Company::buzzVerb() // "empower" * @endcode */ - static std::string buzzVerb(); + static std::string_view buzzVerb(); /** * @brief Returns a random catch phrase. @@ -104,7 +104,7 @@ class Company * Company::catchPhraseAdjective() // "Multi-tiered" * @endcode */ - static std::string catchPhraseAdjective(); + static std::string_view catchPhraseAdjective(); /** * @brief Returns a random catch phrase descriptor. @@ -115,7 +115,7 @@ class Company * Company::catchPhraseDescriptor() // "composite" * @endcode */ - static std::string catchPhraseDescriptor(); + static std::string_view catchPhraseDescriptor(); /** * @brief Returns a random catch phrase noun. @@ -126,6 +126,6 @@ class Company * Company::catchPhraseNoun() // "leverage" * @endcode */ - static std::string catchPhraseNoun(); + static std::string_view catchPhraseNoun(); }; } diff --git a/src/modules/company/Company.cpp b/src/modules/company/Company.cpp index b3b00624a..7479b624b 100644 --- a/src/modules/company/Company.cpp +++ b/src/modules/company/Company.cpp @@ -1,15 +1,7 @@ #include "faker-cxx/Company.h" #include "../../common/FormatHelper.h" -#include "data/BuzzAdjectives.h" -#include "data/BuzzNouns.h" -#include "data/BuzzVerbs.h" -#include "data/CatchPhraseAdjectives.h" -#include "data/CatchPhraseDescriptors.h" -#include "data/CatchPhraseNouns.h" -#include "data/CompanyTypes.h" -#include "data/Industries.h" -#include "data/Suffixes.h" +#include "CompanyData.h" #include "faker-cxx/Helper.h" #include "faker-cxx/Person.h" @@ -22,8 +14,7 @@ std::string Company::name() switch (Number::integer(3)) { case 0: - companyName = - FormatHelper::format("{} {}", Person::lastName(), Helper::arrayElement(companySuffixes)); + companyName = FormatHelper::format("{} {}", Person::lastName(), Helper::arrayElement(companySuffixes)); break; case 1: companyName = FormatHelper::format("{} {} {}", Person::firstName(), Person::lastName(), Person::jobArea()); @@ -34,21 +25,21 @@ std::string Company::name() break; case 3: companyName = FormatHelper::format("{} {} {} {}", Person::firstName(), Person::lastName(), Person::jobArea(), - Helper::arrayElement(companySuffixes)); + Helper::arrayElement(companySuffixes)); break; } return companyName; } -std::string Company::type() +std::string_view Company::type() { - return Helper::arrayElement(companyTypes); + return Helper::arrayElement(companyTypes); } -std::string Company::industry() +std::string_view Company::industry() { - return Helper::arrayElement(companyIndustries); + return Helper::arrayElement(companyIndustries); } std::string Company::buzzPhrase() @@ -56,19 +47,19 @@ std::string Company::buzzPhrase() return FormatHelper::format("{} {} {}", buzzVerb(), buzzAdjective(), buzzNoun()); } -std::string Company::buzzAdjective() +std::string_view Company::buzzAdjective() { - return Helper::arrayElement(buzzAdjectives); + return Helper::arrayElement(buzzAdjectives); } -std::string Company::buzzNoun() +std::string_view Company::buzzNoun() { - return Helper::arrayElement(buzzNouns); + return Helper::arrayElement(buzzNouns); } -std::string Company::buzzVerb() +std::string_view Company::buzzVerb() { - return Helper::arrayElement(buzzVerbs); + return Helper::arrayElement(buzzVerbs); } std::string Company::catchPhrase() @@ -76,18 +67,18 @@ std::string Company::catchPhrase() return FormatHelper::format("{} {} {}", catchPhraseAdjective(), catchPhraseDescriptor(), catchPhraseNoun()); } -std::string Company::catchPhraseAdjective() +std::string_view Company::catchPhraseAdjective() { - return Helper::arrayElement(catchPhraseAdjectives); + return Helper::arrayElement(catchPhraseAdjectives); } -std::string Company::catchPhraseDescriptor() +std::string_view Company::catchPhraseDescriptor() { - return Helper::arrayElement(catchPhraseDescriptors); + return Helper::arrayElement(catchPhraseDescriptors); } -std::string Company::catchPhraseNoun() +std::string_view Company::catchPhraseNoun() { - return Helper::arrayElement(catchPhraseNouns); + return Helper::arrayElement(catchPhraseNouns); } } diff --git a/src/modules/company/CompanyData.cpp b/src/modules/company/CompanyData.cpp new file mode 100644 index 000000000..24dc7b0d0 --- /dev/null +++ b/src/modules/company/CompanyData.cpp @@ -0,0 +1,585 @@ +#include "CompanyData.h" + +namespace faker +{ +const std::array buzzAdjectives = {"clicks-and-mortar", + "value-added", + "vertical", + "proactive", + "robust", + "revolutionary", + "scalable", + "leading-edge", + "innovative", + "intuitive", + "strategic", + "e-business", + "mission-critical", + "sticky", + "one-to-one", + "24/7", + "end-to-end", + "global", + "B2B", + "B2C", + "granular", + "frictionless", + "virtual", + "viral", + "dynamic", + "24/365", + "best-of-breed", + "killer", + "magnetic", + "bleeding-edge", + "web-enabled", + "interactive", + "dot-com", + "sexy", + "back-end", + "real-time", + "efficient", + "front-end", + "distributed", + "seamless", + "extensible", + "turn-key", + "world-class", + "open-source", + "cross-platform", + "cross-media", + "synergistic", + "bricks-and-clicks", + "out-of-the-box", + "enterprise", + "integrated", + "impactful", + "wireless", + "transparent", + "next-generation", + "cutting-edge", + "user-centric", + "visionary", + "customized", + "ubiquitous", + "plug-and-play", + "collaborative", + "compelling", + "holistic", + "rich"}; + +const std::array buzzNouns = {"synergies", + "paradigms", + "markets", + "partnerships", + "infrastructures", + "platforms", + "initiatives", + "channels", + "eyeballs", + "communities", + "ROI", + "solutions", + "action-items", + "portals", + "niches", + "technologies", + "content", + "supply-chains", + "convergence", + "relationships", + "architectures", + "interfaces", + "e-markets", + "e-commerce", + "systems", + "bandwidth", + "models", + "mindshare", + "deliverables", + "users", + "schemas", + "networks", + "applications", + "metrics", + "e-business", + "functionalities", + "experiences", + "web services", + "methodologies", + "blockchains" + "lifetime value"}; + +const std::array buzzVerbs = { + "implement", "utilize", "integrate", "streamline", "optimize", "evolve", "transform", + "embrace", "enable", "orchestrate", "leverage", "reinvent", "aggregate", "architect", + "enhance", "incentivize", "morph", "empower", "envisioneer", "monetize", "harness", + "facilitate", "seize", "disintermediate", "synergize", "strategize", "deploy", "brand", + "grow", "target", "syndicate", "synthesize", "deliver", "mesh", "incubate", + "engage", "maximize", "benchmark", "expedite", "reintermediate", "whiteboard", "visualize", + "repurpose", "innovate", "scale", "unleash", "drive", "extend", "engineer", + "revolutionize", "generate", "exploit", "transition", "e-enable", "iterate", "cultivate", + "matrix", "productize", "redefine", "recontextualize"}; + +const std::array catchPhraseAdjectives = {"Adaptive", + "Advanced", + "Ameliorated", + "Assimilated", + "Automated", + "Balanced", + "Business-focused", + "Centralized", + "Cloned", + "Compatible", + "Configurable", + "Cross-group", + "Cross-platform", + "Customer-focused", + "Customizable", + "Decentralized", + "De-engineered", + "Devolved", + "Digitized", + "Distributed", + "Diverse", + "Down-sized", + "Enhanced", + "Enterprise-wide", + "Ergonomic", + "Exclusive", + "Expanded", + "Extended", + "Face to face", + "Focused", + "Front-line", + "Fully-configurable", + "Function-based", + "Fundamental", + "Future-proofed", + "Grass-roots", + "Horizontal", + "Implemented", + "Innovative", + "Integrated", + "Intuitive", + "Inverse", + "Managed", + "Mandatory", + "Monitored", + "Multi-channelled", + "Multi-lateral", + "Multi-layered", + "Multi-tiered", + "Networked", + "Object-based", + "Open-architected", + "Open-source", + "Operative", + "Optimized", + "Optional", + "Organic", + "Organized", + "Persevering", + "Persistent", + "Phased", + "Polarised", + "Pre-emptive", + "Proactive", + "Profit-focused", + "Profound", + "Programmable", + "Progressive", + "Public-key", + "Quality-focused", + "Reactive", + "Realigned", + "Re-contextualized", + "Re-engineered", + "Reduced", + "Reverse-engineered", + "Right-sized", + "Robust", + "Seamless", + "Secured", + "Self-enabling", + "Sharable", + "Stand-alone", + "Streamlined", + "Switchable", + "Synchronised", + "Synergistic", + "Synergized", + "Team-oriented", + "Total", + "Triple-buffered", + "Universal", + "Up-sized", + "Upgradable", + "User-centric", + "User-friendly", + "Versatile", + "Virtual", + "Visionary", + "Vision-oriented"}; + +const std::array catchPhraseDescriptors = {"24 hour", + "24/7", + "3rd generation", + "4th generation", + "5th generation", + "6th generation", + "actuating", + "analyzing", + "asymmetric", + "asynchronous", + "attitude-oriented", + "background", + "bandwidth-monitored", + "bi-directional", + "bifurcated", + "bottom-line", + "clear-thinking", + "client-driven", + "client-server", + "coherent", + "cohesive", + "composite", + "context-sensitive", + "contextually-based", + "content-based", + "dedicated", + "demand-driven", + "didactic", + "directional", + "discrete", + "disintermediate", + "dynamic", + "eco-centric", + "empowering", + "encompassing", + "even-keeled", + "executive", + "explicit", + "exuding", + "fault-tolerant", + "foreground", + "fresh-thinking", + "full-range", + "global", + "grid-enabled", + "heuristic", + "high-level", + "holistic", + "homogeneous", + "human-resource", + "hybrid", + "impactful", + "incremental", + "intangible", + "interactive", + "intermediate", + "leading edge", + "local", + "logistical", + "maximized", + "methodical", + "mission-critical", + "mobile", + "modular", + "motivating", + "multimedia", + "multi-state", + "multi-tasking", + "national", + "needs-based", + "neutral", + "next generation", + "non-volatile", + "object-oriented", + "optimal", + "optimizing", + "radical", + "real-time", + "reciprocal", + "regional", + "responsive", + "scalable", + "secondary", + "solution-oriented", + "stable", + "static", + "systematic", + "systemic", + "system-worthy", + "tangible", + "tertiary", + "transitional", + "uniform", + "upward-trending", + "user-facing", + "value-added", + "web-enabled", + "well-modulated", + "zero administration", + "zero defect", + "zero tolerance"}; + +const std::array catchPhraseNouns = {"ability", + "access", + "adapter", + "algorithm", + "alliance", + "analyzer", + "application", + "approach", + "architecture", + "archive", + "artificial intelligence", + "array", + "attitude", + "benchmark", + "budgetary management", + "capability", + "capacity", + "challenge", + "circuit", + "collaboration", + "complexity", + "concept", + "conglomeration", + "contingency", + "core", + "customer loyalty", + "database", + "data-warehouse", + "definition", + "emulation", + "encoding", + "encryption", + "extranet", + "firmware", + "flexibility", + "focus group", + "forecast", + "frame", + "framework", + "function", + "functionalities", + "Graphic Interface", + "groupware", + "Graphical User Interface", + "hardware", + "help-desk", + "hierarchy", + "hub", + "implementation", + "info-mediaries", + "infrastructure", + "initiative", + "installation", + "instruction set", + "interface", + "internet solution", + "intranet", + "knowledge user", + "knowledge base", + "local area network", + "leverage", + "matrices", + "matrix", + "methodology", + "middleware", + "migration", + "model", + "moderator", + "monitoring", + "moratorium", + "neural-net", + "open architecture", + "open system", + "orchestration", + "paradigm", + "parallelism", + "policy", + "portal", + "pricing structure", + "process improvement", + "product", + "productivity", + "project", + "projection", + "protocol", + "secured line", + "service-desk", + "software", + "solution", + "standardization", + "strategy", + "structure", + "success", + "superstructure", + "support", + "synergy", + "system engine", + "task-force", + "throughput", + "time-frame", + "toolset", + "utilisation", + "website", + "workforce"}; + +const std::array companyTypes = { + "Public Company", "Educational Institution", "Self-Employed", "Government Agency", + "Nonprofit", "Sole Proprietorship", "Privately Held", "Partnership"}; + +const std::array companyIndustries = {"Defense & Space", + "Computer Hardware", + "Computer Software", + "Computer Networking", + "Internet", + "Semiconductors", + "Telecommunications", + "Law Practice", + "Legal Services", + "Management Consulting", + "Biotechnology", + "Medical Practice", + "Hospital & Health Care", + "Pharmaceuticals", + "Veterinary", + "Medical Devices", + "Cosmetics", + "Apparel & Fashion", + "Sporting Goods", + "Tobacco", + "Supermarkets", + "Food Production", + "Consumer Electronics", + "Consumer Goods", + "Furniture", + "Retail", + "Entertainment", + "Gambling & Casinos", + "Leisure, Travel & Tourism", + "Hospitality", + "Restaurants", + "Sports", + "Food & Beverages", + "Motion Pictures and Film", + "Broadcast Media", + "Museums and Institutions", + "Fine Art", + "Performing Arts", + "Recreational Facilities and Services", + "Banking", + "Insurance", + "Financial Services", + "Real Estate", + "Investment Banking", + "Investment Management", + "Accounting", + "Construction", + "Building Materials", + "Architecture & Planning", + "Civil Engineering", + "Aviation & Aerospace", + "Automotive", + "Chemicals", + "Machinery", + "Mining & Metals", + "Oil & Energy", + "Shipbuilding", + "Utilities", + "Textiles", + "Paper & Forest Products", + "Railroad Manufacture", + "Farming", + "Ranching", + "Dairy", + "Fishery", + "Primary / Secondary Education", + "Higher Education", + "Education Management", + "Research", + "Military", + "Legislative Office", + "Judiciary", + "International Affairs", + "Government Administration", + "Executive Office", + "Law Enforcement", + "Public Safety", + "Public Policy", + "Marketing and Advertising", + "Newspapers", + "Publishing", + "Printing", + "Information Services", + "Libraries", + "Environmental Services", + "Package / Freight Delivery", + "Individual & Family Services", + "Religious Institutions", + "Civic & Social Organization", + "Consumer Services", + "Transportationg / Trucking / Railroad", + "Warehousing", + "Airlines / Aviation", + "Maritime", + "Information Technology and Services", + "Market Research", + "Public Relations and Communications", + "Design", + "Nonprofit Organization Management", + "Fund-Raising", + "Program Development", + "Writing and Editing", + "Staffing and Recruiting", + "Professional Training & Coaching", + "Venture Capital & Private Equity", + "Political Organization", + "Translation and Localization", + "Computer Games", + "Events Services", + "Arts and Crafts", + "Electrical / Electronic Manufacturing", + "Online Media", + "Nanotechnology", + "Music", + "Logistics and Supply Chain", + "Plastics", + "Computer & Network Security", + "Wireless", + "Alternative Dispute Resolution", + "Security and Investigations", + "Facilities Services", + "Outsourcing / Offshoring", + "Health, Wellness and Fitness", + "Alternative Medicine", + "Media Production", + "Animation", + "Commercial Real Estate", + "Capital Markets", + "Think Tanks", + "Philanthropy", + "E-Learning", + "Wholesale", + "Import and Export", + "Mechanical or Industrial Engineering", + "Photography", + "Human Resources", + "Business Supplies and Equipment", + "Mental Health Care", + "Graphic Design", + "International Trade and Development", + "Wine and Spirits", + "Luxury Goods & Jewelry", + "Renewables & Environment", + "Glass, Ceramics & Concrete", + "Packaging and Containers", + "Industrial Automation", + "Government Relations"}; + +const std::array companySuffixes = {"Inc", "LLC", "Group"}; +} diff --git a/src/modules/company/CompanyData.h b/src/modules/company/CompanyData.h new file mode 100644 index 000000000..1c53c328b --- /dev/null +++ b/src/modules/company/CompanyData.h @@ -0,0 +1,17 @@ +#pragma once + +#include +#include + +namespace faker +{ +extern const std::array buzzAdjectives; +extern const std::array buzzNouns; +extern const std::array buzzVerbs; +extern const std::array catchPhraseAdjectives; +extern const std::array catchPhraseDescriptors; +extern const std::array catchPhraseNouns; +extern const std::array companyTypes; +extern const std::array companyIndustries; +extern const std::array companySuffixes; +} diff --git a/src/modules/company/data/BuzzAdjectives.h b/src/modules/company/data/BuzzAdjectives.h deleted file mode 100644 index be9ba5738..000000000 --- a/src/modules/company/data/BuzzAdjectives.h +++ /dev/null @@ -1,73 +0,0 @@ -#pragma once - -#include -#include - -namespace faker -{ -const std::vector buzzAdjectives = {"clicks-and-mortar", - "value-added", - "vertical", - "proactive", - "robust", - "revolutionary", - "scalable", - "leading-edge", - "innovative", - "intuitive", - "strategic", - "e-business", - "mission-critical", - "sticky", - "one-to-one", - "24/7", - "end-to-end", - "global", - "B2B", - "B2C", - "granular", - "frictionless", - "virtual", - "viral", - "dynamic", - "24/365", - "best-of-breed", - "killer", - "magnetic", - "bleeding-edge", - "web-enabled", - "interactive", - "dot-com", - "sexy", - "back-end", - "real-time", - "efficient", - "front-end", - "distributed", - "seamless", - "extensible", - "turn-key", - "world-class", - "open-source", - "cross-platform", - "cross-media", - "synergistic", - "bricks-and-clicks", - "out-of-the-box", - "enterprise", - "integrated", - "impactful", - "wireless", - "transparent", - "next-generation", - "cutting-edge", - "user-centric", - "visionary", - "customized", - "ubiquitous", - "plug-and-play", - "collaborative", - "compelling", - "holistic", - "rich"}; -} diff --git a/src/modules/company/data/BuzzNouns.h b/src/modules/company/data/BuzzNouns.h deleted file mode 100644 index 32a9eae15..000000000 --- a/src/modules/company/data/BuzzNouns.h +++ /dev/null @@ -1,49 +0,0 @@ -#pragma once - -#include -#include - -namespace faker -{ -const std::vector buzzNouns = {"synergies", - "paradigms", - "markets", - "partnerships", - "infrastructures", - "platforms", - "initiatives", - "channels", - "eyeballs", - "communities", - "ROI", - "solutions", - "action-items", - "portals", - "niches", - "technologies", - "content", - "supply-chains", - "convergence", - "relationships", - "architectures", - "interfaces", - "e-markets", - "e-commerce", - "systems", - "bandwidth", - "models", - "mindshare", - "deliverables", - "users", - "schemas", - "networks", - "applications", - "metrics", - "e-business", - "functionalities", - "experiences", - "web services", - "methodologies", - "blockchains" - "lifetime value"}; -} diff --git a/src/modules/company/data/BuzzVerbs.h b/src/modules/company/data/BuzzVerbs.h deleted file mode 100644 index 349f89859..000000000 --- a/src/modules/company/data/BuzzVerbs.h +++ /dev/null @@ -1,18 +0,0 @@ -#pragma once - -#include -#include - -namespace faker -{ -const std::vector buzzVerbs = { - "implement", "utilize", "integrate", "streamline", "optimize", "evolve", "transform", - "embrace", "enable", "orchestrate", "leverage", "reinvent", "aggregate", "architect", - "enhance", "incentivize", "morph", "empower", "envisioneer", "monetize", "harness", - "facilitate", "seize", "disintermediate", "synergize", "strategize", "deploy", "brand", - "grow", "target", "syndicate", "synthesize", "deliver", "mesh", "incubate", - "engage", "maximize", "benchmark", "expedite", "reintermediate", "whiteboard", "visualize", - "repurpose", "innovate", "scale", "unleash", "drive", "extend", "engineer", - "revolutionize", "generate", "exploit", "transition", "e-enable", "iterate", "cultivate", - "matrix", "productize", "redefine", "recontextualize"}; -} diff --git a/src/modules/company/data/CatchPhraseAdjectives.h b/src/modules/company/data/CatchPhraseAdjectives.h deleted file mode 100644 index 67c65670a..000000000 --- a/src/modules/company/data/CatchPhraseAdjectives.h +++ /dev/null @@ -1,108 +0,0 @@ -#pragma once - -#include -#include - -namespace faker -{ -const std::vector catchPhraseAdjectives = {"Adaptive", - "Advanced", - "Ameliorated", - "Assimilated", - "Automated", - "Balanced", - "Business-focused", - "Centralized", - "Cloned", - "Compatible", - "Configurable", - "Cross-group", - "Cross-platform", - "Customer-focused", - "Customizable", - "Decentralized", - "De-engineered", - "Devolved", - "Digitized", - "Distributed", - "Diverse", - "Down-sized", - "Enhanced", - "Enterprise-wide", - "Ergonomic", - "Exclusive", - "Expanded", - "Extended", - "Face to face", - "Focused", - "Front-line", - "Fully-configurable", - "Function-based", - "Fundamental", - "Future-proofed", - "Grass-roots", - "Horizontal", - "Implemented", - "Innovative", - "Integrated", - "Intuitive", - "Inverse", - "Managed", - "Mandatory", - "Monitored", - "Multi-channelled", - "Multi-lateral", - "Multi-layered", - "Multi-tiered", - "Networked", - "Object-based", - "Open-architected", - "Open-source", - "Operative", - "Optimized", - "Optional", - "Organic", - "Organized", - "Persevering", - "Persistent", - "Phased", - "Polarised", - "Pre-emptive", - "Proactive", - "Profit-focused", - "Profound", - "Programmable", - "Progressive", - "Public-key", - "Quality-focused", - "Reactive", - "Realigned", - "Re-contextualized", - "Re-engineered", - "Reduced", - "Reverse-engineered", - "Right-sized", - "Robust", - "Seamless", - "Secured", - "Self-enabling", - "Sharable", - "Stand-alone", - "Streamlined", - "Switchable", - "Synchronised", - "Synergistic", - "Synergized", - "Team-oriented", - "Total", - "Triple-buffered", - "Universal", - "Up-sized", - "Upgradable", - "User-centric", - "User-friendly", - "Versatile", - "Virtual", - "Visionary", - "Vision-oriented"}; -} diff --git a/src/modules/company/data/CatchPhraseDescriptors.h b/src/modules/company/data/CatchPhraseDescriptors.h deleted file mode 100644 index f67897f07..000000000 --- a/src/modules/company/data/CatchPhraseDescriptors.h +++ /dev/null @@ -1,109 +0,0 @@ -#pragma once - -#include -#include - -namespace faker -{ -const std::vector catchPhraseDescriptors = {"24 hour", - "24/7", - "3rd generation", - "4th generation", - "5th generation", - "6th generation", - "actuating", - "analyzing", - "asymmetric", - "asynchronous", - "attitude-oriented", - "background", - "bandwidth-monitored", - "bi-directional", - "bifurcated", - "bottom-line", - "clear-thinking", - "client-driven", - "client-server", - "coherent", - "cohesive", - "composite", - "context-sensitive", - "contextually-based", - "content-based", - "dedicated", - "demand-driven", - "didactic", - "directional", - "discrete", - "disintermediate", - "dynamic", - "eco-centric", - "empowering", - "encompassing", - "even-keeled", - "executive", - "explicit", - "exuding", - "fault-tolerant", - "foreground", - "fresh-thinking", - "full-range", - "global", - "grid-enabled", - "heuristic", - "high-level", - "holistic", - "homogeneous", - "human-resource", - "hybrid", - "impactful", - "incremental", - "intangible", - "interactive", - "intermediate", - "leading edge", - "local", - "logistical", - "maximized", - "methodical", - "mission-critical", - "mobile", - "modular", - "motivating", - "multimedia", - "multi-state", - "multi-tasking", - "national", - "needs-based", - "neutral", - "next generation", - "non-volatile", - "object-oriented", - "optimal", - "optimizing", - "radical", - "real-time", - "reciprocal", - "regional", - "responsive", - "scalable", - "secondary", - "solution-oriented", - "stable", - "static", - "systematic", - "systemic", - "system-worthy", - "tangible", - "tertiary", - "transitional", - "uniform", - "upward-trending", - "user-facing", - "value-added", - "web-enabled", - "well-modulated", - "zero administration", - "zero defect", - "zero tolerance"}; -} diff --git a/src/modules/company/data/CatchPhraseNouns.h b/src/modules/company/data/CatchPhraseNouns.h deleted file mode 100644 index fc4e5db6f..000000000 --- a/src/modules/company/data/CatchPhraseNouns.h +++ /dev/null @@ -1,112 +0,0 @@ -#pragma once - -#include -#include - -namespace faker -{ -const std::vector catchPhraseNouns = {"ability", - "access", - "adapter", - "algorithm", - "alliance", - "analyzer", - "application", - "approach", - "architecture", - "archive", - "artificial intelligence", - "array", - "attitude", - "benchmark", - "budgetary management", - "capability", - "capacity", - "challenge", - "circuit", - "collaboration", - "complexity", - "concept", - "conglomeration", - "contingency", - "core", - "customer loyalty", - "database", - "data-warehouse", - "definition", - "emulation", - "encoding", - "encryption", - "extranet", - "firmware", - "flexibility", - "focus group", - "forecast", - "frame", - "framework", - "function", - "functionalities", - "Graphic Interface", - "groupware", - "Graphical User Interface", - "hardware", - "help-desk", - "hierarchy", - "hub", - "implementation", - "info-mediaries", - "infrastructure", - "initiative", - "installation", - "instruction set", - "interface", - "internet solution", - "intranet", - "knowledge user", - "knowledge base", - "local area network", - "leverage", - "matrices", - "matrix", - "methodology", - "middleware", - "migration", - "model", - "moderator", - "monitoring", - "moratorium", - "neural-net", - "open architecture", - "open system", - "orchestration", - "paradigm", - "parallelism", - "policy", - "portal", - "pricing structure", - "process improvement", - "product", - "productivity", - "project", - "projection", - "protocol", - "secured line", - "service-desk", - "software", - "solution", - "standardization", - "strategy", - "structure", - "success", - "superstructure", - "support", - "synergy", - "system engine", - "task-force", - "throughput", - "time-frame", - "toolset", - "utilisation", - "website", - "workforce"}; -} diff --git a/src/modules/company/data/CompanyTypes.h b/src/modules/company/data/CompanyTypes.h deleted file mode 100644 index 39f2feaf6..000000000 --- a/src/modules/company/data/CompanyTypes.h +++ /dev/null @@ -1,13 +0,0 @@ -#pragma once - -#pragma once - -#include -#include - -namespace faker -{ -const std::vector companyTypes = { - "Public Company", "Educational Institution", "Self-Employed", "Government Agency", - "Nonprofit", "Sole Proprietorship", "Privately Held", "Partnership"}; -} diff --git a/src/modules/company/data/Industries.h b/src/modules/company/data/Industries.h deleted file mode 100644 index fc68f9223..000000000 --- a/src/modules/company/data/Industries.h +++ /dev/null @@ -1,155 +0,0 @@ -#pragma once - -#include -#include - -namespace faker -{ -const std::vector companyIndustries = {"Defense & Space", - "Computer Hardware", - "Computer Software", - "Computer Networking", - "Internet", - "Semiconductors", - "Telecommunications", - "Law Practice", - "Legal Services", - "Management Consulting", - "Biotechnology", - "Medical Practice", - "Hospital & Health Care", - "Pharmaceuticals", - "Veterinary", - "Medical Devices", - "Cosmetics", - "Apparel & Fashion", - "Sporting Goods", - "Tobacco", - "Supermarkets", - "Food Production", - "Consumer Electronics", - "Consumer Goods", - "Furniture", - "Retail", - "Entertainment", - "Gambling & Casinos", - "Leisure, Travel & Tourism", - "Hospitality", - "Restaurants", - "Sports", - "Food & Beverages", - "Motion Pictures and Film", - "Broadcast Media", - "Museums and Institutions", - "Fine Art", - "Performing Arts", - "Recreational Facilities and Services", - "Banking", - "Insurance", - "Financial Services", - "Real Estate", - "Investment Banking", - "Investment Management", - "Accounting", - "Construction", - "Building Materials", - "Architecture & Planning", - "Civil Engineering", - "Aviation & Aerospace", - "Automotive", - "Chemicals", - "Machinery", - "Mining & Metals", - "Oil & Energy", - "Shipbuilding", - "Utilities", - "Textiles", - "Paper & Forest Products", - "Railroad Manufacture", - "Farming", - "Ranching", - "Dairy", - "Fishery", - "Primary / Secondary Education", - "Higher Education", - "Education Management", - "Research", - "Military", - "Legislative Office", - "Judiciary", - "International Affairs", - "Government Administration", - "Executive Office", - "Law Enforcement", - "Public Safety", - "Public Policy", - "Marketing and Advertising", - "Newspapers", - "Publishing", - "Printing", - "Information Services", - "Libraries", - "Environmental Services", - "Package / Freight Delivery", - "Individual & Family Services", - "Religious Institutions", - "Civic & Social Organization", - "Consumer Services", - "Transportationg / Trucking / Railroad", - "Warehousing", - "Airlines / Aviation", - "Maritime", - "Information Technology and Services", - "Market Research", - "Public Relations and Communications", - "Design", - "Nonprofit Organization Management", - "Fund-Raising", - "Program Development", - "Writing and Editing", - "Staffing and Recruiting", - "Professional Training & Coaching", - "Venture Capital & Private Equity", - "Political Organization", - "Translation and Localization", - "Computer Games", - "Events Services", - "Arts and Crafts", - "Electrical / Electronic Manufacturing", - "Online Media", - "Nanotechnology", - "Music", - "Logistics and Supply Chain", - "Plastics", - "Computer & Network Security", - "Wireless", - "Alternative Dispute Resolution", - "Security and Investigations", - "Facilities Services", - "Outsourcing / Offshoring", - "Health, Wellness and Fitness", - "Alternative Medicine", - "Media Production", - "Animation", - "Commercial Real Estate", - "Capital Markets", - "Think Tanks", - "Philanthropy", - "E-Learning", - "Wholesale", - "Import and Export", - "Mechanical or Industrial Engineering", - "Photography", - "Human Resources", - "Business Supplies and Equipment", - "Mental Health Care", - "Graphic Design", - "International Trade and Development", - "Wine and Spirits", - "Luxury Goods & Jewelry", - "Renewables & Environment", - "Glass, Ceramics & Concrete", - "Packaging and Containers", - "Industrial Automation", - "Government Relations"}; -} diff --git a/src/modules/company/data/Suffixes.h b/src/modules/company/data/Suffixes.h deleted file mode 100644 index 5a9d317b0..000000000 --- a/src/modules/company/data/Suffixes.h +++ /dev/null @@ -1,9 +0,0 @@ -#pragma once - -#include -#include - -namespace faker -{ -const std::vector companySuffixes{"Inc", "LLC", "Group"}; -} diff --git a/tests/modules/company/CompanyTest.cpp b/tests/modules/company/CompanyTest.cpp index df7fedf8b..bbfea63f3 100644 --- a/tests/modules/company/CompanyTest.cpp +++ b/tests/modules/company/CompanyTest.cpp @@ -5,18 +5,10 @@ #include "gtest/gtest.h" #include "common/StringHelper.h" +#include "company/CompanyData.h" #include "person/data/england/EnglishFirstNames.h" #include "person/data/england/EnglishLastNames.h" #include "person/data/JobTitles.h" -#include "company/data/BuzzAdjectives.h" -#include "company/data/BuzzNouns.h" -#include "company/data/BuzzVerbs.h" -#include "company/data/CatchPhraseAdjectives.h" -#include "company/data/CatchPhraseDescriptors.h" -#include "company/data/CatchPhraseNouns.h" -#include "company/data/CompanyTypes.h" -#include "company/data/Industries.h" -#include "company/data/Suffixes.h" using namespace ::testing; using namespace faker; @@ -44,7 +36,7 @@ TEST_F(CompanyTest, shouldGenerateCompanyName) ASSERT_TRUE(std::ranges::any_of(englishLastNames, [generatedLastName](const std::string& lastName) { return lastName == generatedLastName; })); - ASSERT_TRUE(std::ranges::any_of(companySuffixes, [generatedCompanySuffix](const std::string& companySuffix) + ASSERT_TRUE(std::ranges::any_of(companySuffixes, [generatedCompanySuffix](const std::string_view& companySuffix) { return companySuffix == generatedCompanySuffix; })); } else if (companyNameElements.size() == 3) @@ -74,7 +66,7 @@ TEST_F(CompanyTest, shouldGenerateCompanyName) ASSERT_TRUE(std::ranges::any_of(jobAreas, [generatedJobArea](const std::string& jobArea) { return jobArea == generatedJobArea; })); ASSERT_TRUE(lastElement == "Services" || - std::ranges::any_of(companySuffixes, [lastElement](const std::string& companySuffix) + std::ranges::any_of(companySuffixes, [lastElement](const std::string_view& companySuffix) { return companySuffix == lastElement; })); } } @@ -83,7 +75,7 @@ TEST_F(CompanyTest, shouldGenerateCompanyType) { const auto generatedCompanyType = Company::type(); - ASSERT_TRUE(std::ranges::any_of(companyTypes, [generatedCompanyType](const std::string& companyType) + ASSERT_TRUE(std::ranges::any_of(companyTypes, [generatedCompanyType](const std::string_view& companyType) { return companyType == generatedCompanyType; })); } @@ -91,7 +83,8 @@ TEST_F(CompanyTest, shouldGenerateCompanyIndustry) { const auto generatedCompanyIndustry = Company::industry(); - ASSERT_TRUE(std::ranges::any_of(companyIndustries, [generatedCompanyIndustry](const std::string& companyIndustry) + ASSERT_TRUE(std::ranges::any_of(companyIndustries, + [generatedCompanyIndustry](const std::string_view& companyIndustry) { return companyIndustry == generatedCompanyIndustry; })); } @@ -99,11 +92,11 @@ TEST_F(CompanyTest, shouldGenerateBuzzPhrase) { const auto buzzPhrase = Company::buzzPhrase(); - ASSERT_TRUE(std::ranges::any_of(buzzVerbs, [buzzPhrase](const std::string& buzzVerb) + ASSERT_TRUE(std::ranges::any_of(buzzVerbs, [buzzPhrase](const std::string_view& buzzVerb) { return buzzPhrase.find(buzzVerb) != std::string::npos; })); - ASSERT_TRUE(std::ranges::any_of(buzzAdjectives, [buzzPhrase](const std::string& buzzAdjective) + ASSERT_TRUE(std::ranges::any_of(buzzAdjectives, [buzzPhrase](const std::string_view& buzzAdjective) { return buzzPhrase.find(buzzAdjective) != std::string::npos; })); - ASSERT_TRUE(std::ranges::any_of(buzzNouns, [buzzPhrase](const std::string& buzzNoun) + ASSERT_TRUE(std::ranges::any_of(buzzNouns, [buzzPhrase](const std::string_view& buzzNoun) { return buzzPhrase.find(buzzNoun) != std::string::npos; })); } @@ -111,7 +104,7 @@ TEST_F(CompanyTest, shouldGenerateBuzzVerb) { const auto generatedBuzzVerb = Company::buzzVerb(); - ASSERT_TRUE(std::ranges::any_of(buzzVerbs, [generatedBuzzVerb](const std::string& buzzVerb) + ASSERT_TRUE(std::ranges::any_of(buzzVerbs, [generatedBuzzVerb](const std::string_view& buzzVerb) { return buzzVerb == generatedBuzzVerb; })); } @@ -119,7 +112,7 @@ TEST_F(CompanyTest, shouldGenerateBuzzAdjective) { const auto generatedBuzzAdjective = Company::buzzAdjective(); - ASSERT_TRUE(std::ranges::any_of(buzzAdjectives, [generatedBuzzAdjective](const std::string& buzzAdjective) + ASSERT_TRUE(std::ranges::any_of(buzzAdjectives, [generatedBuzzAdjective](const std::string_view& buzzAdjective) { return buzzAdjective == generatedBuzzAdjective; })); } @@ -127,7 +120,7 @@ TEST_F(CompanyTest, shouldGenerateBuzzNoun) { const auto generatedBuzzNoun = Company::buzzNoun(); - ASSERT_TRUE(std::ranges::any_of(buzzNouns, [generatedBuzzNoun](const std::string& buzzNoun) + ASSERT_TRUE(std::ranges::any_of(buzzNouns, [generatedBuzzNoun](const std::string_view& buzzNoun) { return buzzNoun == generatedBuzzNoun; })); } @@ -135,11 +128,11 @@ TEST_F(CompanyTest, shouldGenerateCatchPhrase) { const auto catchPhrase = Company::catchPhrase(); - ASSERT_TRUE(std::ranges::any_of(catchPhraseAdjectives, [catchPhrase](const std::string& catchPhraseAdjective) + ASSERT_TRUE(std::ranges::any_of(catchPhraseAdjectives, [catchPhrase](const std::string_view& catchPhraseAdjective) { return catchPhrase.find(catchPhraseAdjective) != std::string::npos; })); - ASSERT_TRUE(std::ranges::any_of(catchPhraseDescriptors, [catchPhrase](const std::string& catchPhraseDescriptor) + ASSERT_TRUE(std::ranges::any_of(catchPhraseDescriptors, [catchPhrase](const std::string_view& catchPhraseDescriptor) { return catchPhrase.find(catchPhraseDescriptor) != std::string::npos; })); - ASSERT_TRUE(std::ranges::any_of(catchPhraseNouns, [catchPhrase](const std::string& catchPhraseNoun) + ASSERT_TRUE(std::ranges::any_of(catchPhraseNouns, [catchPhrase](const std::string_view& catchPhraseNoun) { return catchPhrase.find(catchPhraseNoun) != std::string::npos; })); } @@ -148,7 +141,7 @@ TEST_F(CompanyTest, shouldGenerateCatchPhraseAdjective) const auto generatedCatchPhraseAdjective = Company::catchPhraseAdjective(); ASSERT_TRUE(std::ranges::any_of(catchPhraseAdjectives, - [generatedCatchPhraseAdjective](const std::string& catchPhraseAdjective) + [generatedCatchPhraseAdjective](const std::string_view& catchPhraseAdjective) { return catchPhraseAdjective == generatedCatchPhraseAdjective; })); } @@ -157,7 +150,7 @@ TEST_F(CompanyTest, shouldGenerateCatchPhraseDescriptor) const auto generatedCatchPhraseDescriptor = Company::catchPhraseDescriptor(); ASSERT_TRUE(std::ranges::any_of(catchPhraseDescriptors, - [generatedCatchPhraseDescriptor](const std::string& catchPhraseDescriptor) + [generatedCatchPhraseDescriptor](const std::string_view& catchPhraseDescriptor) { return catchPhraseDescriptor == generatedCatchPhraseDescriptor; })); } @@ -165,6 +158,7 @@ TEST_F(CompanyTest, shouldGenerateCatchPhraseNoun) { const auto generatedCatchPhraseNoun = Company::catchPhraseNoun(); - ASSERT_TRUE(std::ranges::any_of(catchPhraseNouns, [generatedCatchPhraseNoun](const std::string& catchPhraseNoun) + ASSERT_TRUE(std::ranges::any_of(catchPhraseNouns, + [generatedCatchPhraseNoun](const std::string_view& catchPhraseNoun) { return catchPhraseNoun == generatedCatchPhraseNoun; })); }