Skip to content

Commit

Permalink
Add assertion to basic test - fail if no answers were created (#44)
Browse files Browse the repository at this point in the history
  • Loading branch information
MarounMaroun authored Mar 28, 2018
1 parent b3545d6 commit 6c712c4
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions so-eclipse-plugin/tests/so/basic/tests/BasicTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import static org.hamcrest.CoreMatchers.containsString;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertThat;
import static org.junit.Assert.assertTrue;
import static org.junit.Assert.fail;

import java.io.IOException;
Expand All @@ -25,7 +26,6 @@ public class BasicTest {
@Test
public void testGoogleFetcher() {
List<GoogleResult> googleResults = GoogleFetcher.getGoogleResults(GOOGLE_QUERY, new NullProgressMonitor());

for (GoogleResult res : googleResults) {
assertThat(res.getUrl().toString(), containsString("stackoverflow.com"));
}
Expand All @@ -35,7 +35,8 @@ public void testGoogleFetcher() {
public void testStackoverflowFetcher() throws IOException {
StackoverflowPost soPost = new StackoverflowPost(STACK_OVERFLOW_LINK);
List<StackoverflowAnswer> answers = soPost.getAnswers();

assertTrue(answers.size() > 1);

for (StackoverflowAnswer answer : answers) {
assertFalse(answer.getBody().isEmpty());
assertFalse(answer.getUser().isEmpty());
Expand Down

0 comments on commit 6c712c4

Please sign in to comment.