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

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

    property

Properties

destinationKeyPath

@property (nonatomic, copy, readonly) NSString *destinationKeyPath
Discussion

Returns a keyPath on the destination object that a value should be mapped to.

Declared In

RKPropertyMappingTestExpectation.h

evaluationBlock

@property (nonatomic, copy, readonly) RKMappingTestExpectationEvaluationBlock evaluationBlock
Discussion

A block used to evaluate if the expectation has been satisfied.

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

@property (nonatomic, strong, readonly) RKMapping *mapping
Discussion

Returns the expected object mapping to be used for mapping a nested relationship.

Declared In

RKPropertyMappingTestExpectation.h

sourceKeyPath

@property (nonatomic, copy, readonly) NSString *sourceKeyPath
Discussion

Returns a keyPath on the source object that a value should be mapped from.

Declared In

RKPropertyMappingTestExpectation.h

summary

@property (nonatomic, readonly, copy) NSString *summary
Discussion

Returns a string summary of the expected keyPath mapping within the expectation

Return Value

A string describing the expected sourceKeyPath to destinationKeyPath mapping.

Declared In

RKPropertyMappingTestExpectation.h

value

@property (nonatomic, strong, readonly) id value
Discussion

Returns the expected value that should be set to the destinationKeyPath of the destination object.

Declared In

RKPropertyMappingTestExpectation.h

Class Methods

expectationWithSourceKeyPath:destinationKeyPath:

+ (instancetype)expectationWithSourceKeyPath:(NSString *)sourceKeyPath destinationKeyPath:(NSString *)destinationKeyPath
Discussion

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.

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:

+ (instancetype)expectationWithSourceKeyPath:(NSString *)sourceKeyPath destinationKeyPath:(NSString *)destinationKeyPath evaluationBlock:(RKMappingTestExpectationEvaluationBlock)evaluationBlock
Discussion

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.

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:

+ (instancetype)expectationWithSourceKeyPath:(NSString *)sourceKeyPath destinationKeyPath:(NSString *)destinationKeyPath mapping:(RKMapping *)mapping
Discussion

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.

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.

mapping

An object mapping that is expected to be used for mapping the nested relationship.

Return Value

An expectation specifying that sourceKeyPath should be mapped to destinationKeyPath using a specific object mapping.

Declared In

RKPropertyMappingTestExpectation.h

expectationWithSourceKeyPath:destinationKeyPath:value:

+ (instancetype)expectationWithSourceKeyPath:(NSString *)sourceKeyPath destinationKeyPath:(NSString *)destinationKeyPath value:(id)value
Discussion

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.

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