public class GameBehaviour extends UsingClassMock {
public void shouldMoveGlyphLowerOnHeartbeat() {
StubHeartbeat heartbeat = new StubHeartbeat();
PseudoRandomGlyphFactory factory = new PseudoRandomGlyphFactory(42, 7, 13); // T, Z, S, J...
Mock glyphListener = mock(GlyphListener.class);
Game game = new Game(factory, heartbeat, 7, 13);
game.addGlyphListener((GlyphListener) glyphListener);
Segments initialSegments = GlyphType.T.getSegments(0).movedRight(3);
glyphListener.stubs("reportGlyphMovement").with(eq(GlyphType.JUNK), anything(), anything());
glyphListener.expects("reportGlyphMovement").with(eq(GlyphType.T), anything(), eq(initialSegments));
glyphListener.expects("reportGlyphMovement").with(eq(GlyphType.T), eq(initialSegments), eq(initialSegments.movedDown()));
game.requestStartGame();
heartbeat.beat();
verifyMocks();
}