Slide 11
Slide 11 text
SwiftyMocky: Verify
sut.usersStorage = mockStorage
sut.saveUser(name: "Johny", surname: "Bravo")
sut.saveUser(name: "Johny", surname: "Cage")
sut.saveUser(name: "Jon", surname: "Snow")
Verify(mockStorage, .storeUser(name: .value("Jon"), surname: .value("Snow")))
Verify(mockStorage, 3, .storeUser(name: .any, surname: .any))
Verify(mockStorage, 2, .storeUser(name: .value("Johny"), surname: .any))
Verify(mockStorage,
.moreOrEqual(to: 2),
.storeUser(name: .matching({ $0.count > 3 }}), surname: .any))
Verify(mockStorage, .never, .deleteUser(id: .any))