import org.junit.Assert
import org.junit.Before
import org.junit.BeforeClass
import org.junit.Test
class FeatureTest {
companion object {
private lateinit var heavyFeature: HeavyFeature
@BeforeClass
@JvmStatic
fun beforeHeavy() {
heavyFeature = HeavyFeature()
}
}
private lateinit var feature: Feature
@Before
fun before() {
feature = Feature()
}
@Test
fun testCool() {
Assert.assertTrue(heavyFeature.cool())
Assert.assertTrue(feature.cool())
}
@Test
fun testWow() {
Assert.assertTrue(heavyFeature.wow())
Assert.assertTrue(feature.wow())
}
}
Same as
import org.junit.Assert
import org.junit.Test
class FeatureTest {
companion object {
private val heavyFeature = HeavyFeature()
}
private val feature = Feature()
@Test
fun testCool() {
Assert.assertTrue(heavyFeature.cool())
Assert.assertTrue(feature.cool())
}
@Test
fun testWow() {
Assert.assertTrue(heavyFeature.wow())
Assert.assertTrue(feature.wow())
}
}