aboutsummaryrefslogtreecommitdiff
path: root/shared/src
diff options
context:
space:
mode:
Diffstat (limited to 'shared/src')
-rw-r--r--shared/src/androidMain/AndroidManifest.xml2
-rw-r--r--shared/src/androidMain/kotlin/mx/trackermap/TrackerMap/Platform.kt5
-rw-r--r--shared/src/androidTest/kotlin/mx/trackermap/TrackerMap/androidTest.kt12
-rw-r--r--shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/Greeting.kt7
-rw-r--r--shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/Platform.kt5
-rw-r--r--shared/src/commonTest/kotlin/mx/trackermap/TrackerMap/commonTest.kt12
-rw-r--r--shared/src/iosMain/kotlin/mx/trackermap/TrackerMap/Platform.kt7
-rw-r--r--shared/src/iosTest/kotlin/mx/trackermap/TrackerMap/iosTest.kt12
8 files changed, 62 insertions, 0 deletions
diff --git a/shared/src/androidMain/AndroidManifest.xml b/shared/src/androidMain/AndroidManifest.xml
new file mode 100644
index 0000000..f480b0f
--- /dev/null
+++ b/shared/src/androidMain/AndroidManifest.xml
@@ -0,0 +1,2 @@
+<?xml version="1.0" encoding="utf-8"?>
+<manifest package="mx.trackermap.TrackerMap" /> \ No newline at end of file
diff --git a/shared/src/androidMain/kotlin/mx/trackermap/TrackerMap/Platform.kt b/shared/src/androidMain/kotlin/mx/trackermap/TrackerMap/Platform.kt
new file mode 100644
index 0000000..8a30a29
--- /dev/null
+++ b/shared/src/androidMain/kotlin/mx/trackermap/TrackerMap/Platform.kt
@@ -0,0 +1,5 @@
+package mx.trackermap.TrackerMap
+
+actual class Platform actual constructor() {
+ actual val platform: String = "Android ${android.os.Build.VERSION.SDK_INT}"
+} \ No newline at end of file
diff --git a/shared/src/androidTest/kotlin/mx/trackermap/TrackerMap/androidTest.kt b/shared/src/androidTest/kotlin/mx/trackermap/TrackerMap/androidTest.kt
new file mode 100644
index 0000000..9b2af46
--- /dev/null
+++ b/shared/src/androidTest/kotlin/mx/trackermap/TrackerMap/androidTest.kt
@@ -0,0 +1,12 @@
+package mx.trackermap.TrackerMap
+
+import org.junit.Assert.assertTrue
+import org.junit.Test
+
+class AndroidGreetingTest {
+
+ @Test
+ fun testExample() {
+ assertTrue("Check Android is mentioned", Greeting().greeting().contains("Android"))
+ }
+} \ No newline at end of file
diff --git a/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/Greeting.kt b/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/Greeting.kt
new file mode 100644
index 0000000..68b4100
--- /dev/null
+++ b/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/Greeting.kt
@@ -0,0 +1,7 @@
+package mx.trackermap.TrackerMap
+
+class Greeting {
+ fun greeting(): String {
+ return "Hello, ${Platform().platform}!"
+ }
+} \ No newline at end of file
diff --git a/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/Platform.kt b/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/Platform.kt
new file mode 100644
index 0000000..9f39005
--- /dev/null
+++ b/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/Platform.kt
@@ -0,0 +1,5 @@
+package mx.trackermap.TrackerMap
+
+expect class Platform() {
+ val platform: String
+} \ No newline at end of file
diff --git a/shared/src/commonTest/kotlin/mx/trackermap/TrackerMap/commonTest.kt b/shared/src/commonTest/kotlin/mx/trackermap/TrackerMap/commonTest.kt
new file mode 100644
index 0000000..87a789b
--- /dev/null
+++ b/shared/src/commonTest/kotlin/mx/trackermap/TrackerMap/commonTest.kt
@@ -0,0 +1,12 @@
+package mx.trackermap.TrackerMap
+
+import kotlin.test.Test
+import kotlin.test.assertTrue
+
+class CommonGreetingTest {
+
+ @Test
+ fun testExample() {
+ assertTrue(Greeting().greeting().contains("Hello"), "Check 'Hello' is mentioned")
+ }
+} \ No newline at end of file
diff --git a/shared/src/iosMain/kotlin/mx/trackermap/TrackerMap/Platform.kt b/shared/src/iosMain/kotlin/mx/trackermap/TrackerMap/Platform.kt
new file mode 100644
index 0000000..4c557dd
--- /dev/null
+++ b/shared/src/iosMain/kotlin/mx/trackermap/TrackerMap/Platform.kt
@@ -0,0 +1,7 @@
+package mx.trackermap.TrackerMap
+
+import platform.UIKit.UIDevice
+
+actual class Platform actual constructor() {
+ actual val platform: String = UIDevice.currentDevice.systemName() + " " + UIDevice.currentDevice.systemVersion
+} \ No newline at end of file
diff --git a/shared/src/iosTest/kotlin/mx/trackermap/TrackerMap/iosTest.kt b/shared/src/iosTest/kotlin/mx/trackermap/TrackerMap/iosTest.kt
new file mode 100644
index 0000000..5847b1c
--- /dev/null
+++ b/shared/src/iosTest/kotlin/mx/trackermap/TrackerMap/iosTest.kt
@@ -0,0 +1,12 @@
+package mx.trackermap.TrackerMap
+
+import kotlin.test.Test
+import kotlin.test.assertTrue
+
+class IosGreetingTest {
+
+ @Test
+ fun testExample() {
+ assertTrue(Greeting().greeting().contains("iOS"), "Check iOS is mentioned")
+ }
+} \ No newline at end of file