-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refactor city mapper tests and add test for all city mappers
- Loading branch information
Showing
6 changed files
with
300 additions
and
23 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,152 @@ | ||
// | ||
// IQCityMapperTests.swift | ||
// MuslimData_Tests | ||
// | ||
// Created by Kosrat Ahmed on 19/02/2024. | ||
// Copyright © 2024 CocoaPods. All rights reserved. | ||
// | ||
|
||
import XCTest | ||
@testable import MuslimData | ||
|
||
class IQCityMapperTests: XCTestCase { | ||
|
||
override func setUp() { | ||
super.setUp() | ||
} | ||
|
||
override func tearDown() { | ||
super.tearDown() | ||
// Put teardown code here. This method is called after the invocation of each test method in the class. | ||
} | ||
|
||
func testDuhokCityMapper() { | ||
XCTAssertEqual("Sumel".mapper(countryCode: "IQ"), "Duhok") | ||
XCTAssertEqual("Zawita".mapper(countryCode: "IQ"), "Duhok") | ||
XCTAssertEqual("Atrish".mapper(countryCode: "IQ"), "Duhok") | ||
XCTAssertEqual("Sharya".mapper(countryCode: "IQ"), "Duhok") | ||
XCTAssertEqual("Mrebah".mapper(countryCode: "IQ"), "Duhok") | ||
} | ||
|
||
func testAkreCityMapper() { | ||
XCTAssertEqual("Amedi".mapper(countryCode: "IQ"), "Akre") | ||
XCTAssertEqual("Sulav".mapper(countryCode: "IQ"), "Akre") | ||
XCTAssertEqual("Kani".mapper(countryCode: "IQ"), "Akre") | ||
XCTAssertEqual("Sheladiz".mapper(countryCode: "IQ"), "Akre") | ||
XCTAssertEqual("Barzan".mapper(countryCode: "IQ"), "Akre") | ||
XCTAssertEqual("Bele".mapper(countryCode: "IQ"), "Akre") | ||
XCTAssertEqual("Shanidar".mapper(countryCode: "IQ"), "Akre") | ||
XCTAssertEqual("Bujal".mapper(countryCode: "IQ"), "Akre") | ||
XCTAssertEqual("Mergin".mapper(countryCode: "IQ"), "Akre") | ||
XCTAssertEqual("Susna".mapper(countryCode: "IQ"), "Akre") | ||
XCTAssertEqual("Sersink".mapper(countryCode: "IQ"), "Akre") | ||
} | ||
|
||
func testBardarashCityMapper() { | ||
XCTAssertEqual("Mamuzin".mapper(countryCode: "IQ"), "Bardarash") | ||
} | ||
|
||
func testErbilCityMapper() { | ||
XCTAssertEqual("Kalak".mapper(countryCode: "IQ"), "Erbil") | ||
XCTAssertEqual("Pirmam".mapper(countryCode: "IQ"), "Erbil") | ||
XCTAssertEqual("Shaqlawa".mapper(countryCode: "IQ"), "Erbil") | ||
XCTAssertEqual("Harir".mapper(countryCode: "IQ"), "Erbil") | ||
XCTAssertEqual("Khalifan".mapper(countryCode: "IQ"), "Erbil") | ||
XCTAssertEqual("Rawanduz".mapper(countryCode: "IQ"), "Erbil") | ||
XCTAssertEqual("Soran".mapper(countryCode: "IQ"), "Erbil") | ||
XCTAssertEqual("Mergasur".mapper(countryCode: "IQ"), "Erbil") | ||
XCTAssertEqual("Galala".mapper(countryCode: "IQ"), "Erbil") | ||
XCTAssertEqual("Choman".mapper(countryCode: "IQ"), "Erbil") | ||
XCTAssertEqual("Hiran".mapper(countryCode: "IQ"), "Erbil") | ||
XCTAssertEqual("Qushtapa".mapper(countryCode: "IQ"), "Erbil") | ||
XCTAssertEqual("Kasnazan".mapper(countryCode: "IQ"), "Erbil") | ||
} | ||
|
||
func testQasreCityMapper() { | ||
XCTAssertEqual("Wallze".mapper(countryCode: "IQ"), "Qasre") | ||
XCTAssertEqual("Soraban".mapper(countryCode: "IQ"), "Qasre") | ||
XCTAssertEqual("Shnawa".mapper(countryCode: "IQ"), "Qasre") | ||
XCTAssertEqual("Rashdur".mapper(countryCode: "IQ"), "Qasre") | ||
XCTAssertEqual("Makosan".mapper(countryCode: "IQ"), "Qasre") | ||
XCTAssertEqual("Saya".mapper(countryCode: "IQ"), "Qasre") | ||
XCTAssertEqual("Walash".mapper(countryCode: "IQ"), "Qasre") | ||
XCTAssertEqual("Eskawa".mapper(countryCode: "IQ"), "Qasre") | ||
XCTAssertEqual("Xazena".mapper(countryCode: "IQ"), "Qasre") | ||
XCTAssertEqual("Dilman".mapper(countryCode: "IQ"), "Qasre") | ||
XCTAssertEqual("Sarkan".mapper(countryCode: "IQ"), "Qasre") | ||
XCTAssertEqual("Chomsak".mapper(countryCode: "IQ"), "Qasre") | ||
XCTAssertEqual("Qalat".mapper(countryCode: "IQ"), "Qasre") | ||
XCTAssertEqual("Koila".mapper(countryCode: "IQ"), "Qasre") | ||
XCTAssertEqual("Mawnan".mapper(countryCode: "IQ"), "Qasre") | ||
XCTAssertEqual("Wasan".mapper(countryCode: "IQ"), "Qasre") | ||
XCTAssertEqual("Choma".mapper(countryCode: "IQ"), "Qasre") | ||
XCTAssertEqual("Mergay Khwaru".mapper(countryCode: "IQ"), "Qasre") | ||
XCTAssertEqual("Kani Bast".mapper(countryCode: "IQ"), "Qasre") | ||
} | ||
|
||
func testKirkukCityMapper() { | ||
XCTAssertEqual("Taza Khurmatu".mapper(countryCode: "IQ"), "Kirkuk") | ||
} | ||
|
||
func testSulaymaniyahCityMapper() { | ||
XCTAssertEqual("Mawat".mapper(countryCode: "IQ"), "Sulaymaniyah") | ||
XCTAssertEqual("Arbat".mapper(countryCode: "IQ"), "Sulaymaniyah") | ||
} | ||
|
||
func testQaladizaCityMapper() { | ||
XCTAssertEqual("Halsho".mapper(countryCode: "IQ"), "Qaladiza") | ||
XCTAssertEqual("Nawdasht".mapper(countryCode: "IQ"), "Qaladiza") | ||
XCTAssertEqual("Tasluja".mapper(countryCode: "IQ"), "Qaladiza") | ||
XCTAssertEqual("Bazian".mapper(countryCode: "IQ"), "Qaladiza") | ||
XCTAssertEqual("Sangasar".mapper(countryCode: "IQ"), "Qaladiza") | ||
XCTAssertEqual("Zharawa".mapper(countryCode: "IQ"), "Qaladiza") | ||
XCTAssertEqual("Bngrd".mapper(countryCode: "IQ"), "Qaladiza") | ||
XCTAssertEqual("Hero".mapper(countryCode: "IQ"), "Qaladiza") | ||
} | ||
|
||
func testDokanCityMapper() { | ||
XCTAssertEqual("Piramagroon".mapper(countryCode: "IQ"), "Dokan") | ||
} | ||
|
||
func testRanyaCityMapper() { | ||
XCTAssertEqual("Hajiawa".mapper(countryCode: "IQ"), "Ranya") | ||
XCTAssertEqual("Sarkapkan".mapper(countryCode: "IQ"), "Ranya") | ||
XCTAssertEqual("Khalakan".mapper(countryCode: "IQ"), "Ranya") | ||
XCTAssertEqual("Taqtaq".mapper(countryCode: "IQ"), "Ranya") | ||
XCTAssertEqual("Hizop".mapper(countryCode: "IQ"), "Ranya") | ||
XCTAssertEqual("Chwarqurna".mapper(countryCode: "IQ"), "Ranya") | ||
} | ||
|
||
func testChamchamalCityMapper() { | ||
XCTAssertEqual("Takiya".mapper(countryCode: "IQ"), "Chamchamal") | ||
XCTAssertEqual("Takiay Jabari".mapper(countryCode: "IQ"), "Chamchamal") | ||
XCTAssertEqual("Shorsh".mapper(countryCode: "IQ"), "Chamchamal") | ||
XCTAssertEqual("Aghjalar".mapper(countryCode: "IQ"), "Chamchamal") | ||
XCTAssertEqual("Sangaw".mapper(countryCode: "IQ"), "Chamchamal") | ||
} | ||
|
||
func testDarbandikhanCityMapper() { | ||
XCTAssertEqual("Zalan".mapper(countryCode: "IQ"), "Darbandikhan") | ||
XCTAssertEqual("Gapilon".mapper(countryCode: "IQ"), "Darbandikhan") | ||
XCTAssertEqual("Chwarta".mapper(countryCode: "IQ"), "Darbandikhan") | ||
XCTAssertEqual("Barzinjah".mapper(countryCode: "IQ"), "Darbandikhan") | ||
XCTAssertEqual("Zarayan".mapper(countryCode: "IQ"), "Darbandikhan") | ||
XCTAssertEqual("Halebjai Taza".mapper(countryCode: "IQ"), "Darbandikhan") | ||
XCTAssertEqual("Qara Dagh".mapper(countryCode: "IQ"), "Darbandikhan") | ||
} | ||
|
||
func testPenjwenCityMapper() { | ||
XCTAssertEqual("Garmk".mapper(countryCode: "IQ"), "Penjwen") | ||
XCTAssertEqual("Nalparez".mapper(countryCode: "IQ"), "Penjwen") | ||
XCTAssertEqual("Said Sadiq".mapper(countryCode: "IQ"), "Penjwen") | ||
XCTAssertEqual("Pshta".mapper(countryCode: "IQ"), "Penjwen") | ||
} | ||
|
||
func testHalabjaCityMapper() { | ||
XCTAssertEqual("Sirwan".mapper(countryCode: "IQ"), "Halabja") | ||
XCTAssertEqual("Byara".mapper(countryCode: "IQ"), "Halabja") | ||
XCTAssertEqual("Tawella".mapper(countryCode: "IQ"), "Halabja") | ||
XCTAssertEqual("Balkha".mapper(countryCode: "IQ"), "Halabja") | ||
XCTAssertEqual("Khurmal".mapper(countryCode: "IQ"), "Halabja") | ||
} | ||
} |
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,34 @@ | ||
// | ||
// IRCityMapperTests.swift | ||
// MuslimData_Tests | ||
// | ||
// Created by Kosrat Ahmed on 19/02/2024. | ||
// Copyright © 2024 CocoaPods. All rights reserved. | ||
// | ||
|
||
import XCTest | ||
@testable import MuslimData | ||
|
||
class IRCityMapperTests: XCTestCase { | ||
|
||
override func setUp() { | ||
super.setUp() | ||
} | ||
|
||
override func tearDown() { | ||
super.tearDown() | ||
// Put teardown code here. This method is called after the invocation of each test method in the class. | ||
} | ||
|
||
|
||
func testSanandajCityMapper() { | ||
XCTAssertEqual("Kamyaran".mapper(countryCode: "IR"), "Sanandaj") | ||
XCTAssertEqual("Divandarreh".mapper(countryCode: "IR"), "Sanandaj") | ||
XCTAssertEqual("Dehgolan".mapper(countryCode: "IR"), "Sanandaj") | ||
XCTAssertEqual("Qorveh".mapper(countryCode: "IR"), "Sanandaj") | ||
} | ||
|
||
func testUrmiaCityMapper() { | ||
XCTAssertEqual("Orumiyeh".mapper(countryCode: "IR"), "Urmia") | ||
} | ||
} |
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,93 @@ | ||
// | ||
// KWCityMapperTests.swift | ||
// MuslimData_Tests | ||
// | ||
// Created by Kosrat Ahmed on 19/02/2024. | ||
// Copyright © 2024 CocoaPods. All rights reserved. | ||
// | ||
|
||
import XCTest | ||
@testable import MuslimData | ||
|
||
class KWCityMapperTests: XCTestCase { | ||
|
||
override func setUp() { | ||
super.setUp() | ||
} | ||
|
||
override func tearDown() { | ||
super.tearDown() | ||
// Put teardown code here. This method is called after the invocation of each test method in the class. | ||
} | ||
|
||
func testAlAsimahCityMapper() { | ||
XCTAssertEqual("Kuwait City".mapper(countryCode: "KW"), "Al Asimah") | ||
XCTAssertEqual("Dasman Palace".mapper(countryCode: "KW"), "Al Asimah") | ||
XCTAssertEqual("Sharq".mapper(countryCode: "KW"), "Al Asimah") | ||
XCTAssertEqual("Mirqab".mapper(countryCode: "KW"), "Al Asimah") | ||
XCTAssertEqual("Jibla".mapper(countryCode: "KW"), "Al Asimah") | ||
XCTAssertEqual("Dasma".mapper(countryCode: "KW"), "Al Asimah") | ||
XCTAssertEqual("Daiya".mapper(countryCode: "KW"), "Al Asimah") | ||
XCTAssertEqual("Salhia".mapper(countryCode: "KW"), "Al Asimah") | ||
XCTAssertEqual("Bneid Al Qar".mapper(countryCode: "KW"), "Al Asimah") | ||
XCTAssertEqual("Kaifan".mapper(countryCode: "KW"), "Al Asimah") | ||
XCTAssertEqual("Mansouriya".mapper(countryCode: "KW"), "Al Asimah") | ||
XCTAssertEqual("Abdullah Al-Salem".mapper(countryCode: "KW"), "Al Asimah") | ||
XCTAssertEqual("Nuzha".mapper(countryCode: "KW"), "Al Asimah") | ||
XCTAssertEqual("Faiha".mapper(countryCode: "KW"), "Al Asimah") | ||
XCTAssertEqual("Shamiya".mapper(countryCode: "KW"), "Al Asimah") | ||
XCTAssertEqual("Rawda".mapper(countryCode: "KW"), "Al Asimah") | ||
XCTAssertEqual("Adailiya".mapper(countryCode: "KW"), "Al Asimah") | ||
XCTAssertEqual("Khaldiya".mapper(countryCode: "KW"), "Al Asimah") | ||
XCTAssertEqual("Qadsiya".mapper(countryCode: "KW"), "Al Asimah") | ||
XCTAssertEqual("Qortuba".mapper(countryCode: "KW"), "Al Asimah") | ||
XCTAssertEqual("Surra".mapper(countryCode: "KW"), "Al Asimah") | ||
XCTAssertEqual("Yarmouk".mapper(countryCode: "KW"), "Al Asimah") | ||
XCTAssertEqual("Shuwaikh Industrial".mapper(countryCode: "KW"), "Al Asimah") | ||
XCTAssertEqual("Rai".mapper(countryCode: "KW"), "Al Asimah") | ||
XCTAssertEqual("Granada".mapper(countryCode: "KW"), "Al Asimah") | ||
XCTAssertEqual("Sulaibikhat".mapper(countryCode: "KW"), "Al Asimah") | ||
XCTAssertEqual("Doha".mapper(countryCode: "KW"), "Al Asimah") | ||
XCTAssertEqual("Nahdha".mapper(countryCode: "KW"), "Al Asimah") | ||
XCTAssertEqual("Jaber Al Ahmad".mapper(countryCode: "KW"), "Al Asimah") | ||
XCTAssertEqual("Qairawan".mapper(countryCode: "KW"), "Al Asimah") | ||
XCTAssertEqual("Ahmadi".mapper(countryCode: "KW"), "Al Asimah") | ||
XCTAssertEqual("Al Wafrah".mapper(countryCode: "KW"), "Al Asimah") | ||
XCTAssertEqual("Sabah Al Salem".mapper(countryCode: "KW"), "Al Asimah") | ||
XCTAssertEqual("Messila".mapper(countryCode: "KW"), "Al Asimah") | ||
XCTAssertEqual("Al-Masayel".mapper(countryCode: "KW"), "Al Asimah") | ||
XCTAssertEqual("Adan".mapper(countryCode: "KW"), "Al Asimah") | ||
XCTAssertEqual("Fnaitees".mapper(countryCode: "KW"), "Al Asimah") | ||
XCTAssertEqual("Qusor".mapper(countryCode: "KW"), "Al Asimah") | ||
XCTAssertEqual("Qurain".mapper(countryCode: "KW"), "Al Asimah") | ||
XCTAssertEqual("Abu Fatira".mapper(countryCode: "KW"), "Al Asimah") | ||
XCTAssertEqual("Mubarak Al Kabeer".mapper(countryCode: "KW"), "Al Asimah") | ||
XCTAssertEqual("Jeleeb Al-Shuyoukh".mapper(countryCode: "KW"), "Al Asimah") | ||
XCTAssertEqual("Eqaila".mapper(countryCode: "KW"), "Al Asimah") | ||
XCTAssertEqual("Fintas".mapper(countryCode: "KW"), "Al Asimah") | ||
XCTAssertEqual("Dahar".mapper(countryCode: "KW"), "Al Asimah") | ||
XCTAssertEqual("Mahboula".mapper(countryCode: "KW"), "Al Asimah") | ||
XCTAssertEqual("Hadiya".mapper(countryCode: "KW"), "Al Asimah") | ||
XCTAssertEqual("Al-Riqqa".mapper(countryCode: "KW"), "Al Asimah") | ||
XCTAssertEqual("Abu Halifa".mapper(countryCode: "KW"), "Al Asimah") | ||
XCTAssertEqual("Fahad Al Ahmad".mapper(countryCode: "KW"), "Al Asimah") | ||
XCTAssertEqual("Assabahiyah".mapper(countryCode: "KW"), "Al Asimah") | ||
XCTAssertEqual("Mangaf".mapper(countryCode: "KW"), "Al Asimah") | ||
XCTAssertEqual("Fahaheel".mapper(countryCode: "KW"), "Al Asimah") | ||
XCTAssertEqual("South Sabahiya".mapper(countryCode: "KW"), "Al Asimah") | ||
XCTAssertEqual("Ali Sabah Al Salem".mapper(countryCode: "KW"), "Al Asimah") | ||
XCTAssertEqual("Shalayhat Mina Abdullah".mapper(countryCode: "KW"), "Al Asimah") | ||
XCTAssertEqual("Zour".mapper(countryCode: "KW"), "Al Asimah") | ||
XCTAssertEqual("Al Khiran".mapper(countryCode: "KW"), "Al Asimah") | ||
} | ||
|
||
func testFailakaIslandCityMapper() { | ||
XCTAssertEqual("Zoor".mapper(countryCode: "KW"), "Failaka Island") | ||
XCTAssertEqual("Kubbar Island".mapper(countryCode: "KW"), "Failaka Island") | ||
XCTAssertEqual("Al-Nuwaiseeb".mapper(countryCode: "KW"), "Failaka Island") | ||
} | ||
|
||
func testAbdaliCityMapper() { | ||
XCTAssertEqual("Jahra".mapper(countryCode: "KW"), "Abdali") | ||
} | ||
} |
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.