Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update AddPostboxRoyalCypherTest.kt #6093

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -11,59 +11,15 @@ class AddPostboxRoyalCypherTest {

private val questType = AddPostboxRoyalCypher()

@Test fun `not applicable to postboxes outside GB`() {
// FR (France)
assertEquals(true, questType.isApplicableTo(
node(tags = mapOf("amenity" to "post_box"), pos = LatLon(48.728532, 2.369866))
))
}

@Test fun `not applicable to postboxes in GB that already have a royal cypher mapped`() {
@Test fun `not applicable to postboxes that already have a royal cypher mapped`() {
assertEquals(false, questType.isApplicableTo(
node(tags = mapOf("amenity" to "post_box", "royal_cypher" to "EIIR"), pos = LatLon(51.651735,-0.149748))
node(tags = mapOf("amenity" to "post_box", "royal_cypher" to "EIIR"))
))
}

@Test fun `applicable to postboxes in GB, Crown Dependencies and Overseas Territories that not already have a royal cypher mapped`() {
// GB-ENG (England)
assertEquals(true, questType.isApplicableTo(
node(tags = mapOf("amenity" to "post_box"), pos = LatLon(51.651735,-0.149748))
))
// IM (Isle of Men - implicit via GB)
assertEquals(true, questType.isApplicableTo(
node(tags = mapOf("amenity" to "post_box"), pos = LatLon(54.149545,-4.482395))
))
// GG (Guernsey - implicit via GB)
assertEquals(true, questType.isApplicableTo(
node(tags = mapOf("amenity" to "post_box"), pos = LatLon(49.457148,-2.537177))
))
// JE (Jersey - implicit via GB)
assertEquals(true, questType.isApplicableTo(
node(tags = mapOf("amenity" to "post_box"), pos = LatLon(49.185224,-2.109332))
))
// BM (Bermuda - implicit via GB)
assertEquals(true, questType.isApplicableTo(
node(tags = mapOf("amenity" to "post_box"), pos = LatLon(32.294316,-64.778953))
))
// KY (Cayman Islands - implicit via GB)
assertEquals(true, questType.isApplicableTo(
node(tags = mapOf("amenity" to "post_box"), pos = LatLon(19.273124,-81.298040))
))
// CY (Cyprus - explicit)
assertEquals(true, questType.isApplicableTo(
node(tags = mapOf("amenity" to "post_box"), pos = LatLon(35.180561,33.361568))
))
// GI (Gibraltar - explicit)
assertEquals(true, questType.isApplicableTo(
node(tags = mapOf("amenity" to "post_box"), pos = LatLon(36.143918,-5.358498))
))
// MT (Malta - explicit)
assertEquals(true, questType.isApplicableTo(
node(tags = mapOf("amenity" to "post_box"), pos = LatLon(35.873912,14.504346))
))
// HK (Hong Kong - explicit)
@Test fun `applicable to postboxes that not already have a royal cypher mapped`() {
assertEquals(true, questType.isApplicableTo(
node(tags = mapOf("amenity" to "post_box"), pos = LatLon(22.339081,114.185334))
node(tags = mapOf("amenity" to "post_box"))
))
}

Expand Down