5e416cb2e4215e6849cbb9dcdf7b05256868ecc4
[ptas] / tests / ut_gmocktest / ut_gmocktest.cpp
1 #include "mock_turtle.h"
2 #include "painter.h"
3
4 #include <gmock/gmock.h>
5 #include <gtest/gtest.h>
6
7 using ::testing::AtLeast;
8
9
10 TEST(PainterTest, TestTurtlePenDownCalledAtLeastOnceWhenDrawCircleCalled)
11 {
12     MockTurtle turtle;
13     EXPECT_CALL(turtle, PenDown()).Times(AtLeast(1));
14
15     Painter painter(&turtle);
16
17     EXPECT_TRUE(painter.DrawCircle(0, 0, 10));
18 }
19
20 int main(int argc, char *argv[])
21 {
22     ::testing::InitGoogleMock(&argc, argv);
23     return RUN_ALL_TESTS();
24 }