ceedee
09/22/2023, 12:23 PM@Test
fun `every class with a name ending on FragmentDelegate needs to be (indirectly) derived from BaseFragmentDelegate`() {
Konsist.scopeFromProduction()
.classes()
.withNameEndingWith("FragmentDelegate")
.takeIf { it.isNotEmpty() }
?.assert { klass ->
val classToCheckForInheritance = Class.forName(klass.fullyQualifiedName)
BaseFragmentDelegate::class.java.isAssignableFrom(classToCheckForInheritance)
}
}
igor.wojda
09/22/2023, 11:41 PM@Test
fun `every class with a name ending on FragmentDelegate needs to be (indirectly) derived from BaseFragmentDelegate`() {
Konsist.scopeFromProduction()
.classes()
.withNameEndingWith("FragmentDelegate")
?.assert {
it.hasParentOf<BaseFragmentDelegate>()
}
}
.takeIf { it.isNotEmpty() }
should not be required - please tell me whats happens if this is not present (this may be a bug) 🤔