-
Notifications
You must be signed in to change notification settings - Fork 0
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
33 changed files
with
517 additions
and
4,195 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
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
6 changes: 2 additions & 4 deletions
6
app/src/androidTest/java/nl/ovfietsbeschikbaarheid/ExampleInstrumentedTest.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
35 changes: 35 additions & 0 deletions
35
app/src/androidTest/java/nl/ovfietsbeschikbaarheid/LocationsDataTest.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 |
---|---|---|
@@ -0,0 +1,35 @@ | ||
package nl.ovfietsbeschikbaarheid | ||
|
||
import androidx.test.platform.app.InstrumentationRegistry | ||
import kotlinx.coroutines.runBlocking | ||
import nl.ovfietsbeschikbaarheid.repository.OverviewRepository | ||
import nl.ovfietsbeschikbaarheid.repository.StationRepository | ||
import nl.ovfietsbeschikbaarheid.util.dutchLocale | ||
import org.junit.Test | ||
|
||
class LocationsDataTest { | ||
|
||
@Test | ||
fun test() { | ||
val context = InstrumentationRegistry.getInstrumentation().targetContext | ||
val stationRepository = StationRepository(context) | ||
val allStations = stationRepository.getAllStations() | ||
val capacities = stationRepository.getCapacities() | ||
runBlocking { | ||
val allLocations = OverviewRepository().getAllLocations() | ||
allLocations.forEach { | ||
val stationName = allStations[it.stationCode] | ||
if (stationName == null && it.stationCode != "BSLC") { | ||
// Triggers at Eindhoven Strijp-S. This is a "new" train station since 2015, so probably from just after stations_nl_2015_08 is made. | ||
// Same applies to Utrecht Vaartsche Rijn: this is made at 2016. | ||
println("Station ${it.stationCode} not found for $it") | ||
} | ||
val foundCapacity = capacities[it.locationCode.lowercase(dutchLocale)] | ||
if (foundCapacity == null) { | ||
error("Capacity for ${it.locationCode} not found") | ||
} | ||
} | ||
|
||
} | ||
} | ||
} |
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
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
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
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
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
11 changes: 11 additions & 0 deletions
11
app/src/main/java/nl/ovfietsbeschikbaarheid/dto/OpeningHoursDTO.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 |
---|---|---|
@@ -0,0 +1,11 @@ | ||
package nl.ovfietsbeschikbaarheid.dto | ||
|
||
import kotlinx.serialization.Serializable | ||
|
||
@Serializable | ||
data class OpeningHoursDTO( | ||
val dayOfWeek: Int, | ||
val startTime: String, | ||
val endTime: String, | ||
val closesNextDay: Boolean | ||
) |
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
35 changes: 16 additions & 19 deletions
35
app/src/main/java/nl/ovfietsbeschikbaarheid/mapper/LocationsMapper.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
5 changes: 2 additions & 3 deletions
5
app/src/main/java/nl/ovfietsbeschikbaarheid/mapper/OpenStateMapper.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
3 changes: 3 additions & 0 deletions
3
app/src/main/java/nl/ovfietsbeschikbaarheid/model/DetailScreenData.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 |
---|---|---|
@@ -0,0 +1,3 @@ | ||
package nl.ovfietsbeschikbaarheid.model | ||
|
||
data class DetailScreenData(val title: String, val uri: String, val fetchTime: Long) |
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
6 changes: 5 additions & 1 deletion
6
app/src/main/java/nl/ovfietsbeschikbaarheid/model/LocationOverviewModel.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
Oops, something went wrong.