-
-
Notifications
You must be signed in to change notification settings - Fork 358
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
minor adjustment to setting building properties
fixes #3386
- Loading branch information
1 parent
7977964
commit d5b55a6
Showing
2 changed files
with
69 additions
and
0 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
60 changes: 60 additions & 0 deletions
60
app/src/test/java/de/westnordost/streetcomplete/quests/building_type/AddBuildingTypeTest.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,60 @@ | ||
package de.westnordost.streetcomplete.quests.building_type | ||
|
||
import de.westnordost.streetcomplete.data.osm.edits.update_tags.StringMapEntryAdd | ||
import de.westnordost.streetcomplete.data.osm.edits.update_tags.StringMapEntryDelete | ||
import de.westnordost.streetcomplete.data.osm.edits.update_tags.StringMapEntryModify | ||
import de.westnordost.streetcomplete.quests.verifyAnswer | ||
import org.junit.Test | ||
|
||
class AddBuildingTypeTest { | ||
private val questType = AddBuildingType() | ||
|
||
@Test | ||
fun `set building as residential`() { | ||
questType.verifyAnswer( | ||
mapOf( | ||
"building" to "yes", | ||
), | ||
BuildingType.RESIDENTIAL, | ||
StringMapEntryModify("building", "yes", "residential"), | ||
) | ||
} | ||
|
||
@Test | ||
fun `set building as abandoned`() { | ||
questType.verifyAnswer( | ||
mapOf( | ||
"building" to "yes", | ||
), | ||
BuildingType.ABANDONED, | ||
StringMapEntryAdd("abandoned", "yes"), | ||
) | ||
} | ||
|
||
@Test | ||
fun `set building as abandoned and prevent double tagging`() { | ||
// https://github.com/streetcomplete/StreetComplete/issues/3386 | ||
questType.verifyAnswer( | ||
mapOf( | ||
"building" to "yes", | ||
"disused" to "yes", | ||
), | ||
BuildingType.ABANDONED, | ||
StringMapEntryAdd("abandoned", "yes"), | ||
StringMapEntryDelete("disused", "yes"), | ||
) | ||
} | ||
|
||
@Test | ||
fun `set building as abandoned where it was marked as used`() { | ||
questType.verifyAnswer( | ||
mapOf( | ||
"building" to "yes", | ||
"disused" to "no", | ||
), | ||
BuildingType.ABANDONED, | ||
StringMapEntryAdd("abandoned", "yes"), | ||
StringMapEntryDelete("disused", "no"), | ||
) | ||
} | ||
} |