Skip to content

Instantly share code, notes, and snippets.

@iwata-n
Created March 10, 2020 01:18
Show Gist options
  • Save iwata-n/5e98b586290198a2f7c93839d354294a to your computer and use it in GitHub Desktop.
Save iwata-n/5e98b586290198a2f7c93839d354294a to your computer and use it in GitHub Desktop.
DynamicTestの雛形
internal class HogeTest {
@TestFactory
fun test_hoge(): Collection<DynamicTest> {
data class TestCase(
val testName: String,
val params: Param // TODO テストで必要なパラメータ
)
fun execute(testCase: TestCase) {
// TODO テストの動作
}
return listOf(
TestCase("テスト名", params)
).map { testCase ->
dynamicTest(testCase.toString()) { execute(testCase) }
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment