Automatically load test cases into UITableView layouts. Making a test app becomes more simple.
-
Create a class extends protocol
CTSTestSuitesLoader
provides test cases implements#import "CTSTestSuitesManager.h" @interface TestCaseSample : NSObject <CTSTestSuitesLoader> @end
-
Implement protocol method
-(CTSTestGroup *)loadTestGroup
#import "TestCaseSample.h" @implementation TestCaseSample -(CTSTestGroup *)loadTestGroup { CTSTestGroup* group = [[CTSTestGroup alloc] initWithName:@"sample case"]; [group addTestItem:[CTSTestItem testItemWithName:@"case 1" handler:^(UIViewController * ctxViewCtrl) { NSLog(@"test case 1"); }]]; return group; } @end
-
Register
TestCaseSample
instance beforeMasterViewController
appears.CTSTestSuitesManager* mngr = [CTSTestSuitesManager sharedManager]; [mngr registerTestSuitesLoader:[TestCaseSample new]];