|
|
@@ -65,6 +65,7 @@ using testing::Field;
|
|
|
using testing::FloatNear;
|
|
|
using testing::Ge;
|
|
|
using testing::Lt;
|
|
|
+using testing::Not;
|
|
|
using testing::_;
|
|
|
|
|
|
TEST_F(GameDispatchTest, ManagerIsFetchedFromRenderer) {
|
|
|
@@ -123,6 +124,17 @@ TEST_F(MouseEventTest, DispatchesToCurrentScene) {
|
|
|
game().process_mouse_event({{0.f, 0.f}}, true);
|
|
|
}
|
|
|
|
|
|
+MATCHER(WasPressed, "") {
|
|
|
+ return (arg.type & engine::event::PRESSED_MASK) != 0;
|
|
|
+}
|
|
|
+
|
|
|
+TEST_F(MouseEventTest, CanPressAndRelease) {
|
|
|
+ EXPECT_CALL(scene(), handle_mouse_event(WasPressed())).Times(1);
|
|
|
+ game().process_mouse_event({}, true);
|
|
|
+ EXPECT_CALL(scene(), handle_mouse_event(Not(WasPressed()))).Times(1);
|
|
|
+ game().process_mouse_event({}, false);
|
|
|
+}
|
|
|
+
|
|
|
TEST_F(MouseEventTest, TranslatesFrameOfRef) {
|
|
|
// Resize the scene (not a supported operation)
|
|
|
scene_.reset(new mock_scene(dispatch_, make_vector(10.f, 10.f)));
|