Skip to content

Instantly share code, notes, and snippets.

@ismailkocacan
Created April 21, 2014 21:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ismailkocacan/11157302 to your computer and use it in GitHub Desktop.
Save ismailkocacan/11157302 to your computer and use it in GitHub Desktop.
import java.util.List;
import java.util.concurrent.CountDownLatch;
import java.util.concurrent.TimeUnit;
import com.projen.Kisi;
import com.projen.MyAsyncTask;
import android.test.InstrumentationTestCase;
public class TestMyAsyncTask extends InstrumentationTestCase
{
final CountDownLatch mandal = new CountDownLatch(1);
private MyAsyncTask task;
@Override
protected void setUp() throws Exception
{
super.setUp();
task = new MyAsyncTask();
}
@Override
protected void tearDown() throws Exception {
super.tearDown();
}
public void test_kisi_listesi_eleman_sayisi_sifirdan_buyukmu() throws Throwable
{
runTestOnUiThread(new Runnable() {
@Override
public void run() {
task.execute();
}
});
mandal.await(10, TimeUnit.SECONDS);
mandal.countDown();
List<Kisi> sonucList = task.getKisiList();
Boolean result = (sonucList != null) && (sonucList.size()==0);
assertFalse("Kişi Listesi Boş !", result);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment