Mercurial > public > simoleon
comparison SimoleonTests/SimoleonTests.swift @ 151:bdedd0cc6cd1
Add test flag existence
author | Dennis Concepcion Martin <dennisconcepcionmartin@gmail.com> |
---|---|
date | Thu, 19 Aug 2021 19:13:04 +0100 |
parents | cd801949925b |
children | 2590ee472aa9 |
comparison
equal
deleted
inserted
replaced
150:6eac99e99b96 | 151:bdedd0cc6cd1 |
---|---|
15 } | 15 } |
16 | 16 |
17 override func tearDownWithError() throws { | 17 override func tearDownWithError() throws { |
18 // Put teardown code here. This method is called after the invocation of each test method in the class. | 18 // Put teardown code here. This method is called after the invocation of each test method in the class. |
19 } | 19 } |
20 | |
21 func testReadJson() throws { | |
22 let currencyPairs: [CurrencyPairModel]? = try? read(json: "CurrencyPairs.json") | |
23 XCTAssertNotNil(currencyPairs) | |
24 | |
25 let currencyMetadata: [String: CurrencyMetadataModel]? = try? read(json: "CurrencyMetadata.json") | |
26 XCTAssertNotNil(currencyMetadata) | |
27 } | |
28 | |
29 func testFlagsExistence() throws { | |
30 let currencyMetadata: [String: CurrencyMetadataModel]! = try! read(json: "CurrencyMetadata.json") | |
31 | |
32 for currencySymbol in currencyMetadata.keys { | |
33 let flag = currencyMetadata[currencySymbol]!.flag | |
34 XCTAssertTrue((UIImage(named: flag) != nil)) | |
35 } | |
36 } | |
20 | 37 |
21 func testPerformanceExample() throws { | 38 func testPerformanceExample() throws { |
22 // This is an example of a performance test case. | 39 // This is an example of a performance test case. |
23 self.measure { | 40 self.measure { |
24 // Put the code you want to measure the time of here. | 41 // Put the code you want to measure the time of here. |