Skip to content

Commit

Permalink
Get Started with Testing (#10)
Browse files Browse the repository at this point in the history
* Write first code generation test

* Expand suite of Activity code generation tests

* Expand suite to include fragments
  • Loading branch information
cedrickcooke authored Apr 20, 2020
1 parent f57d9bb commit d285e1d
Show file tree
Hide file tree
Showing 9 changed files with 659 additions and 51 deletions.
14 changes: 5 additions & 9 deletions application/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,6 @@ android {
versionName "1.0"

testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"

javaCompileOptions {
annotationProcessorOptions {
arguments = [
"exercise.buildConfigPackage": "com.juullabs.exercise"
]
}
}
}

buildTypes {
Expand Down Expand Up @@ -54,7 +46,11 @@ dependencies {
api 'androidx.activity:activity-ktx:1.2.0-alpha02'
api 'androidx.fragment:fragment-ktx:1.3.0-alpha02'
kapt project(":compile")
testImplementation 'junit:junit:4.12'
testImplementation project(":compile")
testImplementation "com.github.tschuchortdev:kotlin-compile-testing:1.2.7"
testImplementation "org.assertj:assertj-core:3.15.0"
testImplementation "org.jetbrains.kotlin:kotlin-test:$kotlin_version"
testImplementation "org.jetbrains.kotlin:kotlin-test-junit:$kotlin_version"
androidTestImplementation 'androidx.annotation:annotation:1.1.0'
androidTestImplementation 'androidx.test.ext:junit:1.1.1'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
package com.juullabs.exercise

import org.assertj.core.api.AbstractStringAssert
import org.intellij.lang.annotations.Language

/** Wrapper around [AbstractStringAssert.isEqualTo] for Kotlin code literals to syntax highlight in Android Studio. */
fun AbstractStringAssert<*>.isEqualToKotlin(
@Language("kotlin") source: String
): AbstractStringAssert<*> = this.isEqualTo(source.trimIndent())
17 changes: 0 additions & 17 deletions application/src/test/java/com/juullabs/exercise/ExampleUnitTest.kt

This file was deleted.

Loading

0 comments on commit d285e1d

Please sign in to comment.