Skip to content

Instantly share code, notes, and snippets.

@ferPrieto
Last active June 30, 2020 01:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ferPrieto/d78749bbe9ac10e89c8ee74d7c4fdb28 to your computer and use it in GitHub Desktop.
Save ferPrieto/d78749bbe9ac10e89c8ee74d7c4fdb28 to your computer and use it in GitHub Desktop.
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