public void testPlaysNewTrackAsSoonAsLocationChangesIfPreviousTrackFinishedWhileInSameLocation() { startingIn(LOCATION_A); dj.mediaFinished(); checking( new Expectations() { { oneOf(mediaControl).play(TRACK_B); } }); dj.locationChangedTo(LOCATION_B); }
public void testPlaysTrackForCurrentLocationWhenPreviousTrackFinishesIfLocationChangedWhileTrackWasPlaying() { startingIn(LOCATION_A); dj.locationChangedTo(LOCATION_B); checking( new Expectations() { { oneOf(mediaControl).play(TRACK_B); } }); dj.mediaFinished(); }
private void startingIn(String initialLocation) { checking( new Expectations() { { oneOf(mediaControl).play(with(any(String.class))); } }); dj.locationChangedTo(initialLocation); }
public void testStartsPlayingTrackForCurrentLocationWhenLocationFirstDetected() { checking( new Expectations() { { oneOf(mediaControl).play(TRACK_A); } }); dj.locationChangedTo(LOCATION_A); }
public void testDoesNotPlayTrackAgainIfStillInTheSameLocation() { startingIn(LOCATION_A); checking( new Expectations() { { never(mediaControl).play(with(any(String.class))); } }); dj.mediaFinished(); }