Add Konsist test about class name: Class implementing interface should have name not end with 'Impl' but start with 'Default'
This commit is contained in:
parent
c2471693c9
commit
cf4497d323
1 changed files with 10 additions and 0 deletions
|
|
@ -21,7 +21,9 @@ import com.bumble.appyx.core.node.Node
|
|||
import com.lemonappdev.konsist.api.Konsist
|
||||
import com.lemonappdev.konsist.api.ext.list.withAllParentsOf
|
||||
import com.lemonappdev.konsist.api.ext.list.withNameContaining
|
||||
import com.lemonappdev.konsist.api.ext.list.withNameEndingWith
|
||||
import com.lemonappdev.konsist.api.ext.list.withoutName
|
||||
import com.lemonappdev.konsist.api.verify.assertEmpty
|
||||
import com.lemonappdev.konsist.api.verify.assertTrue
|
||||
import io.element.android.libraries.architecture.Presenter
|
||||
import org.junit.Test
|
||||
|
|
@ -81,4 +83,12 @@ class KonsistClassNameTest {
|
|||
it.parents().any { parent -> parent.name.replace(".", "") == interfaceName }
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `Class implementing interface should have name not end with 'Impl' but start with 'Default'`() {
|
||||
Konsist.scopeFromProject()
|
||||
.classes()
|
||||
.withNameEndingWith("Impl")
|
||||
.assertEmpty(additionalMessage = "Class implementing interface should have name not end with 'Impl' but start with 'Default'")
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue