Move kotlin.test common annotations tests
Place them in tests of kotlin-test-annotations-common, so that every platform module that implements that common module (e.g. kotlin-test-junit, kotlin-test-junit5, kotlin-test-testng) gets these tests run. Improve test for BeforeTest/AfterTest annotations to check that they are invoked before/after _each_ test method. #KT-27629
This commit is contained in:
@@ -1,40 +0,0 @@
|
||||
/*
|
||||
* Copyright 2010-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license
|
||||
* that can be found in the license/LICENSE.txt file.
|
||||
*/
|
||||
|
||||
package kotlin.test.tests
|
||||
|
||||
import kotlin.test.*
|
||||
|
||||
private var value = 5
|
||||
|
||||
class AnnotationsTest {
|
||||
|
||||
@BeforeTest
|
||||
fun setup() {
|
||||
value *= 2
|
||||
}
|
||||
|
||||
@AfterTest
|
||||
fun teardown() {
|
||||
value /= 2
|
||||
}
|
||||
|
||||
@Test
|
||||
fun testValue() {
|
||||
assertEquals(10, value)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun testValueAgain() {
|
||||
assertEquals(10, value)
|
||||
}
|
||||
|
||||
@Ignore
|
||||
@Test
|
||||
fun testValueWrong() {
|
||||
assertEquals(20, value)
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user