RKPropertyMappingTestExpectation Class Reference
Inherits from | NSObject |
Declared in | RKPropertyMappingTestExpectation.h |
Overview
An RKMappingTestExpectation
object defines an expected mapping event that should occur during the execution of a RKMappingTest
.
Tasks
Creating Expectations
-
+ expectationWithSourceKeyPath:destinationKeyPath:
Creates and returns a new expectation specifying that a key path in a source object should be mapped to another key path on a destination object. The value mapped is not evaluated.
-
+ expectationWithSourceKeyPath:destinationKeyPath:value:
Creates and returns a new expectation specifying that a key path in a source object should be mapped to another key path on a destination object with a given value.
-
+ expectationWithSourceKeyPath:destinationKeyPath:evaluationBlock:
Creates and returns a new expectation specifying that a key path in a source object should be mapped to another key path on a destinaton object and that the attribute mapping and value should evaluate to true with a given block.
-
+ expectationWithSourceKeyPath:destinationKeyPath:mapping:
Creates and returns a new expectation specifying that a key path in a source object should be mapped to another key path on a destinaton object using a specific object mapping for the relationship.
Expectation Values
-
sourceKeyPath
Returns a keyPath on the source object that a value should be mapped from.
property -
destinationKeyPath
Returns a keyPath on the destination object that a value should be mapped to.
property -
value
Returns the expected value that should be set to the destinationKeyPath of the destination object.
property -
evaluationBlock
A block used to evaluate if the expectation has been satisfied.
property -
mapping
Returns the expected object mapping to be used for mapping a nested relationship.
property -
– summary
Returns a string summary of the expected keyPath mapping within the expectation
Properties
destinationKeyPath
Returns a keyPath on the destination object that a value should be mapped to.
@property (nonatomic, copy, readonly) NSString *destinationKeyPath
Declared In
RKPropertyMappingTestExpectation.h
evaluationBlock
A block used to evaluate if the expectation has been satisfied.
@property (nonatomic, copy, readonly) RKMappingTestExpectationEvaluationBlock evaluationBlock
Discussion
The block accepts three arguments, an RKPropertyMapping
object denoting the attribute or relationship that was mapped, the mapped value, and a pointer to an error object that is to be set if the block evaluates negatively, and returns a Boolean value indicating if the mapping satisfies the expectations of the block.
Declared In
RKPropertyMappingTestExpectation.h
mapping
Returns the expected object mapping to be used for mapping a nested relationship.
@property (nonatomic, strong, readonly) RKMapping *mapping
Declared In
RKPropertyMappingTestExpectation.h
sourceKeyPath
Returns a keyPath on the source object that a value should be mapped from.
@property (nonatomic, copy, readonly) NSString *sourceKeyPath
Declared In
RKPropertyMappingTestExpectation.h
value
Returns the expected value that should be set to the destinationKeyPath of the destination object.
@property (nonatomic, strong, readonly) id value
Declared In
RKPropertyMappingTestExpectation.h
Class Methods
expectationWithSourceKeyPath:destinationKeyPath:
Creates and returns a new expectation specifying that a key path in a source object should be mapped to another key path on a destination object. The value mapped is not evaluated.
+ (instancetype)expectationWithSourceKeyPath:(NSString *)sourceKeyPath destinationKeyPath:(NSString *)destinationKeyPath
Parameters
- sourceKeyPath
A key path on the source object that should be mapped.
- destinationKeyPath
A key path on the destination object that should be mapped onto.
Return Value
An expectation specifying that sourceKeyPath should be mapped to destinationKeyPath.
Declared In
RKPropertyMappingTestExpectation.h
expectationWithSourceKeyPath:destinationKeyPath:evaluationBlock:
Creates and returns a new expectation specifying that a key path in a source object should be mapped to another key path on a destinaton object and that the attribute mapping and value should evaluate to true with a given block.
+ (instancetype)expectationWithSourceKeyPath:(NSString *)sourceKeyPath destinationKeyPath:(NSString *)destinationKeyPath evaluationBlock:(RKMappingTestExpectationEvaluationBlock)evaluationBlock
Parameters
- sourceKeyPath
A key path on the source object that should be mapped.
- destinationKeyPath
A key path on the destination object that should be mapped onto.
- evaluationBlock
A block with which to evaluate the success of the mapping.
Return Value
An expectation specifying that sourceKeyPath should be mapped to destinationKeyPath with value.
Declared In
RKPropertyMappingTestExpectation.h
expectationWithSourceKeyPath:destinationKeyPath:mapping:
Creates and returns a new expectation specifying that a key path in a source object should be mapped to another key path on a destinaton object using a specific object mapping for the relationship.
+ (instancetype)expectationWithSourceKeyPath:(NSString *)sourceKeyPath destinationKeyPath:(NSString *)destinationKeyPath mapping:(RKMapping *)mapping
Parameters
- sourceKeyPath
A key path on the source object that should be mapped.
- destinationKeyPath
A key path on the destination object that should be mapped onto.
Return Value
An expectation specifying that sourceKeyPath should be mapped to destinationKeyPath using a specific object mapping.
Declared In
RKPropertyMappingTestExpectation.h
expectationWithSourceKeyPath:destinationKeyPath:value:
Creates and returns a new expectation specifying that a key path in a source object should be mapped to another key path on a destination object with a given value.
+ (instancetype)expectationWithSourceKeyPath:(NSString *)sourceKeyPath destinationKeyPath:(NSString *)destinationKeyPath value:(id)value
Parameters
- sourceKeyPath
A key path on the source object that should be mapped.
- destinationKeyPath
A key path on the destination object that should be mapped onto.
- value
The value that is expected to be assigned to the destination object at destinationKeyPath.
Return Value
An expectation specifying that sourceKeyPath should be mapped to destinationKeyPath with value.
Declared In
RKPropertyMappingTestExpectation.h
Instance Methods
summary
Returns a string summary of the expected keyPath mapping within the expectation
- (NSString *)summary
Return Value
A string describing the expected sourceKeyPath to destinationKeyPath mapping.
Declared In
RKPropertyMappingTestExpectation.h