Created
April 21, 2014 21:32
-
-
Save ismailkocacan/11157302 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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