mirror of
https://github.com/zhigang1992/RestKit.git
synced 2026-03-30 23:24:06 +08:00
35 lines
1.1 KiB
Objective-C
35 lines
1.1 KiB
Objective-C
//
|
|
// RKAttributeMappingTest.m
|
|
// RestKit
|
|
//
|
|
// Created by Blake Watters on 6/8/12.
|
|
// Copyright (c) 2012 RestKit. All rights reserved.
|
|
//
|
|
|
|
#import "RKTestEnvironment.h"
|
|
#import "RKAttributeMapping.h"
|
|
|
|
@interface RKAttributeMappingTest : RKTestCase
|
|
|
|
@end
|
|
|
|
@implementation RKAttributeMappingTest
|
|
|
|
- (void)testThatAttributeMappingsWithTheSameSourceAndDestinationKeyPathAreConsideredEqual
|
|
{
|
|
RKAttributeMapping *mapping1 = [RKAttributeMapping attributeMappingFromKeyPath:@"this" toKeyPath:@"that"];
|
|
RKAttributeMapping *mapping2 = [RKAttributeMapping attributeMappingFromKeyPath:@"this" toKeyPath:@"that"];
|
|
|
|
assertThatBool([mapping1 isEqualToMapping:mapping2], is(equalToBool(YES)));
|
|
}
|
|
|
|
- (void)testThatAttributeMappingsWithDifferingKeyPathsAreNotConsideredEqual
|
|
{
|
|
RKAttributeMapping *mapping1 = [RKAttributeMapping attributeMappingFromKeyPath:@"this" toKeyPath:@"that"];
|
|
RKAttributeMapping *mapping2 = [RKAttributeMapping attributeMappingFromKeyPath:@"this" toKeyPath:@"the other"];
|
|
|
|
assertThatBool([mapping1 isEqualToMapping:mapping2], is(equalToBool(NO)));
|
|
}
|
|
|
|
@end
|