-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
67 changed files
with
7,630 additions
and
7,596 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
23 changes: 10 additions & 13 deletions
23
.../androidTest/kotlin/de/bahnhoefe/deutschlands/bahnhofsfotos/ExampleInstrumentationTest.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,20 @@ | ||
package de.bahnhoefe.deutschlands.bahnhofsfotos; | ||
package de.bahnhoefe.deutschlands.bahnhofsfotos | ||
|
||
import static org.assertj.core.api.Assertions.assertThat; | ||
|
||
import androidx.test.platform.app.InstrumentationRegistry; | ||
|
||
import org.junit.jupiter.api.Test; | ||
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 <a href="http://d.android.com/tools/testing">Testing documentation</a> | ||
* @see [Testing documentation](http://d.android.com/tools/testing) | ||
*/ | ||
public class ExampleInstrumentationTest { | ||
|
||
class ExampleInstrumentationTest { | ||
@Test | ||
public void useAppContext() { | ||
fun useAppContext() { | ||
// Context of the app under test. | ||
var appContext = InstrumentationRegistry.getInstrumentation().getTargetContext(); | ||
|
||
assertThat(appContext.getPackageName()).isEqualTo("de.bahnhoefe.deutschlands.bahnhofsfotos.debug"); | ||
val appContext = InstrumentationRegistry.getInstrumentation().targetContext | ||
assertThat(appContext.packageName) | ||
.isEqualTo("de.bahnhoefe.deutschlands.bahnhofsfotos.debug") | ||
} | ||
} |
61 changes: 32 additions & 29 deletions
61
app/src/androidTest/kotlin/de/bahnhoefe/deutschlands/bahnhofsfotos/util/TimetableTest.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,44 +1,47 @@ | ||
package de.bahnhoefe.deutschlands.bahnhofsfotos.util; | ||
package de.bahnhoefe.deutschlands.bahnhofsfotos.util | ||
|
||
import static org.assertj.core.api.Assertions.assertThat; | ||
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 | ||
|
||
import org.junit.jupiter.api.BeforeEach; | ||
import org.junit.jupiter.api.Test; | ||
|
||
import de.bahnhoefe.deutschlands.bahnhofsfotos.model.Country; | ||
import de.bahnhoefe.deutschlands.bahnhofsfotos.model.Station; | ||
|
||
public class TimetableTest { | ||
|
||
private Station station; | ||
class TimetableTest { | ||
private var station: Station? = null | ||
|
||
@BeforeEach | ||
public void setUp() { | ||
station = new Station( | ||
"de", | ||
"4711", | ||
"Some Famous Station", | ||
0.0, | ||
0.0, | ||
"LOL"); | ||
fun setUp() { | ||
station = Station( | ||
"de", | ||
"4711", | ||
"Some Famous Station", | ||
0.0, | ||
0.0, | ||
"LOL" | ||
) | ||
} | ||
|
||
@Test | ||
public void createTimetableIntentWithId() { | ||
var country = new Country("de", "Deutschland", null, "https://example.com/{id}/blah"); | ||
assertThat(new Timetable().createTimetableIntent(country, station).getData().toString()).isEqualTo("https://example.com/4711/blah"); | ||
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 | ||
public void createTimetableIntentWithTitle() { | ||
var country = new Country("de", "Deutschland", null, "https://example.com/{title}/blah"); | ||
assertThat(new Timetable().createTimetableIntent(country, station).getData().toString()).isEqualTo("https://example.com/Some Famous Station/blah"); | ||
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 | ||
public void createTimetableIntentWithDS100() { | ||
var country = new Country("de", "Deutschland", null, "https://example.com/{DS100}/blah"); | ||
assertThat(new Timetable().createTimetableIntent(country, station).getData().toString()).isEqualTo("https://example.com/LOL/blah"); | ||
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") | ||
} | ||
|
||
} |
Oops, something went wrong.