Skip to content

Instantly share code, notes, and snippets.

@madhu314
Created February 22, 2017 08:58
Show Gist options
  • Save madhu314/a280a36849500cb4e5d6d424a5142ded to your computer and use it in GitHub Desktop.
Save madhu314/a280a36849500cb4e5d6d424a5142ded to your computer and use it in GitHub Desktop.
@Test public void testMoves() throws Exception {
assertThat(fixture.sortedList().size()).isEqualTo(0);
addArticles();
fixture.callbackRecorder().clear();
int index1 = 2;
Article articleOne = fixture.sortedList().get(index1);
assertThat(fixture.sortedList().indexOf(articleOne)).isEqualTo(index1);
fixture.sortedList().updateItemAt(index1, articleOne.toBuilder().publishedTime(1).build());
assertThat(fixture.callbackRecorder().insertions().size()).isEqualTo(0);
assertThat(fixture.callbackRecorder().deletions().size()).isEqualTo(0);
assertThat(fixture.callbackRecorder().moves().size()).isEqualTo(1);
assertThat(fixture.callbackRecorder().moves().get(0).first).isEqualTo(2);
assertThat(fixture.callbackRecorder().moves().get(0).second).isEqualTo(0);
assertThat(fixture.callbackRecorder().changes().get(0).first).isEqualTo(2);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment