Skip to content

Instantly share code, notes, and snippets.

@ykpoh
Created July 24, 2021 12:16
Show Gist options
  • Save ykpoh/b63bcb837013e597c9230468adb9bbad to your computer and use it in GitHub Desktop.
Save ykpoh/b63bcb837013e597c9230468adb9bbad to your computer and use it in GitHub Desktop.
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)")
}
}
func givenURLs(count: Int) -> [URL] {
return (1 ... count).map { _ in
return URL(string: "https://farm5.staticflickr.com/4711/40126461411_aabc643fd8_b.jpg")!
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment