Skip to content

Commit e11d0b0

Browse files
authored
Merge pull request #162 from scratchcpp/entity_test
Add Entity test
2 parents 5fb2c75 + 726aa03 commit e11d0b0

File tree

2 files changed

+33
-0
lines changed

2 files changed

+33
-0
lines changed

test/scratch_classes/CMakeLists.txt

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,3 +81,17 @@ target_link_libraries(
8181
)
8282

8383
gtest_discover_tests(value_test)
84+
85+
# entity_test
86+
add_executable(
87+
entity_test
88+
entity_test.cpp
89+
)
90+
91+
target_link_libraries(
92+
entity_test
93+
GTest::gtest_main
94+
scratchcpp
95+
)
96+
97+
gtest_discover_tests(entity_test)
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
#include <scratchcpp/entity.h>
2+
3+
#include "../common.h"
4+
5+
using namespace libscratchcpp;
6+
7+
TEST(EntityTest, Constructors)
8+
{
9+
Entity entity("abc");
10+
ASSERT_EQ(entity.id(), "abc");
11+
}
12+
13+
TEST(EntityTest, Id)
14+
{
15+
Entity entity("abc");
16+
17+
entity.setId("def");
18+
ASSERT_EQ(entity.id(), "def");
19+
}

0 commit comments

Comments
 (0)