V-Xtreme
V-Xtreme

Reputation: 7333

Testing in Objective c

I have the Unit Test Class named CarouselWithXmlTests.I have single test case.If i entered the data for test case failure or test case success each time it throws the message that 0 test cases tested. I have following code is there anything missing?

-(void)checkTheArrayForNull
{
    viewController.temp=@"c";
    viewController.buttonCount=1;
    [viewController goButton:self];
    STAssertNotNil(viewController.setUpArray,@"set up Array is not nil");

}

and having the following message in o/p:

Test Suite 'CarouselWithXmlTests' started at 2012-05-17 10:23:55 +0000
Test Suite 'CarouselWithXmlTests' finished at 2012-05-17 10:23:55 +0000.
 Executed 0 tests, with 0 failures (0 unexpected) in 0.000 (0.000) seconds

Upvotes: 2

Views: 104

Answers (1)

Inder Kumar Rathore
Inder Kumar Rathore

Reputation: 39988

Change your method name, it must start with test to run as test case

-(void)testCheckTheArrayForNull
{
    viewController.temp=@"c";
    viewController.buttonCount=1;
    [viewController goButton:self];
    STAssertNotNil(viewController.setUpArray,@"set up Array is not nil");

}

Upvotes: 1

Related Questions