NSException (SenTestFailure)


Declared In:
NSException_SenTestFailure.h


Category Description

No category description.


Global Variables

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;


Method Types

- 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:


Class Methods

failureInCondition:isTrue: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:
SenFailureTypeKeySenConditionFailure.
SenTestConditionKeyThe condition (as a string) that caused this failure.
SenTestFilenameKeyThe filename containing the code that caused the exception.
SenTestLineNumberKeyThe lineNumber of the code that caused the exception.
SenTestDescriptionKeyA description constructed from the formatString and the variable number of arguments that follow it.


failureInEqualityBetweenObject:andObject:inFile:atLine:withDescription:

+ (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:
SenFailureTypeKeySenEqualityFailure.
SenTestEqualityLeftKeyThe left object.
SenTestEqualityRightKeyThe right object.
SenTestFilenameKeyThe filename containing the code that caused the exception.
SenTestLineNumberKeyThe lineNumber of the code that caused the exception.
SenTestDescriptionKeyA description constructed from the formatString and the variable number of arguments that follow it.


failureInEqualityBetweenValue:andValue:withAccuracy:inFile:atLine:withDescription:

+ (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:
SenFailureTypeKeySenEqualityFailure.
SenTestEqualityLeftKeyThe left object.
SenTestEqualityRightKeyThe right object.
SenTestEqualityAccuracyKeyThe difference object.
SenTestFilenameKeyThe filename containing the code that caused the exception.
SenTestLineNumberKeyThe lineNumber of the code that caused the exception.
SenTestDescriptionKeyA description constructed from the formatString and the variable number of arguments that follow it.


failureInFile:atLine:withDescription:

+ (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:
SenFailureTypeKeySenUnconditionalFailure.
SenTestFilenameKeyThe filename containing the code that caused the exception.
SenTestLineNumberKeyThe lineNumber of the code that caused the exception.
SenTestDescriptionKeyA description constructed from the formatString and the variable number of arguments that follow it.


failureInRaise:exception:inFile:atLine:withDescription:

+ (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:
SenFailureTypeKeySenRaiseFailure.
SenTestConditionKeyThe expression as a string.
SenTestFilenameKeyThe filename containing the code that caused the exception.
SenTestLineNumberKeyThe lineNumber of the code that caused the exception.
SenTestDescriptionKeyA description constructed from the formatString and the variable number of arguments that follow it.


failureInRaise:inFile:atLine:withDescription:

+ (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:
SenFailureTypeKeySenRaiseFailure.
SenTestConditionKeyThe expression as a string.
SenTestFilenameKeyThe filename containing the code that caused the exception.
SenTestLineNumberKeyThe lineNumber of the code that caused the exception.
SenTestDescriptionKeyA description constructed from the formatString and the variable number of arguments that follow it.


Instance Methods

filePathInProject

- (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.


filename

- (NSString *)filename

The filename containing the code that caused this exception.


lineNumber

- (NSNumber *)lineNumber

The line number of the code that caused the exception.


CVS Version 1.9 Copyright ©2005 by Sente SA. All Rights Reserved. Fri Apr 01 13:49:06 2005