Initial commit
This commit is contained in:
@@ -4,17 +4,6 @@ plugins {
|
||||
}
|
||||
|
||||
kotlin {
|
||||
androidLibrary {
|
||||
withHostTestBuilder {
|
||||
}
|
||||
|
||||
withDeviceTestBuilder {
|
||||
sourceSetTreeName = "test"
|
||||
}.configure {
|
||||
instrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
|
||||
}
|
||||
}
|
||||
|
||||
sourceSets {
|
||||
commonMain {
|
||||
dependencies {
|
||||
|
||||
@@ -1,21 +0,0 @@
|
||||
package dev.carlosmartino.common
|
||||
|
||||
import androidx.test.ext.junit.runners.AndroidJUnit4
|
||||
import androidx.test.platform.app.InstrumentationRegistry
|
||||
import org.junit.Test
|
||||
import org.junit.runner.RunWith
|
||||
|
||||
/**
|
||||
* Instrumented test, which will execute on an Android device.
|
||||
*
|
||||
* See [testing documentation](http://d.android.com/tools/testing).
|
||||
*/
|
||||
@RunWith(AndroidJUnit4::class)
|
||||
class ExampleInstrumentedTest {
|
||||
@Test
|
||||
fun useAppContext() {
|
||||
// Context of the app under test.
|
||||
val appContext = InstrumentationRegistry.getInstrumentation().targetContext
|
||||
assertEquals("dev.carlosmartino.common.test", appContext.packageName)
|
||||
}
|
||||
}
|
||||
@@ -1,16 +0,0 @@
|
||||
package dev.carlosmartino.common
|
||||
|
||||
import kotlin.test.Test
|
||||
import kotlin.test.assertEquals
|
||||
|
||||
/**
|
||||
* Example local unit test, which will execute on the development machine (host).
|
||||
*
|
||||
* See [testing documentation](http://d.android.com/tools/testing).
|
||||
*/
|
||||
class ExampleUnitTest {
|
||||
@Test
|
||||
fun addition_isCorrect() {
|
||||
assertEquals(4, 2 + 2)
|
||||
}
|
||||
}
|
||||
@@ -1,3 +0,0 @@
|
||||
package dev.carlosmartino.common
|
||||
|
||||
actual fun platform() = "Android"
|
||||
@@ -0,0 +1,3 @@
|
||||
package dev.carlosmartino.features.common
|
||||
|
||||
actual fun platform() = "Android"
|
||||
@@ -1,3 +0,0 @@
|
||||
package dev.carlosmartino.common
|
||||
|
||||
expect fun platform(): String
|
||||
@@ -0,0 +1,7 @@
|
||||
package dev.carlosmartino.features.common
|
||||
|
||||
expect fun platform(): String
|
||||
|
||||
class CommonGreetings {
|
||||
fun greet(): String = "Hello, ${platform()}!"
|
||||
}
|
||||
@@ -1,3 +0,0 @@
|
||||
package dev.carlosmartino.common
|
||||
|
||||
actual fun platform() = "iOS"
|
||||
@@ -0,0 +1,3 @@
|
||||
package dev.carlosmartino.features.common
|
||||
|
||||
actual fun platform() = "iOS"
|
||||
Reference in New Issue
Block a user