Permalink
Browse files

Inner loop - Blue: Clean up showing statement lines view test

  • Loading branch information...
CarlosMChica committed May 2, 2016
1 parent 27bc2ac commit edc71bc16c37c2113b5650bac1ba97b8758fb7cd
@@ -38,7 +38,7 @@
assertThat(layoutManager().getOrientation(), is(VERTICAL));
}
@Test public void show_statement() {
@Test public void show_account_statement_when_view_is_created() {
BankAccount account = givenAnAccount();
whenLaunchActivityWith(account);
@@ -47,18 +47,20 @@
verify(account).showStatement();
}
@Test public void show_view_statement_lines() {
whenLaunchActivity();
final List<ViewStatementLine> lines = lines();
@Test public void present_view_statement_lines() {
givenLaunchedActivity();
whenShowStatementLines();
assertThatStatementContains(lines());
}
final ShowStatementActivity activity = rule.getActivity();
activity.runOnUiThread(new Runnable() {
private void whenShowStatementLines() {
activity().runOnUiThread(new Runnable() {
@Override public void run() {
activity.show(lines);
activity().show(lines());
}
});
assertThatStatementContains(lines);
}
private void assertThatStatementContains(List<ViewStatementLine> lines) {
@@ -73,6 +75,10 @@ private void assertThatStatementContains(List<ViewStatementLine> lines) {
});
}
private void givenLaunchedActivity() {
rule.launchActivity(new Intent());
}
private List<ViewStatementLine> lines() {
return asList(new ViewStatementLine("14/01/2012", "-500", "2500"),
new ViewStatementLine("13/01/2012", "2000", "3000"),

0 comments on commit edc71bc

Please sign in to comment.