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
// JSONDataReader.swift | |
import XCTest | |
final class JSONDataReader { | |
static func getDataFromJSONFile(with name: String) -> Data? { | |
guard let pathString = Bundle(for: self).path(forResource: name, ofType: "json") else { | |
XCTFail("Mock JSON file \(name).json not found") | |
return nil | |
} |
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
struct Name: Decodable { | |
let firstName: String | |
let lastName: String | |
} | |
final class NetworkService { | |
func loadSampleData(completion: @escaping (Result<Name, Error>) -> Void) { | |
let url = URL(string: "www.google.com")! |
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
// | |
// TestableNetworkServiceExample.swift | |
// KayakCodingChallenge | |
// | |
// Created by Jayesh Kawli on 11/28/23. | |
// | |
import Foundation | |
import XCTest |
OlderNewer