@@ -6,27 +6,29 @@ import com.lemonappdev.konsist.api.ext.list.functions
6
6
import com.lemonappdev.konsist.api.ext.list.modifierprovider.withPublicOrDefaultModifier
7
7
import com.lemonappdev.konsist.api.ext.list.properties
8
8
import com.lemonappdev.konsist.api.ext.list.withAllParentsOf
9
- import com.lemonappdev.konsist.api.verify.assert
10
- import com.lemonappdev.konsist.api.verify.assertNot
9
+ import com.lemonappdev.konsist.api.verify.assertFalse
10
+ import com.lemonappdev.konsist.api.verify.assertTrue
11
11
import org.junit.jupiter.api.Test
12
12
13
- class ViewModelTests {
13
+ class ViewModelTest {
14
14
@Test
15
15
fun `ensure view models have view model suffix` () =
16
- allViewModels().assert { it.name.endsWith(" ViewModel" ) }
16
+ allViewModels().assertTrue { it.name.endsWith(" ViewModel" ) }
17
17
18
18
// The purpose of this check is to both keep the naming consistent and also to avoid exposing
19
19
// properties that shouldn't be exposed.
20
20
@Test
21
21
fun `ensure public properties use permitted names` () =
22
- allViewModels().properties(includeNested = false ).withPublicOrDefaultModifier().assert {
23
- property ->
24
- property.name == " uiState" || property.name == " uiSideEffect"
25
- }
22
+ allViewModels()
23
+ .properties(includeNested = false )
24
+ .withPublicOrDefaultModifier()
25
+ .assertTrue { property ->
26
+ property.name == " uiState" || property.name == " uiSideEffect"
27
+ }
26
28
27
29
@Test
28
30
fun `ensure public functions have no return type` () =
29
- allViewModels().functions().withPublicOrDefaultModifier().assertNot { function ->
31
+ allViewModels().functions().withPublicOrDefaultModifier().assertFalse { function ->
30
32
function.hasReturnType()
31
33
}
32
34
0 commit comments