Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class SystemTest {
- class AuthorizerDoSomethingMock: Authorizer {
- var authorizeCalled = false
- func authorize(username: String, password: String) -> Bool {
- authorizeCalled = true
- return true
- }
- func verify() -> Bool {
- return authorizeCalled
- }
- }
- func testDoSomethingCallAuthorizerWithAandB() {
- // Given
- let mock = AuthorizerAcceptingMock()
- let sut = System(with: mock)
- // When
- let user = User(username: "A", password: "B")
- sut.doSomething(user: user)
- // Then
- assert(mock.verify())
- }
- }
Add Comment
Please, Sign In to add comment