1
0
mirror of https://github.com/owncloud/android-library.git synced 2026-08-11 08:22:56 +00:00

use robolectric for android tests

This commit is contained in:
Christian Schabesberger
2020-09-24 12:27:25 +02:00
committed by Abel García de Prada
parent 4fbf002807
commit 44894deb21
3 changed files with 17 additions and 0 deletions
+7
View File
@@ -16,6 +16,7 @@ dependencies {
kapt "com.squareup.moshi:moshi-kotlin-codegen:$moshiVersion"
testImplementation "junit:junit:4.13.1"
testImplementation 'org.robolectric:robolectric:4.3.1'
}
android {
@@ -43,4 +44,10 @@ android {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
testOptions {
unitTests {
includeAndroidResources = true
}
}
}
@@ -1,6 +1,7 @@
package com.owncloud.android.lib
import android.net.Uri
import android.os.Build
import com.owncloud.android.lib.resources.status.GetRemoteStatusOperation
import com.owncloud.android.lib.resources.status.HttpScheme.HTTPS_PREFIX
import com.owncloud.android.lib.resources.status.HttpScheme.HTTP_PREFIX
@@ -8,7 +9,12 @@ import org.junit.Assert.assertEquals
import org.junit.Assert.assertFalse
import org.junit.Assert.assertTrue
import org.junit.Test
import org.junit.runner.RunWith
import org.robolectric.RobolectricTestRunner
import org.robolectric.annotation.Config
@RunWith(RobolectricTestRunner::class)
@Config(sdk = [Build.VERSION_CODES.O_MR1])
class GetRemoteStatusOperationTest {
@Test