init commit
This commit is contained in:
@@ -0,0 +1,13 @@
|
||||
add_executable(unittest
|
||||
${CMAKE_CURRENT_LIST_DIR}/TestShape.cpp
|
||||
)
|
||||
|
||||
message("${CMAKE_CURRENT_LIST_DIR}/TestShape.cpp")
|
||||
|
||||
target_link_libraries(unittest PUBLIC
|
||||
Shapes
|
||||
gtest_main
|
||||
)
|
||||
|
||||
include(GoogleTest)
|
||||
gtest_discover_tests(unittest)
|
||||
@@ -0,0 +1,16 @@
|
||||
#include <gtest/gtest.hpp>
|
||||
|
||||
#include "Rectangle.hpp"
|
||||
#include "Triangle.hpp"
|
||||
|
||||
TEST(TestRectangle, area)
|
||||
{
|
||||
const Rectangle r{5.0};
|
||||
EXPECT_DOUBLE_EQ(r.getArea(), 25.0);
|
||||
}
|
||||
|
||||
TEST(TestTriangle, area)
|
||||
{
|
||||
const Triangle t{10.0};
|
||||
EXPECT_DOUBLE_EQ(t.getArea(), 50.0);
|
||||
}
|
||||
Reference in New Issue
Block a user