1
0
Fork 0
mirror of https://github.com/TheLartians/ModernCppStarter.git synced 2025-08-31 06:01:12 +02:00
ModernCppStarter/test/source/greeter.cpp
Lars Melchior 92adf2db25
Create version header and update readme (#44)
* add note on github pages

* add version information to standalone. closes #35.

* update version info

* move includes into project directory and create version header

* fix style

* add comment for version header location
2020-06-03 16:25:44 +02:00

21 lines
No EOL
606 B
C++

#include <doctest/doctest.h>
#include <greeter/greeter.h>
#include <greeter/version.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"));
}