Skip to content

Commit aa78df2

Browse files
fix: unit tests
Completely remove 3rd-party lib unmock. Use supported by Robolectric.
1 parent 84b1053 commit aa78df2

File tree

3 files changed

+8
-12
lines changed

3 files changed

+8
-12
lines changed

DemoApp/DemoAppKotlin/app/build.gradle

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ android {
99
namespace "co.optable.androidsdkdemo"
1010

1111
defaultConfig {
12-
// TODO: Change
1312
applicationId "co.optable.androidsdkdemo"
1413
minSdkVersion 21
1514
targetSdkVersion 34

android_sdk/build.gradle

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,6 @@ plugins {
44
id("de.nanogiants.android-versioning") version "2.4.0"
55
}
66

7-
// TODO: Check
8-
//apply plugin: 'de.mobilej.unmock'
9-
10-
//unMock {
11-
// keep "android.net.Uri"
12-
// keepStartingWith "libcore."
13-
// keepAndRename "java.nio.charset.Charsets" to "xjava.nio.charset.Charsets"
14-
//}
15-
167
android {
178
compileSdk 34
189

@@ -69,7 +60,11 @@ dependencies {
6960

7061
implementation 'com.google.android.gms:play-services-ads:24.6.0'
7162

72-
testImplementation 'junit:junit:4.13.2'
63+
// Unit tests
64+
testImplementation("junit:junit:4.13.2")
65+
testImplementation("org.robolectric:robolectric:4.16")
66+
67+
// UI tests
7368
androidTestImplementation 'androidx.test.ext:junit:1.2.1'
7469
androidTestImplementation 'androidx.test.espresso:espresso-core:3.6.1'
7570
}

android_sdk/src/test/java/co/optable/android_sdk/OptableSDKUnitTest.kt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,15 @@ import android.net.Uri
88
import org.junit.Assert.assertEquals
99
import org.junit.Assert.assertNotEquals
1010
import org.junit.Test
11+
import org.junit.runner.RunWith
12+
import org.robolectric.RobolectricTestRunner
1113

1214
/**
1315
* OptableSDK unit tests
1416
*/
17+
@RunWith(RobolectricTestRunner::class)
1518
class OptableSDKUnitTest {
1619

17-
// TODO: Fix
1820
@Test
1921
fun eid_isCorrect() {
2022
val expected = "e:a665a45920422f9d417e4867efdc4fb8a04a1f3fff1fa07e998e86f7f7a27ae3"

0 commit comments

Comments
 (0)