Created
February 22, 2017 08:56
-
-
Save madhu314/7253ff7ef30356d26e7762b21cbbfa4e to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Test public void testDeletions() throws Exception { | |
assertThat(fixture.sortedList().size()).isEqualTo(0); | |
addArticles(); | |
fixture.callbackRecorder().clear(); | |
int index = Article.Utils.randomWithRange(0, fixture.sortedList().size() - 1); | |
Article articleToDelete = fixture.sortedList().get(index).dupe(); | |
boolean deleted = fixture.sortedList().remove(articleToDelete); | |
assertThat(deleted).isTrue(); | |
assertThat(fixture.callbackRecorder().insertions().size()).isEqualTo(0); | |
assertThat(fixture.callbackRecorder().moves().size()).isEqualTo(0); | |
assertThat(fixture.callbackRecorder().changes().size()).isEqualTo(0); | |
assertThat(fixture.callbackRecorder().deletions().size()).isEqualTo(1); | |
assertThat(fixture.callbackRecorder().deletions().get(0).first).isEqualTo(index); | |
assertThat(fixture.callbackRecorder().deletions().get(0).second).isEqualTo(1); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment