Lines Matching refs:turtle
123 You can control whether the turtle's movement will leave a trace using `PenUp()`
126 turtle.
226 #include "path/to/mock-turtle.h"
233 MockTurtle turtle; // #2
234 EXPECT_CALL(turtle, PenDown()) // #3
237 Painter painter(&turtle); // #4
326 EXPECT_CALL(turtle, GetX())
333 says that the `turtle` object's `GetX()` method will be called five times, it
349 // Expects the turtle to move forward by 100 units.
350 EXPECT_CALL(turtle, Forward(100));
362 // Expects that the turtle jumps to somewhere on the x=50 line.
363 EXPECT_CALL(turtle, GoTo(50, _));
380 // Expects the turtle moves forward by at least 100.
381 EXPECT_CALL(turtle, Forward(Ge(100)));
388 // Expects the turtle to move forward.
389 EXPECT_CALL(turtle, Forward);
390 // Expects the turtle to jump somewhere.
391 EXPECT_CALL(turtle, GoTo);
451 EXPECT_CALL(turtle, GetX())
457 says that `turtle.GetX()` will be called *exactly three times* (gMock inferred
464 EXPECT_CALL(turtle, GetY())
470 says that `turtle.GetY()` will be called *at least twice* (gMock knows this as
493 EXPECT_CALL(turtle, GetX())
510 EXPECT_CALL(turtle, GetY())
515 Obviously `turtle.GetY()` is expected to be called four times. But if you think
518 will be taken afterwards. So the right answer is that `turtle.GetY()` will
537 EXPECT_CALL(turtle, Forward(_)); // #1
538 EXPECT_CALL(turtle, Forward(10)) // #2
582 EXPECT_CALL(turtle, PenDown());
583 EXPECT_CALL(turtle, Forward(100));
584 EXPECT_CALL(turtle, PenUp());
605 How would you test that the turtle is asked to go to the origin *exactly twice*
615 EXPECT_CALL(turtle, GoTo(_, _)) // #1
617 EXPECT_CALL(turtle, GoTo(0, 0)) // #2
621 Suppose `turtle.GoTo(0, 0)` is called three times. In the third time, gMock will
641 EXPECT_CALL(turtle, GetX())
646 If you think it says that `turtle.GetX()` will be called `n` times and will
648 said, expectations are sticky. So, the second time `turtle.GetX()` is called,
652 One correct way of saying that `turtle.GetX()` will return 10, 20, 30, ..., is
660 EXPECT_CALL(turtle, GetX())
678 EXPECT_CALL(turtle, GetX())