-
Notifications
You must be signed in to change notification settings - Fork 349
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'add-konsist-for-arch-testing-droid-334'
- Loading branch information
Showing
9 changed files
with
122 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
plugins { | ||
id(Dependencies.Plugin.androidLibraryId) | ||
id(Dependencies.Plugin.kotlinAndroidId) | ||
} | ||
|
||
android { | ||
namespace = "net.mullvad.mullvadvpn.test.arch" | ||
compileSdk = Versions.Android.compileSdkVersion | ||
|
||
defaultConfig { | ||
minSdk = Versions.Android.minSdkVersion | ||
} | ||
|
||
compileOptions { | ||
sourceCompatibility = JavaVersion.VERSION_17 | ||
targetCompatibility = JavaVersion.VERSION_17 | ||
} | ||
|
||
kotlinOptions { | ||
jvmTarget = Versions.jvmTarget | ||
} | ||
|
||
lint { | ||
lintConfig = file("${rootProject.projectDir}/config/lint.xml") | ||
abortOnError = true | ||
warningsAsErrors = true | ||
} | ||
} | ||
|
||
androidComponents { | ||
beforeVariants { variantBuilder -> | ||
variantBuilder.apply { | ||
enable = name != "release" | ||
} | ||
} | ||
} | ||
|
||
dependencies { | ||
testImplementation(Dependencies.AndroidX.appcompat) | ||
testImplementation(Dependencies.junit) | ||
testImplementation(Dependencies.konsist) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
<manifest /> |
16 changes: 16 additions & 0 deletions
16
android/test/arch/src/test/kotlin/net/mullvad/mullvadvpn/test/arch/ViewModelTests.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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") | ||
} | ||
} | ||
} |