Currently i'm researching a ways of writing unit and integration tests for android apps. I have so confused that there is absent a possibility to provide a set of parameters directly to the method like JUnitParams library does. So i have several questions:
I'm not familiar with JUnitParamsRunner but I'd recommend creating multiple test methods, one for each outcome you wish to test. Each class you are testing should have it's own test class and the code required for testing would be contained within that (aside from generic helpers).
This is generally how my tests look (basically Given, When, Then):
public void testExample() throws Exception {
// setup test data
// do the actual method calls
// assert the expected outcome
}
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.