Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
class InstagramErrorByClassTest {
@Nested
@TestInstance(TestInstance.Lifecycle.PER_CLASS)
inner class MixedConstructors {
private val instagramErrors = mutableListOf<String>()
@AfterAll
fun check() {
Assertions.assertEquals(
listOf(
"DeclinePost",
"TooLongVideoPost",
"TimeoutStory",
"TooShortIGTvPost",
"TimeOutIGTvPost"
), instagramErrors
)
}
@ParameterizedTest
@SealedClassesSource(factoryClass = InstagramTypeFactory::class)
fun build(member: InstagramErrorType) {
instagramErrors.add(member::class.simpleName!!)
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment