Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Kotlin migration #413

Merged
merged 10 commits into from
Oct 24, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@ android {
compileSdk 34
minSdk 26
targetSdk 34
versionCode 84
versionName "14.7.0"
versionCode 85
versionName "15.0.0"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
multiDexEnabled true

Expand Down

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
package de.bahnhoefe.deutschlands.bahnhofsfotos

import androidx.test.platform.app.InstrumentationRegistry
import org.assertj.core.api.Assertions.assertThat
import org.junit.jupiter.api.Test

/**
* Instrumentation test, which will execute on an Android device.
*
* @see [Testing documentation](http://d.android.com/tools/testing)
*/
class ExampleInstrumentationTest {
@Test
fun useAppContext() {
// Context of the app under test.
val appContext = InstrumentationRegistry.getInstrumentation().targetContext
assertThat(appContext.packageName)
.isEqualTo("de.bahnhoefe.deutschlands.bahnhofsfotos.debug")
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
package de.bahnhoefe.deutschlands.bahnhofsfotos.util

import de.bahnhoefe.deutschlands.bahnhofsfotos.model.Country
import de.bahnhoefe.deutschlands.bahnhofsfotos.model.Station
import org.assertj.core.api.Assertions.assertThat
import org.junit.jupiter.api.BeforeEach
import org.junit.jupiter.api.Test

class TimetableTest {
private var station: Station? = null

@BeforeEach
fun setUp() {
station = Station(
"de",
"4711",
"Some Famous Station",
0.0,
0.0,
"LOL",
photoId = null,
)
}

@Test
fun createTimetableIntentWithId() {
val country = Country("de", "Deutschland", null, "https://example.com/{id}/blah")
assertThat(
Timetable().createTimetableIntent(country, station)!!.data.toString()
).isEqualTo("https://example.com/4711/blah")
}

@Test
fun createTimetableIntentWithTitle() {
val country = Country("de", "Deutschland", null, "https://example.com/{title}/blah")
assertThat(
Timetable().createTimetableIntent(country, station)!!.data.toString()
).isEqualTo("https://example.com/Some Famous Station/blah")
}

@Test
fun createTimetableIntentWithDS100() {
val country = Country("de", "Deutschland", null, "https://example.com/{DS100}/blah")
assertThat(
Timetable().createTimetableIntent(country, station)!!.data.toString()
).isEqualTo("https://example.com/LOL/blah")
}
}
Loading
Loading