- (void)setUp
{
[super setUp];
@try {
[Problem setupProblem];
}
@catch (NSException *exception) {
NSLog(@"exception Caught %@: %@", [exception name], [exception reason]);
STFail(@"Should Pass, no exception is expected. Exception <%@>", exception);
}
}
- (void)tearDown
{
// Tear-down code here.
@try {
[Problem teardownproblem];
}
@catch (NSException* exception) {
NSLog(@"exception Caught %@: %@", [exception name], [exception reason]);
STFail(@"Should Pass, no exception is expected. Exception <%@>", exception);
}
}
-(void)testGetComponentNil{
id testComponet = (id<Solution>)[Problem getComponent:nil];
STAssertNil(testComponet, @"Return Nil");
STAssertNotNil(id<Solution>[problem getComponent:@"Problem"], @"");
}
exception Caught NSInternalInconsistencyException: Cannot teardownProblem() before setupProblem()
<Cannot teardownProblem() before setupProblem().>
has for my information first setup method will called and invoke the testcaseMethod then tear down will be called. Its teardown before setup, any one advice me on this issue why its teardown before setup.