mirror of
https://github.com/TheLartians/ModernCppStarter.git
synced 2025-08-30 21:51:12 +02:00
22 lines
608 B
C++
22 lines
608 B
C++
#include <greeter/greeter.h>
|
|
#include <greeter/version.h>
|
|
|
|
#include <doctest/doctest.h>
|
|
|
|
#include <string>
|
|
|
|
TEST_CASE("Greeter") {
|
|
using namespace greeter;
|
|
|
|
Greeter greeter("Tests");
|
|
|
|
CHECK(greeter.greet(LanguageCode::EN) == "Hello, Tests!");
|
|
CHECK(greeter.greet(LanguageCode::DE) == "Hallo Tests!");
|
|
CHECK(greeter.greet(LanguageCode::ES) == "¡Hola Tests!");
|
|
CHECK(greeter.greet(LanguageCode::FR) == "Bonjour Tests!");
|
|
}
|
|
|
|
TEST_CASE("Greeter version") {
|
|
static_assert(std::string_view(GREETER_VERSION) == std::string_view("1.0"));
|
|
CHECK(std::string(GREETER_VERSION) == std::string("1.0"));
|
|
}
|