Graham Lee가 "시험 주도 iOS 개발"을 읽고 OCUnit
을 배우고 있습니다. 나는 이것이 Xcode의 몇 가지 버전이라고 생각하지만 여전히 유용한 리소스이다. - (void)setUp
에OCUnit에서 속성을 사용하는 것이 안전합니까?
@interface BROAnswerTests : XCTestCase {
BROAnswer *answer;
BROAnswer *otherAnswer;
}
@end
다음 인스턴스 : 책 테스트 객체에
이 같은 클래스 확장에 선언- (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
을 사용하는 것이 안전 할 것인가 대신에?