Last active
February 22, 2017 08:51
-
-
Save madhu314/e4ecbc8e5536bb5784a6b131cc5f14ad 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 testAdditionOfSameObjectShouldNotChangeSortedList() throws Exception { | |
assertThat(fixture.sortedList().size()).isEqualTo(0); | |
Article article = fixture.orderedArticleList() | |
.get(Article.Utils.randomWithRange(0, fixture.orderedArticleList().size() - 1)); | |
fixture.sortedList().add(article); | |
assertThat(fixture.callbackRecorder().insertions().size()).isEqualTo(1); | |
assertThat(fixture.callbackRecorder().deletions().size()).isEqualTo(0); | |
assertThat(fixture.callbackRecorder().moves().size()).isEqualTo(0); | |
assertThat(fixture.callbackRecorder().changes().size()).isEqualTo(0); | |
fixture.callbackRecorder().clear(); | |
assertThat(fixture.sortedList().size()).isEqualTo(1); | |
for (int i = 0; i < Article.Utils.randomWithRange(1, 10); i++) { | |
fixture.sortedList().add(article.dupe()); | |
} | |
assertThat(fixture.sortedList().size()).isEqualTo(1); | |
assertThat(fixture.callbackRecorder().insertions().size()).isEqualTo(0); | |
assertThat(fixture.callbackRecorder().deletions().size()).isEqualTo(0); | |
assertThat(fixture.callbackRecorder().moves().size()).isEqualTo(0); | |
assertThat(fixture.callbackRecorder().changes().size()).isEqualTo(0); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment