In iOS there exists a tear block you can add to individual tests called addTearDownBlock
and you put it inside a single test and it will only execute for that single test.
Does android have a similar version of this?
In iOS there exists a tear block you can add to individual tests called addTearDownBlock
and you put it inside a single test and it will only execute for that single test.
Does android have a similar version of this?
Unit testing in android is done with xUnit variation known as JUnit. If you are using JUnit 4.0, then use the following annotation:
@AfterClass //Will only execute once after all the tests in the class have exhausted
@After //Will run after every test
If you are using JUnit 5.0 then use the following annotation:
@AfterEach //Will run after every test
@AfterAll //Will only execute once after all the tests in the class have exhausted