Can we write GHunit test for delegate methods ? I have a delegate method and I am trying to write GHUnit Test for that delegate methods.
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
It depends on how you want to test the delegate method. If you want to test that a delegate method was called in a certain scenario, then you can use mock objects for that. OCMock is the typical framework on iOS and Mac OS for mocking. The last time I checked it played nicely with GHUnit. I’m using SenTest exclusively now, so I cannot say authoritatively.
If you want to test the functionality of a delegate method, nothing prevents you from calling the delegate method directly from within the test case.