# HG changeset patch # User Dennis Concepcion Martin # Date 1629396784 -3600 # Node ID bdedd0cc6cd1b029e3c28734d0759cfd04c1e97a # Parent 6eac99e99b969d22c5cc31777541058796566b30 Add test flag existence diff -r 6eac99e99b96 -r bdedd0cc6cd1 SimoleonTests/SimoleonTests.swift --- a/SimoleonTests/SimoleonTests.swift Thu Aug 19 19:12:56 2021 +0100 +++ b/SimoleonTests/SimoleonTests.swift Thu Aug 19 19:13:04 2021 +0100 @@ -17,6 +17,23 @@ override func tearDownWithError() throws { // Put teardown code here. This method is called after the invocation of each test method in the class. } + + func testReadJson() throws { + let currencyPairs: [CurrencyPairModel]? = try? read(json: "CurrencyPairs.json") + XCTAssertNotNil(currencyPairs) + + let currencyMetadata: [String: CurrencyMetadataModel]? = try? read(json: "CurrencyMetadata.json") + XCTAssertNotNil(currencyMetadata) + } + + func testFlagsExistence() throws { + let currencyMetadata: [String: CurrencyMetadataModel]! = try! read(json: "CurrencyMetadata.json") + + for currencySymbol in currencyMetadata.keys { + let flag = currencyMetadata[currencySymbol]!.flag + XCTAssertTrue((UIImage(named: flag) != nil)) + } + } func testPerformanceExample() throws { // This is an example of a performance test case.