美文网首页
IOS单元测试

IOS单元测试

作者: 沧州宁少 | 来源:发表于2018-06-03 16:32 被阅读0次

    IOS单元测试

    • 单元测试开始
      - (void)setUp {
      [super setUp];
      // Put setup code here. This method is called before the invocation of each test method in the class.
      }
    • 单元测试结束
      - (void)tearDown {
      // Put teardown code here. This method is called after the invocation of each test method in the class.
      [super tearDown];
      }
    • 单元测试测试方法 所有的测试内容都在这个方法里面执行。但是不一定是命名为testExample,也可以是textProgram
      - (void)testExample {}
    • 性能测试。耗时和性能消耗在这里测试
      - (void)testPerformanceExample {
      // This is an example of a performance test case.
      [self measureBlock:^{
      // Put the code you want to measure the time of here.
      }];
      }
    • 测试用例覆盖测试的工具类里面所有的func
    image.png image.png

    这个覆盖率指的是代码而不是函数。

    相关文章

      网友评论

          本文标题:IOS单元测试

          本文链接:https://www.haomeiwen.com/subject/buijsftx.html