mirror of
https://github.com/2006-Scape/apollo.git
synced 2026-07-04 08:39:27 +00:00
248a7d97d9
Updates the testing infrastructure to use the latest relesae of junit and leverages the new extension mechanism to create an easy to use testing framework. Also adds additional test coverage for several plugins.
17 lines
743 B
Kotlin
17 lines
743 B
Kotlin
import org.apollo.game.plugin.skills.woodcutting.Tree
|
|
import org.junit.jupiter.api.extension.ExtensionContext
|
|
import org.junit.jupiter.params.provider.Arguments
|
|
import org.junit.jupiter.params.provider.ArgumentsProvider
|
|
import java.util.stream.Stream
|
|
|
|
data class WoodcuttingTestData(val treeId: Int, val stumpId: Int, val tree: Tree)
|
|
|
|
fun woodcuttingTestData(): Collection<WoodcuttingTestData> = Tree.values()
|
|
.flatMap { tree -> tree.objects.map { WoodcuttingTestData(it, tree.stump, tree) } }
|
|
.toList()
|
|
|
|
class WoodcuttingTestDataProvider : ArgumentsProvider {
|
|
override fun provideArguments(context: ExtensionContext?): Stream<out Arguments> {
|
|
return woodcuttingTestData().map { Arguments { arrayOf(it) } }.stream()
|
|
}
|
|
} |