Files
RestKit/Tests/Logic/ObjectMapping/RKObjectAttributeMappingTest.m
Blake Watters d926e240f8 Introduce RKPropertyMapping abstract superclass for RKAttributeMapping and RKRelationshipMapping.
Add primitives for working with attribute, relationship, and property mapping objects.
2012-08-28 14:14:20 -04:00

35 lines
1.0 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 mappingFromKeyPath:@"this" toKeyPath:@"that"];
RKAttributeMapping *mapping2 = [RKAttributeMapping mappingFromKeyPath:@"this" toKeyPath:@"that"];
assertThatBool([mapping1 isEqualToMapping:mapping2], is(equalToBool(YES)));
}
- (void)testThatAttributeMappingsWithDifferingKeyPathsAreNotConsideredEqual
{
RKAttributeMapping *mapping1 = [RKAttributeMapping mappingFromKeyPath:@"this" toKeyPath:@"that"];
RKAttributeMapping *mapping2 = [RKAttributeMapping mappingFromKeyPath:@"this" toKeyPath:@"the other"];
assertThatBool([mapping1 isEqualToMapping:mapping2], is(equalToBool(NO)));
}
@end