Created
October 15, 2018 04:07
-
-
Save vialyx/35d5d59ee67d8762394ea8ab3e10bd9c to your computer and use it in GitHub Desktop.
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
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