Skip to content

Instantly share code, notes, and snippets.

@vialyx
Created October 15, 2018 04:07
Show Gist options
  • Save vialyx/35d5d59ee67d8762394ea8ab3e10bd9c to your computer and use it in GitHub Desktop.
Save vialyx/35d5d59ee67d8762394ea8ab3e10bd9c to your computer and use it in GitHub Desktop.
extension Card: Mockable {
static func mock(_ option: Int) -> Card {
switch option {
case 1:
return Card(holderName: "John Malkovich", number: "4111 1111 1111 1111", expiration: "09/12")
default:
return Card(holderName: "Mock", number: "0000 0000 0000 0000", expiration: "00/00")
}
}
}
let mockCard = Card.mock(1)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment