XCTest: how can I tell which XCTestExpectation invoked 'fulfill'? -


i'm testing class has delegate. delegate test class of course, , implementation of delegate methods call different expectations:

- (void)mysuccess {          [self.successexpectation fulfill];  }  - (void)myfail:(nserror *)error {      [self.failexpectation fulfill];  } 

how can tell test class expectation called 'fulfill'?

this isn't true way expectations supposed used. should queue expectation happen, may or may not fulfilled. test fail if expectation not met, means don't need track whether 'fail' or 'success' expectation has been met. can derive success or failure single expectation, should use expectations in manner, if that's possible code.

for example, mysuccess method should call fulfill on expectation, myfail should nothing (resulting in expectation not being fulfilled) and/or raise error or xctfail().


Comments

Popular posts from this blog

Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.12:test (default-test) on project.Error occurred in starting fork -

android - CoordinatorLayout, FAB and container layout conflict -

windows - Debug iNetMgr.exe unhandle exception System.Management.Automation.CmdletInvocationException -