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:
@@ -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'")
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user