- Declared In:
- NSException_SenTestFailure.h
Synopsis:
NSString * const SenTestFailureException;
NSString * const SenFailureTypeKey;
NSString * const SenConditionFailure;
NSString * const SenRaiseFailure;
NSString * const SenEqualityFailure;
NSString * const SenUnconditionalFailure;
NSString * const SenTestConditionKey;
NSString * const SenTestEqualityLeftKey;
NSString * const SenTestEqualityRightKey;
NSString * const SenTestEqualityAccuracyKey;
NSString * const SenTestFilenameKey;
NSString * const SenTestLineNumberKey;
NSString * const SenTestDescriptionKey;
- - filename
- - filePathInProject
- - lineNumber
- + failureInFile:atLine:withDescription:
- + failureInCondition:isTrue:inFile:atLine:withDescription:
- + failureInEqualityBetweenObject:andObject:inFile:atLine:withDescription:
- + failureInEqualityBetweenValue:andValue:withAccuracy:inFile:atLine:withDescription:
- + failureInRaise:inFile:atLine:withDescription:
- + failureInRaise:exception:inFile:atLine:withDescription:
+ (NSException *)failureInCondition:(NSString *)condition isTrue:(BOOL)isTrue inFile:(NSString *)filename atLine:(int)lineNumber withDescription:(NSString *)formatString, ...
This method returns a NSException with a name of "SenTestFailureException". A reason constructed from the condition, the boolean isTrue and the formatString and the variable number of arguments that follow it (just like in the NSString method -stringWithFormat:). And an user info dictionary that contain the following information for the given keys:
SenFailureTypeKey | SenConditionFailure. |
SenTestConditionKey | The condition (as a string) that caused this failure. |
SenTestFilenameKey | The filename containing the code that caused the exception. |
SenTestLineNumberKey | The lineNumber of the code that caused the exception. |
SenTestDescriptionKey | A description constructed from the formatString and the variable number of arguments that follow it. |
+ (NSException *)failureInEqualityBetweenObject:(id)left andObject:(id)right inFile:(NSString *)filename atLine:(int)lineNumber withDescription:(NSString *)formatString, ...
This method returns a NSException with a name of "SenTestFailureException". A reason constructed from the descriptions of the left and right objects and the formatString and the variable number of arguments that follow it (just like in the NSString method -stringWithFormat:). And an user info dictionary that contain the following information for the given keys:
SenFailureTypeKey | SenEqualityFailure. |
SenTestEqualityLeftKey | The left object. |
SenTestEqualityRightKey | The right object. |
SenTestFilenameKey | The filename containing the code that caused the exception. |
SenTestLineNumberKey | The lineNumber of the code that caused the exception. |
SenTestDescriptionKey | A description constructed from the formatString and the variable number of arguments that follow it. |
+ (NSException *)failureInEqualityBetweenValue:(NSValue *)left andValue:(NSValue *)right withAccuracy:(NSValue *)accuracy inFile:(NSString *)filename atLine:(int)lineNumber withDescription:(NSString *)formatString, ...
This method returns a NSException with a name of "SenTestFailureException". A reason constructed from the descriptions of the left and right objects and the formatString and the variable number of arguments that follow it (just like in the NSString method -stringWithFormat:). And an user info dictionary that contain the following information for the given keys:
SenFailureTypeKey | SenEqualityFailure. |
SenTestEqualityLeftKey | The left object. |
SenTestEqualityRightKey | The right object. |
SenTestEqualityAccuracyKey | The difference object. |
SenTestFilenameKey | The filename containing the code that caused the exception. |
SenTestLineNumberKey | The lineNumber of the code that caused the exception. |
SenTestDescriptionKey | A description constructed from the formatString and the variable number of arguments that follow it. |
+ (NSException *)failureInFile:(NSString *)filename atLine:(int)lineNumber withDescription:(NSString *)formatString, ...
This method returns a NSException with a name of "SenTestFailureException". A reason constructed from the formatString and the variable number of arguments that follow it (just like in the NSString method -stringWithFormat:). And an user info dictionary that contain the following information for the given keys:
SenFailureTypeKey | SenUnconditionalFailure. |
SenTestFilenameKey | The filename containing the code that caused the exception. |
SenTestLineNumberKey | The lineNumber of the code that caused the exception. |
SenTestDescriptionKey | A description constructed from the formatString and the variable number of arguments that follow it. |
+ (NSException *)failureInRaise:(NSString *)expression exception:(NSException *)exception inFile:(NSString *)filename atLine:(int)lineNumber withDescription:(NSString *)formatString, ...
This method returns a NSException with a name of "SenTestFailureException". A reason constructed from the expression, the reason for the exception and the formatString and the variable number of arguments that follow it (just like in the NSString method -stringWithFormat:). And an user info dictionary that contain the following information for the given keys:
SenFailureTypeKey | SenRaiseFailure. |
SenTestConditionKey | The expression as a string. |
SenTestFilenameKey | The filename containing the code that caused the exception. |
SenTestLineNumberKey | The lineNumber of the code that caused the exception. |
SenTestDescriptionKey | A description constructed from the formatString and the variable number of arguments that follow it. |
+ (NSException *)failureInRaise:(NSString *)expression inFile:(NSString *)filename atLine:(int)lineNumber withDescription:(NSString *)formatString, ...
This method returns a NSException with a name of "SenTestFailureException". A reason constructed from the expression and the formatString and the variable number of arguments that follow it (just like in the NSString method -stringWithFormat:). And an user info dictionary that contain the following information for the given keys:
SenFailureTypeKey | SenRaiseFailure. |
SenTestConditionKey | The expression as a string. |
SenTestFilenameKey | The filename containing the code that caused the exception. |
SenTestLineNumberKey | The lineNumber of the code that caused the exception. |
SenTestDescriptionKey | A description constructed from the formatString and the variable number of arguments that follow it. |
- (NSString *)filePathInProject
This method returns the path to the source code file that caused this exception. If [self filename] is nil or empty then Unknown.m is returned. If the file cannot be found in the current directory or any of sub-directories then the name of aFilename is returned. Note that the current directory is searched only if it is a project directory. A project directory is one that contains the file PB.project or XXX.xcode or XXX.pbproj where XXX is the name of the current directory.
- (NSString *)filename
The filename containing the code that caused this exception.
- (NSNumber *)lineNumber
The line number of the code that caused the exception.