我正在阅读 Graham Lee 的“Test-Driven iOS Development”来学习OCUnit. 我认为它比 Xcode 落后了几个版本,但仍然是一个有用的资源。
在本书中,测试对象在类扩展中声明,如下所示:
@interface BROAnswerTests : XCTestCase {
    BROAnswer *answer;
    BROAnswer *otherAnswer;
}
@end
然后实例化- (void)setUp:
- (void)setUp
{
    [super setUp];
    answer = [[BROAnswer alloc] init];
    answer.text = @"The answer is 42";
    answer.person = [[BROPerson alloc] initWithName:@"Graham Lee" avatarLocation:
                     @"http://example.com/avatar.png"];
    answer.score = 42;
}
@property在类扩展中使用 a 是否安全?