mirror of
https://github.com/TheLartians/ModernCppStarter.git
synced 2025-08-30 21:51:12 +02:00
18 lines
496 B
C++
18 lines
496 B
C++
#include <doctest/doctest.h>
|
|
#include <greeter.h>
|
|
|
|
#if defined(_WIN32) || defined(WIN32)
|
|
// apparently this is required to compile in MSVC++
|
|
# include <sstream>
|
|
#endif
|
|
|
|
TEST_CASE("Greeter") {
|
|
using namespace greeter;
|
|
|
|
Greeter greeter("World");
|
|
|
|
CHECK(greeter.greet(LanguageCode::EN) == "Hello, World!");
|
|
CHECK(greeter.greet(LanguageCode::DE) == "Hallo World!");
|
|
CHECK(greeter.greet(LanguageCode::ES) == "¡Hola World!");
|
|
CHECK(greeter.greet(LanguageCode::FR) == "Bonjour World!");
|
|
}
|