Xcode: Objective-C: Несоответствие типов

Сборка продукта прошла успешно, но тест не прошел. Как передать ошибку несоответствия типов, указанную в строке с STAssertEquals ниже?

// TransactionSpec.m

#import "Transaction.h"

@interface TransactionSpec : SenTestCase
@end

@implementation TransactionSpec

#pragma mark Properties

- (void)testProperties {
    Transaction *transaction = [[Transaction alloc] init];
    transaction.type = TransactionTypePay;

    STAssertNotNil(transaction, @"transaction exists");
    STAssertEquals(transaction.type, TransactionTypePay, @"type property works"); // Type mismatch
}

@end

// Transaction.h

typedef enum {
    TransactionTypePay,
    TransactionTypeCharge
} TransactionType;

@interface Transaction : NSObject

@property (nonatomic) TransactionType *type;

@end

// Transaction.m

#import "Transaction.h"

@implementation Transaction

@synthesize type;

@end
0
задан ma11hew28 7 August 2011 в 20:47
поделиться