OCMock and block testing, executing

前端 未结 3 2103
傲寒
傲寒 2021-02-05 22:44

Here\'s the method under test:

- (void)loginWithUser:(NSString *)userName andPass:(NSString *)pass {

    NSDictionary *userPassD = @{@\"user\":userName,
                


        
3条回答
  •  梦毁少年i
    2021-02-05 23:26

    I think you can do this with a spy. Reading this wiki page on spies it looks like you can capture the block passed in and invoke it yourself in the test.

提交回复
热议问题