summaryrefslogtreecommitdiffhomepage
path: root/android
diff options
context:
space:
mode:
authorAlbin <albin@mullvad.net>2023-09-13 22:43:56 +0200
committerAlbin <albin@mullvad.net>2023-09-29 15:58:13 +0200
commitf7b473903419046bfa413075d3376f4784d02a62 (patch)
tree3072faf524c56fd6ee4d2981637fb651394e8eb0 /android
parent3505d6f92812639e688846cbb349f165bd2fab9f (diff)
downloadmullvadvpn-f7b473903419046bfa413075d3376f4784d02a62.tar.xz
mullvadvpn-f7b473903419046bfa413075d3376f4784d02a62.zip
Add simple view model suffix assertion
Diffstat (limited to 'android')
-rw-r--r--android/test/arch/src/test/kotlin/net/mullvad/mullvadvpn/test/arch/ViewModelTests.kt16
1 files changed, 16 insertions, 0 deletions
diff --git a/android/test/arch/src/test/kotlin/net/mullvad/mullvadvpn/test/arch/ViewModelTests.kt b/android/test/arch/src/test/kotlin/net/mullvad/mullvadvpn/test/arch/ViewModelTests.kt
new file mode 100644
index 0000000000..35ffe52c31
--- /dev/null
+++ b/android/test/arch/src/test/kotlin/net/mullvad/mullvadvpn/test/arch/ViewModelTests.kt
@@ -0,0 +1,16 @@
+package net.mullvad.mullvadvpn.test.arch
+
+import androidx.lifecycle.ViewModel
+import com.lemonappdev.konsist.api.Konsist
+import com.lemonappdev.konsist.api.ext.list.withAllParentsOf
+import com.lemonappdev.konsist.api.verify.assert
+import org.junit.Test
+
+class ViewModelTests {
+ @Test
+ fun ensureViewModelsHaveViewModelSuffix() {
+ Konsist.scopeFromProject().classes().withAllParentsOf(ViewModel::class).assert {
+ it.name.endsWith("ViewModel")
+ }
+ }
+}