Updated tests

This commit is contained in:
anthonycicc 2018-11-02 21:01:20 -04:00
parent 1fc894829d
commit 361ff69f4b
4 changed files with 40 additions and 36 deletions

View file

@ -23,7 +23,7 @@ android {
} }
buildTypes { buildTypes {
release { release {
minifyEnabled false minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
} }
} }
@ -31,22 +31,20 @@ android {
sourceCompatibility JavaVersion.VERSION_1_8 sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8 targetCompatibility JavaVersion.VERSION_1_8
} }
buildToolsVersion '28.0.3'
} }
dependencies { dependencies {
implementation project(':common') implementation project(':common')
implementation fileTree(include: ['*.jar'], dir: 'libs') implementation fileTree(include: ['*.jar'], dir: 'libs')
implementation(Libs.kotlin_stdlib_jdk8) implementation(Libs.kotlin_stdlib_jdk8)
implementation(Libs.kotlin_reflect) implementation(Libs.kotlin_reflect)
testImplementation(Libs.junit_jupiter_api) testImplementation(Libs.junit_jupiter_api)
testRuntimeOnly(Libs.junit_jupiter_engine) testRuntimeOnly(Libs.junit_jupiter_engine)
// implementation "com.android.support:design:${DependencyVersions.Android.SupportLibrary}"
implementation(Libs.material) implementation(Libs.material)
implementation(Libs.appcompat) implementation(Libs.appcompat)
implementation(Libs.constraintlayout_solver) implementation(Libs.constraintlayout_solver)
androidTestImplementation(Libs.androidx_test_core)
androidTestImplementation(Libs.androidx_test_runner) androidTestImplementation(Libs.androidx_test_runner)
androidTestImplementation(Libs.espresso_core) androidTestImplementation(Libs.espresso_core)
} }

View file

@ -1,7 +1,7 @@
package online.anthonycicchetti.financetracker package online.anthonycicchetti.financetracker
import android.support.test.InstrumentationRegistry import androidx.test.platform.app.InstrumentationRegistry
import android.support.test.runner.AndroidJUnit4 import androidx.test.ext.junit.runners.AndroidJUnit4
import org.junit.Test import org.junit.Test
import org.junit.runner.RunWith import org.junit.runner.RunWith
@ -18,7 +18,7 @@ class ExampleInstrumentedTest {
@Test @Test
fun useAppContext() { fun useAppContext() {
// Context of the app under test. // Context of the app under test.
val appContext = InstrumentationRegistry.getTargetContext() val appContext = InstrumentationRegistry.getInstrumentation().targetContext
assertEquals("online.anthonycicchetti.financetracker", appContext.packageName) assertEquals("online.anthonycicchetti.financetracker", appContext.packageName)
} }
} }

View file

@ -21,6 +21,10 @@ object Libs {
const val espresso_core: String = const val espresso_core: String =
"androidx.test.espresso:espresso-core:" + Versions.espresso_core "androidx.test.espresso:espresso-core:" + Versions.espresso_core
/**
* [core website](https://developer.android.com/testing) */
const val androidx_test_core: String = "androidx.test:core:" + Versions.androidx_test_core
/** /**
* [runner website](https://developer.android.com/testing) */ * [runner website](https://developer.android.com/testing) */
const val androidx_test_runner: String = "androidx.test:runner:" + Versions.androidx_test_runner const val androidx_test_runner: String = "androidx.test:runner:" + Versions.androidx_test_runner

View file

@ -13,13 +13,15 @@ object Versions {
const val espresso_core: String = "3.1.0" const val espresso_core: String = "3.1.0"
const val androidx_test_core: String = "1.0.0"
const val androidx_test_runner: String = "1.1.0" const val androidx_test_runner: String = "1.1.0"
const val aapt2: String = "3.2.0-4818971" //available: "3.2.1-4818971" const val aapt2: String = "3.2.1-4818971"
const val com_android_tools_build_gradle: String = "3.2.1" const val com_android_tools_build_gradle: String = "3.2.1"
const val lint_gradle: String = "26.2.0" //available: "26.2.1" const val lint_gradle: String = "26.2.1"
const val jackson_module_kotlin: String = "2.9.7" const val jackson_module_kotlin: String = "2.9.7"
@ -33,7 +35,7 @@ object Versions {
const val org_jetbrains_kotlin: String = "1.3.0" const val org_jetbrains_kotlin: String = "1.3.0"
const val org_junit_jupiter: String = "5.3.1" //available: "5.3.1" const val org_junit_jupiter: String = "5.3.1"
/** /**
* *
@ -45,7 +47,7 @@ object Versions {
const val currentVersion: String = "4.10.2" const val currentVersion: String = "4.10.2"
const val nightlyVersion: String = "5.1-20181102000039+0000" const val nightlyVersion: String = "5.1-20181103000035+0000"
const val releaseCandidate: String = "5.0-rc-1" const val releaseCandidate: String = "5.0-rc-1"
} }