How can I test all of the following methods code? I want to play scenarios when all of them are happening to see if my code works for save/restore process of an activity. So
The testing tools offered by Android now offer a means of writing tests that can drive an activity from one state to another, or to recreate an activity to test the save and restore flow. See the Test your app's activities Android Developers documentation page for a list of the capabilities. An example of the syntax – taken from that page – is the following:
@RunWith(AndroidJUnit4::class)
class MyTestSuite {
@Test fun testEvent() {
val scenario = launchActivity()
scenario.moveToState(State.CREATED)
}
}