public void TestStopRecordingChangesStopsRecording() { MouseMovementController controller = new MouseMovementController(); controller.StartRecordingMouseMovementChanges(true); controller.StopRecordingMouseMovementChanges(); Assert.False(controller.IsRecordingChanges); Assert.False(controller.ClickedOnCanvas); }
public void TestThatRecordMouseMovementChangeRecordsMouseMovementChange() { MouseMovementController controller = new MouseMovementController(); controller.StartRecordingMouseMovementChanges(false); controller.RecordMouseMovementChange(new Coordinates(5, 5)); Assert.NotEmpty(controller.LastMouseMoveCoordinates); Assert.Equal(new Coordinates(5, 5), controller.LastMouseMoveCoordinates[0]); Assert.True(controller.IsRecordingChanges); }
public void TestThatStartRecordingMouseMovChangesStartsRecordingAndInvokesEvent() { bool eventInvoked = false; MouseMovementController controller = new MouseMovementController(); controller.StartedRecordingChanges += (sender, e) => eventInvoked = true; controller.StartRecordingMouseMovementChanges(false); Assert.True(controller.IsRecordingChanges); Assert.True(eventInvoked); Assert.False(controller.ClickedOnCanvas); }