dimanche 28 décembre 2014

Robolectric test cases

Got a basic question on Robolectric testing framework.


Just managed to get the framework working in my Android studio for my test project, and now got a basic question. I have 2 test classes inside my test package and every time when i run the test cases using



.gradlew test


its executing only one class, even though there are 2 test classes inside the package. Searched for some good documentation around running the test scripts, didn't find one yet. Can you please point me to some documentation, or let me know how i can test both the classes in the package. This is my sample dummy test case. For testing, i kept the same piece of code is 2 different classes, but its executing only one. Not sure how its picks which class to RUN.


*/



@RunWith(RobolectricTestRunner.class)
public class DummyTest2 {
@Before
public void setup() {
//do whatever is necessary before every test
}

@Test
public void testShouldFail() {
Assert.assertTrue(Boolean.TRUE);
}
}

Aucun commentaire:

Enregistrer un commentaire