{"action":"created","issue":{"url":"https://api.github.com/repos/Brightify/Cuckoo/issues/247","repository_url":"https://api.github.com/repos/Brightify/Cuckoo","labels_url":"https://api.github.com/repos/Brightify/Cuckoo/issues/247/labels{/name}","comments_url":"https://api.github.com/repos/Brightify/Cuckoo/issues/247/comments","events_url":"https://api.github.com/repos/Brightify/Cuckoo/issues/247/events","html_url":"https://github.com/Brightify/Cuckoo/issues/247","id":383611487,"node_id":"MDU6SXNzdWUzODM2MTE0ODc=","number":247,"title":"Verify multiple method calls with different parameters","user":{"login":"zcsipler","id":19905641,"node_id":"MDQ6VXNlcjE5OTA1NjQx","avatar_url":"https://avatars0.githubusercontent.com/u/19905641?v=4","gravatar_id":"","url":"https://api.github.com/users/zcsipler","html_url":"https://github.com/zcsipler","followers_url":"https://api.github.com/users/zcsipler/followers","following_url":"https://api.github.com/users/zcsipler/following{/other_user}","gists_url":"https://api.github.com/users/zcsipler/gists{/gist_id}","starred_url":"https://api.github.com/users/zcsipler/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zcsipler/subscriptions","organizations_url":"https://api.github.com/users/zcsipler/orgs","repos_url":"https://api.github.com/users/zcsipler/repos","events_url":"https://api.github.com/users/zcsipler/events{/privacy}","received_events_url":"https://api.github.com/users/zcsipler/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":3,"created_at":"2018-11-22T16:59:03Z","updated_at":"2018-11-23T15:12:56Z","closed_at":"2018-11-23T14:16:07Z","author_association":"NONE","body":"If the same method is called in a test case, we use times(2) in verify to tell Cuckoo that this method should be called twice. But what happens if the same method is called two times but with a different parameter value per call? Is there any way to separately verify parameter for the first call and the second call?"},"comment":{"url":"https://api.github.com/repos/Brightify/Cuckoo/issues/comments/441264752","html_url":"https://github.com/Brightify/Cuckoo/issues/247#issuecomment-441264752","issue_url":"https://api.github.com/repos/Brightify/Cuckoo/issues/247","id":441264752,"node_id":"MDEyOklzc3VlQ29tbWVudDQ0MTI2NDc1Mg==","user":{"login":"zcsipler","id":19905641,"node_id":"MDQ6VXNlcjE5OTA1NjQx","avatar_url":"https://avatars0.githubusercontent.com/u/19905641?v=4","gravatar_id":"","url":"https://api.github.com/users/zcsipler","html_url":"https://github.com/zcsipler","followers_url":"https://api.github.com/users/zcsipler/followers","following_url":"https://api.github.com/users/zcsipler/following{/other_user}","gists_url":"https://api.github.com/users/zcsipler/gists{/gist_id}","starred_url":"https://api.github.com/users/zcsipler/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zcsipler/subscriptions","organizations_url":"https://api.github.com/users/zcsipler/orgs","repos_url":"https://api.github.com/users/zcsipler/repos","events_url":"https://api.github.com/users/zcsipler/events{/privacy}","received_events_url":"https://api.github.com/users/zcsipler/received_events","type":"User","site_admin":false},"created_at":"2018-11-23T15:12:56Z","updated_at":"2018-11-23T15:12:56Z","author_association":"NONE","body":"@MatyasKriz so the example something like this:\r\n\r\nOriginal code: \r\n\r\n```\r\ninteractor.helloWorld(helloWorldString: \"HelloWorld1\")\r\ninteractor.helloWorld(helloWorldString: \"HelloWorld2\")\r\n```\r\n\r\nTest:\r\n\r\n```\r\nlet argumentCaptor = ArgumentCaptor<String>()\r\n\r\n                    verify(mockInteractor, times(2)).helloWorld(helloWorldString: argumentCaptor.capture())\r\n\r\n                    expect(argumentCaptor.allValues[safe: 0]).to(equal(\"HelloWorld1\")) // Verify parameter for the first call\r\n                    expect(argumentCaptor.allValues[safe: 1]).to(equal(\"HelloWorld2\")) // Verify parameter for the second call\r\n```\r\n\r\n@TadeasKriz I am not sure what you mean exactly but my point was to verify parameters for multiple calls and I think the example above does exactly what I wanted :)"}}
{"actor":{"display_login":"zcsipler"}}