added game creation test
6714ddd parent: 984c98e modified
app/CMakeLists.txt +1 -0 | @@ -39,6 +39,7 @@ add_executable(fluffy src/main.cpp) | ||
| 39 | 39 | add_executable( |
| 40 | 40 | hello_test |
| 41 | 41 | tests/tests.cc |
| 42 | + tests/gameTest.cpp | |
| 42 | 43 | ) |
| 43 | 44 | target_link_libraries( |
| 44 | 45 | hello_test |
| @@ -39,6 +39,7 @@ add_executable(fluffy src/main.cpp) | |||
| 39 | add_executable( | 39 | add_executable( |
| 40 | hello_test | 40 | hello_test |
| 41 | tests/tests.cc | 41 | tests/tests.cc |
| 42 | + tests/gameTest.cpp | ||
| 42 | ) | 43 | ) |
| 43 | target_link_libraries( | 44 | target_link_libraries( |
| 44 | hello_test | 45 | hello_test |
added
app/tests/gameTest.cpp +13 -0 | new file mode 100644 | ||
| @@ -0,0 +1,13 @@ | ||
| 1 | +#include <gtest/gtest.h> | |
| 2 | + | |
| 3 | +#include <game.hpp> | |
| 4 | + | |
| 5 | +// Demonstrate some basic assertions. | |
| 6 | +TEST(GameTest, Creation) { | |
| 7 | + Game sut{0, "sut", "sut/path"}; | |
| 8 | + | |
| 9 | + EXPECT_EQ(0, sut.getId()); | |
| 10 | + EXPECT_EQ("sut", sut.getName()); | |
| 11 | + EXPECT_EQ("sut/path", sut.getPath()); | |
| 12 | + | |
| 13 | +} | |
| new file mode 100644 | |||
| @@ -0,0 +1,13 @@ | |||
| 1 | +#include <gtest/gtest.h> | ||
| 2 | + | ||
| 3 | +#include <game.hpp> | ||
| 4 | + | ||
| 5 | +// Demonstrate some basic assertions. | ||
| 6 | +TEST(GameTest, Creation) { | ||
| 7 | + Game sut{0, "sut", "sut/path"}; | ||
| 8 | + | ||
| 9 | + EXPECT_EQ(0, sut.getId()); | ||
| 10 | + EXPECT_EQ("sut", sut.getName()); | ||
| 11 | + EXPECT_EQ("sut/path", sut.getPath()); | ||
| 12 | + | ||
| 13 | +} | ||