Add AfterTest and BeforeTest aliases for tests

This commit is contained in:
Pavel Punegov
2018-03-06 09:10:15 +03:00
committed by Pavel Punegov
parent 588dd7efb7
commit 0c8ca828eb
2 changed files with 7 additions and 4 deletions
+4 -4
View File
@@ -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