Skip to content

Instantly share code, notes, and snippets.

@GeePawHill
Created April 16, 2018 18:11
Show Gist options
  • Save GeePawHill/8df213492ca4591753a2991b5d46990e to your computer and use it in GitHub Desktop.
Save GeePawHill/8df213492ca4591753a2991b5d46990e to your computer and use it in GitHub Desktop.
package org.geepawhill.contentment.fragments;
import static org.assertj.core.api.Assertions.assertThat;
import org.geepawhill.contentment.core.Context;
import org.geepawhill.contentment.rhythm.SimpleRhythm;
import org.junit.*;
public class SyncTest
{
private SimpleRhythm rhythm;
private Context context;
private Sync sync;
@Before
public void before()
{
context = new Context();
rhythm = new SimpleRhythm();
context.setRhythm(rhythm);
sync = new Sync(1);
}
@Test
public void continuesIfNotThereYet()
{
assertThat(sync.interpolate(context, 0)).isTrue();
}
@Test
public void finishesIfThere()
{
rhythm.seekHard(2000);
assertThat(sync.interpolate(context, 0)).isFalse();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment