-
Notifications
You must be signed in to change notification settings - Fork 0
Unit Test β Basic test structure
Devrath edited this page Oct 23, 2023
·
1 revision
-
@Test
-> Used to indicate that the function is a test case. -
@BeforeEach
-> This will ensure it will run every time before each of the test cases is run -
@AfterEach
-> This will ensure it will run every time after each of the test cases is run
class ExampleUnitTest {
@BeforeEach
fun setUp(){ }
@AfterEach
fun tearDown(){ }
@Test
fun addition_isCorrect() {
assertThat(2+2).isEqualTo(4)
}
}