-
-
Notifications
You must be signed in to change notification settings - Fork 363
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Ask for the type of crossing for crossing=island (fixes #1637)
- Loading branch information
1 parent
8f8c518
commit a609da8
Showing
2 changed files
with
44 additions
and
2 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
37 changes: 37 additions & 0 deletions
37
app/src/test/java/de/westnordost/streetcomplete/quests/AddCrossingTypeTest.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,37 @@ | ||
package de.westnordost.streetcomplete.quests | ||
|
||
import de.westnordost.streetcomplete.data.osm.changes.StringMapEntryAdd | ||
import de.westnordost.streetcomplete.data.osm.changes.StringMapEntryModify | ||
import de.westnordost.streetcomplete.mock | ||
import de.westnordost.streetcomplete.quests.crossing_type.AddCrossingType | ||
import org.junit.Test | ||
|
||
class AddCrossingTypeTest { | ||
|
||
private val questType = AddCrossingType(mock()) | ||
|
||
@Test fun `apply normal answer`() { | ||
questType.verifyAnswer( | ||
"bla", | ||
StringMapEntryAdd("crossing", "bla") | ||
) | ||
} | ||
|
||
@Test fun `apply answer for crossing = island`() { | ||
questType.verifyAnswer( | ||
mapOf("crossing" to "island"), | ||
"blub", | ||
StringMapEntryModify("crossing", "island", "blub"), | ||
StringMapEntryAdd("crossing:island", "yes") | ||
) | ||
} | ||
|
||
@Test fun `apply answer for crossing = island and crossing_island set`() { | ||
questType.verifyAnswer( | ||
mapOf("crossing" to "island", "crossing:island" to "something"), | ||
"blub", | ||
StringMapEntryModify("crossing", "island", "blub"), | ||
StringMapEntryModify("crossing:island", "something", "yes") | ||
) | ||
} | ||
} |