This file contains hidden or 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
| import Foundation | |
| @testable import SpaceXLaunch | |
| import XCTest | |
| extension XCTest { | |
| func givenLaunches(count: Int) -> [Launch] { | |
| return (1 ... count).map { i in | |
| return Launch(id: "id_\(i)", name: "name_\(i)", details: "details_\(i)", date_utc: Date(), upcoming: true, success: true, rocket: "rocket_\(i)") | |
| } | |
| } |
This file contains hidden or 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
| import XCTest | |
| @testable import SpaceXLaunch | |
| import RxCocoa | |
| class LaunchListViewControllerTests: XCTestCase { | |
| var sut: LaunchListViewController! | |
| override func setUpWithError() throws { | |
| // Put setup code here. This method is called before the invocation of each test method in the class. | |
| try super.setUpWithError() |
This file contains hidden or 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
| import KeychainAccess | |
| class KeychainHelper { | |
| let service = "QKLSKFNAE1.com.example.yungkien.com.shared" | |
| let accessGroup = "group.com.example.yungkien.com.shared" | |
| func save(_ key: String, _ value: String) throws { | |
| let keychain = Keychain(service: service, accessGroup: accessGroup) | |
| try keychain.set(value, key: key.rawValue) | |
| } |
This file contains hidden or 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 Provider: TimelineProvider { | |
| func placeholder(in context: Context) -> SimpleEntry { | |
| SimpleEntry(date: Date(), building: .barrack) | |
| } | |
| func getSnapshot(in context: Context, completion: @escaping (SimpleEntry) -> ()) { | |
| let entry = SimpleEntry(date: Date(), building: .barrack) | |
| completion(entry) | |
| } |
OlderNewer