package de.eightbitboy.hijacr.data;

import org.junit.Assert;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.robolectric.RobolectricGradleTestRunner;
import org.robolectric.annotation.Config;

import de.eightbitboy.hijacr.BuildConfig;

import static org.hamcrest.core.IsEqual.equalTo;

@RunWith(RobolectricGradleTestRunner.class)
@Config(constants = BuildConfig.class, sdk = 21)
public class ComicFetchTaskTest {
	@Test
	public void doSomething() {
		String foo = "x";
		String bar = "x";
		Assert.assertThat(foo, equalTo(bar));
	}

	@Test
	public void testFetch() {

	}
}

@@ -34,33 +34,8 @@
 a;%0A%0A
-import org.junit.Assert;%0A
 impo
@@ -218,24 +218,125 @@
 BuildConfig;
+%0Aimport de.eightbitboy.hijacr.net.AbstractFetchTask;%0Aimport de.eightbitboy.hijacr.net.ComicFetchTask;
 %0A%0Aimport sta
@@ -373,16 +373,59 @@
 equalTo;
+%0Aimport static org.junit.Assert.assertThat;
 %0A%0A@RunWi
@@ -623,23 +623,16 @@
  %22x%22;%0A%09%09
-Assert.
 assertTh
@@ -692,14 +692,699 @@
 tch() %7B%0A
+%09%09AbstractFetchTask.FetchTaskListener listener = new AbstractFetchTask.FetchTaskListener() %7B%0A%09%09%09@Override%0A%09%09%09public void onFetchTaskFinished(String imageUrl, String requestedUrl, String previousUrl, String nextUrl) %7B%0A%09%09%09%09assertThat(imageUrl,%0A%09%09%09%09%09%09equalTo(%22http://imgs.xkcd.com/comics/tree_cropped_(1).jpg%22));%0A%09%09%09%09assertThat(requestedUrl,%0A%09%09%09%09%09%09equalTo(%22http://xkcd.com/2/%22));%0A%09%09%09%09assertThat(previousUrl,%0A%09%09%09%09%09%09equalTo(%22http://xkcd.com/1/%22));%0A%09%09%09%09assertThat(nextUrl,%0A%09%09%09%09%09%09equalTo(%22http://xkcd.com/3/%22));%0A%09%09%09%7D%0A%09%09%7D;%0A%0A%09%09new ComicFetchTask(%0A%09%09%09%09%22https://xkcd.com/2/%22,%0A%09%09%09%09%22#comic img%5Bsrc%5D%22,%0A%09%09%09%09%22.comicNav a%5Brel=prev%5D%22,%0A%09%09%09%09%22.comicNav a%5Brel=next%5D%22,%0A%09%09%09%09null,%0A%09%09%09%09listener)%0A%09%09%09%09.execute();
 %0A%09%7D%0A%7D%0A

Implement test