@@ -0,0 +1,1230 @@
+package com.udacity.gradle.builditbigger;%0A%0Aimport android.test.AndroidTestCase;%0A%0Aimport com.udacity.gradle.builditbigger.task.FetchJokeTask;%0A%0Aimport java.util.concurrent.CountDownLatch;%0Aimport java.util.concurrent.TimeUnit;%0A%0A/**%0A * Created by Amrendra Kumar on 19/02/16.%0A */%0Apublic class FetchJokeTaskTest extends AndroidTestCase implements FetchJokeTask.JokeListener %7B%0A    /*%0A    How to test async tasks%0A    http://stackoverflow.com/questions/2321829/android-asynctask-testing-with-android-test-framework%0A     */%0A%0A    // create  a signal to let us know when our task is done.%0A    final CountDownLatch signal = new CountDownLatch(1);%0A%0A    public void testJokeIsRetrieved() %7B%0A        new FetchJokeTask(this).execute();%0A        try %7B%0A            boolean pass = signal.await(20, TimeUnit.SECONDS);%0A            assertTrue(%22Timed Out%22, pass);%0A        %7D catch (InterruptedException e) %7B%0A            fail(%22Error : %22 + e.getLocalizedMessage());%0A        %7D%0A    %7D%0A%0A    @Override%0A    public void jokeLoaded(String joke) %7B%0A        assertNotNull(joke);%0A        assertTrue(joke.trim().length() %3E 0);%0A        String error = %22Unable to resolve host%22;%0A        assertTrue(%22Network Error%22, !joke.contains(error));%0A        signal.countDown();%0A    %7D%0A%7D%0A

Add test for FetchJoke Async Task