Add AfterTest and BeforeTest aliases for tests
This commit is contained in:
committed by
Pavel Punegov
parent
588dd7efb7
commit
0c8ca828eb
@@ -20,16 +20,16 @@ object IgnoredObject {
|
||||
|
||||
class A {
|
||||
companion object {
|
||||
@BeforeEach fun before() { println("before (A.companion)") }
|
||||
@AfterEach fun after() { println("after (A.companion)") }
|
||||
@BeforeTest fun before() { println("before (A.companion)") }
|
||||
@AfterTest fun after() { println("after (A.companion)") }
|
||||
@Test fun test1() { println("test1 (A.companion)") }
|
||||
|
||||
@BeforeClass fun beforeClass() { println("beforeClass (A.companion)") }
|
||||
@AfterClass fun afterClass() { println("afterClass (A.companion)") }
|
||||
}
|
||||
|
||||
@BeforeEach fun before() { println("before (A)") }
|
||||
@AfterEach fun after() { println("after (A)") }
|
||||
@BeforeTest fun before() { println("before (A)") }
|
||||
@AfterTest fun after() { println("after (A)") }
|
||||
@Test fun test1() { println("test1 (A)") }
|
||||
@Ignore @Test fun ignoredTest() { throw AssertionError("Ignored test") }
|
||||
|
||||
|
||||
@@ -58,3 +58,6 @@ annotation class AfterEach
|
||||
@Retention(AnnotationRetention.SOURCE)
|
||||
@Target(AnnotationTarget.CLASS, AnnotationTarget.FUNCTION)
|
||||
annotation class Ignore
|
||||
|
||||
typealias AfterTest = AfterEach
|
||||
typealias BeforeTest = BeforeEach
|
||||
|
||||
Reference in New Issue
Block a user