iOS 单元测试

来源:互联网 发布:淘宝详情页私单价格 编辑:程序博客网 时间:2024/06/05 10:37
添加测试target 选择无ui得iOS  Unit Testing Bundle
- (void)testCalculatePageWithLines {        // given    NSInteger lines = 1;    NSInteger columns = 4;    NSInteger count = 10;    SJPopupMenu *menu = [[SJPopupMenu alloc] init];        // exp    NSInteger exp_pages = 3;        // when    NSInteger rs_pages = [menu calculatePageWithLines:lines columns:columns count:count];            // then    XCTAssertEqual(exp_pages, rs_pages);}

基本步骤如上

0 0