changeset 151:bdedd0cc6cd1

Add test flag existence
author Dennis Concepcion Martin <dennisconcepcionmartin@gmail.com>
date Thu, 19 Aug 2021 19:13:04 +0100
parents 6eac99e99b96
children 2584fd74235a
files SimoleonTests/SimoleonTests.swift
diffstat 1 files changed, 17 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- 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.