diff --git a/app/src/test/java/de/westnordost/streetcomplete/quests/accepts_cards/AddAcceptsCardsTest.kt b/app/src/test/java/de/westnordost/streetcomplete/quests/accepts_cards/AddAcceptsCardsTest.kt index 6b315fd071..2bddae6e7b 100644 --- a/app/src/test/java/de/westnordost/streetcomplete/quests/accepts_cards/AddAcceptsCardsTest.kt +++ b/app/src/test/java/de/westnordost/streetcomplete/quests/accepts_cards/AddAcceptsCardsTest.kt @@ -4,7 +4,7 @@ import de.westnordost.streetcomplete.data.osm.edits.update_tags.StringMapEntryAd import de.westnordost.streetcomplete.quests.TestMapDataWithGeometry import de.westnordost.streetcomplete.quests.verifyAnswer import de.westnordost.streetcomplete.testutils.node -import kotlin.test.Assert +import kotlin.test.assertEquals import kotlin.test.Test class AddAcceptsCardsTest { @@ -27,6 +27,6 @@ class AddAcceptsCardsTest { node(1, tags = mapOf("shop" to "greengrocer", "name" to "Foobar")), ), ) - Assert.assertEquals(1, questType.getApplicableElements(mapData).toList().size) + assertEquals(1, questType.getApplicableElements(mapData).toList().size) } } diff --git a/app/src/test/java/de/westnordost/streetcomplete/quests/barrier_type/AddDetectBarrierIntersectionTest.kt b/app/src/test/java/de/westnordost/streetcomplete/quests/barrier_type/AddDetectBarrierIntersectionTest.kt index c67b119c67..d533dcb53b 100644 --- a/app/src/test/java/de/westnordost/streetcomplete/quests/barrier_type/AddDetectBarrierIntersectionTest.kt +++ b/app/src/test/java/de/westnordost/streetcomplete/quests/barrier_type/AddDetectBarrierIntersectionTest.kt @@ -4,7 +4,7 @@ import de.westnordost.streetcomplete.quests.TestMapDataWithGeometry import de.westnordost.streetcomplete.testutils.node import de.westnordost.streetcomplete.testutils.p import de.westnordost.streetcomplete.testutils.way -import kotlin.test.Assert +import kotlin.test.assertEquals import kotlin.test.Test class AddDetectBarrierIntersectionTest { @@ -14,7 +14,7 @@ class AddDetectBarrierIntersectionTest { val mapData = TestMapDataWithGeometry(listOf( node(1) )) - Assert.assertEquals(0, questType.getApplicableElements(mapData).toList().size) + assertEquals(0, questType.getApplicableElements(mapData).toList().size) } /* @@ -31,7 +31,7 @@ class AddDetectBarrierIntersectionTest { way(1, nodes = listOf(1, 2, 3), tags = mapOf("highway" to "unclassified")), way(2, nodes = listOf(4, 2, 5), tags = mapOf("barrier" to "wall")), )) - Assert.assertEquals(shared, questType.getApplicableElements(mapData).toList().single()) + assertEquals(shared, questType.getApplicableElements(mapData).toList().single()) } /* @@ -48,7 +48,7 @@ class AddDetectBarrierIntersectionTest { way(1, nodes = listOf(1, 2, 3), tags = mapOf("highway" to "unclassified")), way(2, nodes = listOf(4, 2, 5), tags = mapOf("barrier" to "wall")), )) - Assert.assertEquals(0, questType.getApplicableElements(mapData).toList().size) + assertEquals(0, questType.getApplicableElements(mapData).toList().size) } /* @@ -64,7 +64,7 @@ class AddDetectBarrierIntersectionTest { way(1, nodes = listOf(1, 2), tags = mapOf("highway" to "unclassified")), way(2, nodes = listOf(4, 2, 5), tags = mapOf("barrier" to "fence")), )) - Assert.assertEquals(0, questType.getApplicableElements(mapData).toList().size) + assertEquals(0, questType.getApplicableElements(mapData).toList().size) } /* @@ -80,7 +80,7 @@ class AddDetectBarrierIntersectionTest { way(1, nodes = listOf(1, 2, 3), tags = mapOf("highway" to "unclassified")), way(2, nodes = listOf(4, 2), tags = mapOf("barrier" to "city_wall")), )) - Assert.assertEquals(0, questType.getApplicableElements(mapData).toList().size) + assertEquals(0, questType.getApplicableElements(mapData).toList().size) } /* @@ -99,7 +99,7 @@ class AddDetectBarrierIntersectionTest { way(3, nodes = listOf(4, 2), tags = mapOf("barrier" to "guard_rail")), way(4, nodes = listOf(2, 5), tags = mapOf("barrier" to "wall")) )) - Assert.assertEquals(shared, questType.getApplicableElements(mapData).toList().single()) + assertEquals(shared, questType.getApplicableElements(mapData).toList().single()) } /* @@ -118,7 +118,7 @@ class AddDetectBarrierIntersectionTest { way(1, nodes = listOf(1, 2, 3), tags = mapOf("highway" to "unclassified")), way(2, nodes = listOf(4, 2, 5), tags = mapOf("barrier" to "fence")), )) - Assert.assertEquals(0, questType.getApplicableElements(mapData).toList().size) + assertEquals(0, questType.getApplicableElements(mapData).toList().size) } /* @@ -137,7 +137,7 @@ class AddDetectBarrierIntersectionTest { way(1, nodes = listOf(1, 2, 3), tags = mapOf("highway" to "unclassified")), way(2, nodes = listOf(4, 2, 5), tags = mapOf("barrier" to "wall")), )) - Assert.assertEquals(0, questType.getApplicableElements(mapData).toList().size) + assertEquals(0, questType.getApplicableElements(mapData).toList().size) } /* @@ -161,7 +161,7 @@ class AddDetectBarrierIntersectionTest { way(4, nodes = listOf(6, 2), tags = mapOf("barrier" to "hedge")), way(5, nodes = listOf(7, 2), tags = mapOf("barrier" to "guard_rail")), )) - Assert.assertEquals(shared, questType.getApplicableElements(mapData).toList().single()) + assertEquals(shared, questType.getApplicableElements(mapData).toList().single()) } /* @@ -183,7 +183,7 @@ class AddDetectBarrierIntersectionTest { way(2, nodes = listOf(4, 2, 5), tags = mapOf("highway" to "unclassified")), way(3, nodes = listOf(6, 2, 7), tags = mapOf("barrier" to "city_wall")), )) - Assert.assertEquals(shared, questType.getApplicableElements(mapData).toList().single()) + assertEquals(shared, questType.getApplicableElements(mapData).toList().single()) } /* @@ -204,6 +204,6 @@ class AddDetectBarrierIntersectionTest { way(2, nodes = listOf(3, 2), tags = mapOf("highway" to "unclassified")), way(3, nodes = listOf(4, 2, 5), tags = mapOf("barrier" to "retaining_wall")), )) - Assert.assertEquals(0, questType.getApplicableElements(mapData).toList().size) + assertEquals(0, questType.getApplicableElements(mapData).toList().size) } } diff --git a/app/src/test/java/de/westnordost/streetcomplete/quests/building_entrance/AddEntranceTest.kt b/app/src/test/java/de/westnordost/streetcomplete/quests/building_entrance/AddEntranceTest.kt index 8b0946903b..2c25d7f29f 100644 --- a/app/src/test/java/de/westnordost/streetcomplete/quests/building_entrance/AddEntranceTest.kt +++ b/app/src/test/java/de/westnordost/streetcomplete/quests/building_entrance/AddEntranceTest.kt @@ -6,7 +6,7 @@ import de.westnordost.streetcomplete.testutils.member import de.westnordost.streetcomplete.testutils.node import de.westnordost.streetcomplete.testutils.rel import de.westnordost.streetcomplete.testutils.way -import kotlin.test.Assert +import kotlin.test.assertEquals import kotlin.test.Test class AddBuildingEntranceTest { @@ -37,7 +37,7 @@ class AddBuildingEntranceTest { val mapData = generalTestDataWithWayThroughBuilding(mapOf( "highway" to "corridor", )) - Assert.assertEquals(1, questType.getApplicableElements(mapData).toList().size) + assertEquals(1, questType.getApplicableElements(mapData).toList().size) } @Test @@ -46,7 +46,7 @@ class AddBuildingEntranceTest { "highway" to "corridor", "access" to "private", )) - Assert.assertEquals(1, questType.getApplicableElements(mapData).toList().size) + assertEquals(1, questType.getApplicableElements(mapData).toList().size) } @Test @@ -56,7 +56,7 @@ class AddBuildingEntranceTest { "indoor" to "yes", )) // 2 because both ends of way through building generated quest - Assert.assertEquals(2, questType.getApplicableElements(mapData).toList().size) + assertEquals(2, questType.getApplicableElements(mapData).toList().size) } @Test @@ -65,7 +65,7 @@ class AddBuildingEntranceTest { "highway" to "footway", )) // 2 because both ends of way through building generated quest - Assert.assertEquals(2, questType.getApplicableElements(mapData).toList().size) + assertEquals(2, questType.getApplicableElements(mapData).toList().size) } @Test @@ -74,7 +74,7 @@ class AddBuildingEntranceTest { "highway" to "footway", "access" to "private", )) - Assert.assertEquals(1, questType.getApplicableElements(mapData).toList().size) + assertEquals(1, questType.getApplicableElements(mapData).toList().size) } @Test @@ -85,7 +85,7 @@ class AddBuildingEntranceTest { "highway" to "footway", "tunnel" to "building_passage", )) - Assert.assertEquals(0, questType.getApplicableElements(mapData).toList().size) + assertEquals(0, questType.getApplicableElements(mapData).toList().size) } @Test @@ -94,7 +94,7 @@ class AddBuildingEntranceTest { "highway" to "footway", "covered" to "weird_value", )) - Assert.assertEquals(0, questType.getApplicableElements(mapData).toList().size) + assertEquals(0, questType.getApplicableElements(mapData).toList().size) } @Test @@ -103,7 +103,7 @@ class AddBuildingEntranceTest { "highway" to "footway", "tunnel" to "weird_value", )) - Assert.assertEquals(0, questType.getApplicableElements(mapData).toList().size) + assertEquals(0, questType.getApplicableElements(mapData).toList().size) } @Test @@ -123,7 +123,7 @@ class AddBuildingEntranceTest { )), ), ) - Assert.assertEquals(1, questType.getApplicableElements(mapData).toList().size) + assertEquals(1, questType.getApplicableElements(mapData).toList().size) } @Test @@ -144,7 +144,7 @@ class AddBuildingEntranceTest { )), ), ) - Assert.assertEquals(0, questType.getApplicableElements(mapData).toList().size) + assertEquals(0, questType.getApplicableElements(mapData).toList().size) } @Test @@ -165,7 +165,7 @@ class AddBuildingEntranceTest { )), ), ) - Assert.assertEquals(0, questType.getApplicableElements(mapData).toList().size) + assertEquals(0, questType.getApplicableElements(mapData).toList().size) } @Test @@ -187,7 +187,7 @@ class AddBuildingEntranceTest { )), ), ) - Assert.assertEquals(1, questType.getApplicableElements(mapData).toList().size) + assertEquals(1, questType.getApplicableElements(mapData).toList().size) } @Test @@ -197,13 +197,13 @@ class AddBuildingEntranceTest { "highway" to "footway", "location" to "roof", )) - Assert.assertEquals(0, questType.getApplicableElements(mapDataWithRoof).toList().size) + assertEquals(0, questType.getApplicableElements(mapDataWithRoof).toList().size) val mapDataWithRooftop = generalTestDataWithWayThroughBuilding(mapOf( "highway" to "footway", "location" to "rooftop", )) - Assert.assertEquals(0, questType.getApplicableElements(mapDataWithRooftop).toList().size) + assertEquals(0, questType.getApplicableElements(mapDataWithRooftop).toList().size) } @Test @@ -226,7 +226,7 @@ class AddBuildingEntranceTest { )), ), ) - Assert.assertEquals(1, questType.getApplicableElements(mapData).toList().size) + assertEquals(1, questType.getApplicableElements(mapData).toList().size) } @Test @@ -249,6 +249,6 @@ class AddBuildingEntranceTest { way(3L, listOf(3, 4)), ), ) - Assert.assertEquals(0, questType.getApplicableElements(mapData).toList().size) + assertEquals(0, questType.getApplicableElements(mapData).toList().size) } } diff --git a/app/src/test/java/de/westnordost/streetcomplete/quests/building_entrance_reference/AddEntranceReferenceTest.kt b/app/src/test/java/de/westnordost/streetcomplete/quests/building_entrance_reference/AddEntranceReferenceTest.kt index 5c903f9490..b3b4abbdf8 100644 --- a/app/src/test/java/de/westnordost/streetcomplete/quests/building_entrance_reference/AddEntranceReferenceTest.kt +++ b/app/src/test/java/de/westnordost/streetcomplete/quests/building_entrance_reference/AddEntranceReferenceTest.kt @@ -7,8 +7,8 @@ import de.westnordost.streetcomplete.testutils.member import de.westnordost.streetcomplete.testutils.node import de.westnordost.streetcomplete.testutils.rel import de.westnordost.streetcomplete.testutils.way -import kotlin.test.Assert import kotlin.test.Test +import kotlin.test.assertEquals class AddBuildingEntranceReferenceTest { @@ -29,7 +29,7 @@ class AddBuildingEntranceReferenceTest { way(2L, listOf(2, 20), mapOf("highway" to "footway")), ), ) - Assert.assertEquals(2, questType.getApplicableElements(mapData).toList().size) + assertEquals(2, questType.getApplicableElements(mapData).toList().size) } @Test @@ -52,7 +52,7 @@ class AddBuildingEntranceReferenceTest { way(201L, listOf(5, 20), mapOf("highway" to "footway")), ), ) - Assert.assertEquals(0, questType.getApplicableElements(mapData).toList().size) + assertEquals(0, questType.getApplicableElements(mapData).toList().size) } @Test @@ -71,7 +71,7 @@ class AddBuildingEntranceReferenceTest { way(2L, listOf(2, 20), mapOf("highway" to "footway", "access" to "no")), ), ) - Assert.assertEquals(0, questType.getApplicableElements(mapData).toList().size) + assertEquals(0, questType.getApplicableElements(mapData).toList().size) } @Test @@ -90,7 +90,7 @@ class AddBuildingEntranceReferenceTest { )), ), ) - Assert.assertEquals(2, questType.getApplicableElements(mapData).toList().size) + assertEquals(2, questType.getApplicableElements(mapData).toList().size) } @Test @@ -108,6 +108,6 @@ class AddBuildingEntranceReferenceTest { )), ), ) - Assert.assertEquals(0, questType.getApplicableElements(mapData).toList().size) + assertEquals(0, questType.getApplicableElements(mapData).toList().size) } } diff --git a/app/src/test/java/de/westnordost/streetcomplete/quests/building_levels/AddBuildingLevelsTest.kt b/app/src/test/java/de/westnordost/streetcomplete/quests/building_levels/AddBuildingLevelsTest.kt index 68fa693dac..869182930f 100644 --- a/app/src/test/java/de/westnordost/streetcomplete/quests/building_levels/AddBuildingLevelsTest.kt +++ b/app/src/test/java/de/westnordost/streetcomplete/quests/building_levels/AddBuildingLevelsTest.kt @@ -4,7 +4,7 @@ import de.westnordost.streetcomplete.data.osm.edits.update_tags.StringMapEntryAd import de.westnordost.streetcomplete.quests.TestMapDataWithGeometry import de.westnordost.streetcomplete.quests.verifyAnswer import de.westnordost.streetcomplete.testutils.way -import kotlin.test.Assert +import kotlin.test.assertEquals import kotlin.test.Test class AddBuildingLevelsTest { @@ -46,7 +46,7 @@ class AddBuildingLevelsTest { "building" to "industrial" )) )) - Assert.assertEquals(0, questType.getApplicableElements(mapData).toList().size) + assertEquals(0, questType.getApplicableElements(mapData).toList().size) } @Test fun `applicable to residential buildings`() { @@ -55,6 +55,6 @@ class AddBuildingLevelsTest { "building" to "residential" )) )) - Assert.assertEquals(1, questType.getApplicableElements(mapData).toList().size) + assertEquals(1, questType.getApplicableElements(mapData).toList().size) } } diff --git a/app/src/test/java/de/westnordost/streetcomplete/quests/drinking_water/AddDrinkingWaterTest.kt b/app/src/test/java/de/westnordost/streetcomplete/quests/drinking_water/AddDrinkingWaterTest.kt index a9de2fd34e..068261262c 100644 --- a/app/src/test/java/de/westnordost/streetcomplete/quests/drinking_water/AddDrinkingWaterTest.kt +++ b/app/src/test/java/de/westnordost/streetcomplete/quests/drinking_water/AddDrinkingWaterTest.kt @@ -2,7 +2,7 @@ package de.westnordost.streetcomplete.quests.drinking_water import de.westnordost.streetcomplete.quests.TestMapDataWithGeometry import de.westnordost.streetcomplete.testutils.node -import kotlin.test.Assert +import kotlin.test.assertEquals import kotlin.test.Test class AddDrinkingWaterTest { @@ -15,7 +15,7 @@ class AddDrinkingWaterTest { node(1, tags = mapOf("natural" to "spring")), ), ) - Assert.assertEquals(1, questType.getApplicableElements(mapData).toList().size) + assertEquals(1, questType.getApplicableElements(mapData).toList().size) } @Test @@ -25,6 +25,6 @@ class AddDrinkingWaterTest { node(1, tags = mapOf("natural" to "spring", "access" to "no")), ), ) - Assert.assertEquals(0, questType.getApplicableElements(mapData).toList().size) + assertEquals(0, questType.getApplicableElements(mapData).toList().size) } } diff --git a/app/src/test/java/de/westnordost/streetcomplete/quests/existence/CheckExistenceTest.kt b/app/src/test/java/de/westnordost/streetcomplete/quests/existence/CheckExistenceTest.kt index 4c191eec04..7c9313bf85 100644 --- a/app/src/test/java/de/westnordost/streetcomplete/quests/existence/CheckExistenceTest.kt +++ b/app/src/test/java/de/westnordost/streetcomplete/quests/existence/CheckExistenceTest.kt @@ -11,8 +11,10 @@ import de.westnordost.streetcomplete.testutils.node import de.westnordost.streetcomplete.testutils.on import de.westnordost.streetcomplete.util.ktx.nowAsEpochMilliseconds import java.util.concurrent.FutureTask -import kotlin.test.Assert +import kotlin.test.assertEquals import kotlin.test.Test +import kotlin.test.assertFalse +import kotlin.test.assertTrue class CheckExistenceTest { private val questType = CheckExistence(mockOfFeatureDictionary()) @@ -63,7 +65,7 @@ class CheckExistenceTest { } @Test fun `isApplicableTo returns false for known places with recently edited amenity=telephone`() { - Assert.assertFalse( + assertFalse( questType.isApplicableTo( node( tags = mapOf( @@ -76,7 +78,7 @@ class CheckExistenceTest { @Test fun `isApplicableTo returns true for known places with old amenity=telephone`() { val milisecondsFor800Days: Long = 1000L * 60 * 60 * 24 * 800 - Assert.assertTrue( + assertTrue( questType.isApplicableTo( node( tags = mapOf( diff --git a/app/src/test/java/de/westnordost/streetcomplete/quests/shop_type/CheckShopExistenceTest.kt b/app/src/test/java/de/westnordost/streetcomplete/quests/shop_type/CheckShopExistenceTest.kt index 9fae9c3293..be620b4ef0 100644 --- a/app/src/test/java/de/westnordost/streetcomplete/quests/shop_type/CheckShopExistenceTest.kt +++ b/app/src/test/java/de/westnordost/streetcomplete/quests/shop_type/CheckShopExistenceTest.kt @@ -6,7 +6,7 @@ import de.westnordost.streetcomplete.testutils.mock import de.westnordost.streetcomplete.testutils.node import de.westnordost.streetcomplete.testutils.on import java.util.concurrent.FutureTask -import kotlin.test.Assert +import kotlin.test.assertEquals import kotlin.test.Test class CheckShopExistenceTest { @@ -40,7 +40,7 @@ class CheckShopExistenceTest { node(timestamp = 0, tags = mapOf("shop" to "weird_value")), ), ) - Assert.assertEquals(0, questType.getApplicableElements(mapData).toList().size) + assertEquals(0, questType.getApplicableElements(mapData).toList().size) } @Test @@ -50,7 +50,7 @@ class CheckShopExistenceTest { node(timestamp = 0, tags = mapOf("shop" to "weird_value", "name" to "Foobar")), ), ) - Assert.assertEquals(1, questType.getApplicableElements(mapData).toList().size) + assertEquals(1, questType.getApplicableElements(mapData).toList().size) } @Test @@ -60,6 +60,6 @@ class CheckShopExistenceTest { node(timestamp = 0, tags = mapOf("shop" to "greengrocer", "name" to "Foobar")), ), ) - Assert.assertEquals(1, questType.getApplicableElements(mapData).toList().size) + assertEquals(1, questType.getApplicableElements(mapData).toList().size) } } diff --git a/app/src/test/java/de/westnordost/streetcomplete/quests/wheelchair_access/AddWheelchairAccessToiletsPartTest.kt b/app/src/test/java/de/westnordost/streetcomplete/quests/wheelchair_access/AddWheelchairAccessToiletsPartTest.kt index b761204bcc..f4f11cb220 100644 --- a/app/src/test/java/de/westnordost/streetcomplete/quests/wheelchair_access/AddWheelchairAccessToiletsPartTest.kt +++ b/app/src/test/java/de/westnordost/streetcomplete/quests/wheelchair_access/AddWheelchairAccessToiletsPartTest.kt @@ -2,8 +2,9 @@ package de.westnordost.streetcomplete.quests.wheelchair_access import de.westnordost.streetcomplete.quests.TestMapDataWithGeometry import de.westnordost.streetcomplete.testutils.node -import kotlin.test.Assert +import kotlin.test.assertEquals import kotlin.test.Test +import kotlin.test.assertTrue class AddWheelchairAccessToiletsPartTest { private val questType = AddWheelchairAccessToiletsPart() @@ -23,7 +24,7 @@ class AddWheelchairAccessToiletsPartTest { "wheelchair" to "no" )), )) - Assert.assertTrue(questType.getApplicableElements(mapData).toList().isEmpty()) + assertTrue(questType.getApplicableElements(mapData).toList().isEmpty()) } @Test @@ -35,7 +36,7 @@ class AddWheelchairAccessToiletsPartTest { "toilets" to "yes" )) )) - Assert.assertEquals(1, questType.getApplicableElements(mapData).toList().size) + assertEquals(1, questType.getApplicableElements(mapData).toList().size) } @Test @@ -46,7 +47,7 @@ class AddWheelchairAccessToiletsPartTest { "amenity" to "restaurant" )) )) - Assert.assertEquals(1, questType.getApplicableElements(mapData).toList().size) + assertEquals(1, questType.getApplicableElements(mapData).toList().size) } @Test @@ -58,7 +59,7 @@ class AddWheelchairAccessToiletsPartTest { "indoor_seating" to "yes" )) )) - Assert.assertEquals(1, questType.getApplicableElements(mapData).toList().size) + assertEquals(1, questType.getApplicableElements(mapData).toList().size) } @Test @@ -70,7 +71,7 @@ class AddWheelchairAccessToiletsPartTest { "toilets" to "no" )) )) - Assert.assertEquals(0, questType.getApplicableElements(mapData).toList().size) + assertEquals(0, questType.getApplicableElements(mapData).toList().size) } @Test @@ -82,6 +83,6 @@ class AddWheelchairAccessToiletsPartTest { "toilets" to "customers" )) )) - Assert.assertEquals(0, questType.getApplicableElements(mapData).toList().size) + assertEquals(0, questType.getApplicableElements(mapData).toList().size) } }