diff options
| author | Michael Keppler <michael.keppler@gmx.de> | 2014-04-22 17:30:51 +0200 |
|---|---|---|
| committer | Michael Keppler <michael.keppler@gmx.de> | 2014-04-22 21:44:00 +0200 |
| commit | cc9aa8b1d2b9ec24f2c41e4a523c69edcf8c8ac0 (patch) | |
| tree | fca2712f72bb2759ef4e39c0235a8a5054f27013 /tests/src/cgeo/geocaching/files/SimpleDirChooserUITest.java | |
| parent | 825b779844b280ba7c1effdd4185cc856eccdf5b (diff) | |
| download | cgeo-cc9aa8b1d2b9ec24f2c41e4a523c69edcf8c8ac0.zip cgeo-cc9aa8b1d2b9ec24f2c41e4a523c69edcf8c8ac0.tar.gz cgeo-cc9aa8b1d2b9ec24f2c41e4a523c69edcf8c8ac0.tar.bz2 | |
#2414 convert junit statements to assertj
This conversion is not complete, but the remaining statements are hard
to catch with regular expressions automatically.
Diffstat (limited to 'tests/src/cgeo/geocaching/files/SimpleDirChooserUITest.java')
| -rw-r--r-- | tests/src/cgeo/geocaching/files/SimpleDirChooserUITest.java | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/tests/src/cgeo/geocaching/files/SimpleDirChooserUITest.java b/tests/src/cgeo/geocaching/files/SimpleDirChooserUITest.java index 7607ad0..d8d099d 100644 --- a/tests/src/cgeo/geocaching/files/SimpleDirChooserUITest.java +++ b/tests/src/cgeo/geocaching/files/SimpleDirChooserUITest.java @@ -1,5 +1,7 @@ package cgeo.geocaching.files; +import static org.assertj.core.api.Assertions.assertThat; + import cgeo.geocaching.Intents; import com.robotium.solo.Solo; @@ -47,8 +49,8 @@ public class SimpleDirChooserUITest extends ActivityInstrumentationTestCase2<Sim final int lastIndex = getCurrentCheckBoxes().size() - 1; solo.clickOnCheckBox(lastIndex); - assertTrue(solo.isCheckBoxChecked(lastIndex)); - assertFalse(solo.isCheckBoxChecked(0)); + assertThat(solo.isCheckBoxChecked(lastIndex)).isTrue(); + assertThat(solo.isCheckBoxChecked(0)).isFalse(); assertChecked("Clicked last checkbox", 1); solo.scrollUp(); @@ -61,10 +63,10 @@ public class SimpleDirChooserUITest extends ActivityInstrumentationTestCase2<Sim pause(); solo.clickOnCheckBox(0); assertChecked("Clicked first checkbox", 1); - assertTrue(solo.isCheckBoxChecked(0)); + assertThat(solo.isCheckBoxChecked(0)).isTrue(); solo.clickOnCheckBox(1); assertChecked("Clicked second checkbox", 1); - assertTrue(solo.isCheckBoxChecked(1)); + assertThat(solo.isCheckBoxChecked(1)).isTrue(); } private static void pause() throws InterruptedException { @@ -73,8 +75,8 @@ public class SimpleDirChooserUITest extends ActivityInstrumentationTestCase2<Sim private void assertChecked(String message, int expectedChecked) { final ArrayList<CheckBox> boxes = getCurrentCheckBoxes(); - assertNotNull("Could not get checkboxes", boxes); - assertTrue("There are no checkboxes", boxes.size() > 1); + assertThat(boxes).as("Checkboxes").isNotNull(); + assertThat(boxes.size()).as("number of checkboxes").isGreaterThan(1); int checked = 0; for (int i = 0; i < boxes.size(); i++) { if (solo.isCheckBoxChecked(i)) { |
