From 0ae15b3b1fda7c2c299fb9c1e40d4137f61af126 Mon Sep 17 00:00:00 2001 From: "Muller, Alexander (A.)" Date: Fri, 4 Nov 2016 11:41:36 -0700 Subject: Uncommented SDLOasisAddress. --- SmartDeviceLink/SDLLocationDetails.h | 17 ++++++------ SmartDeviceLink/SDLLocationDetails.m | 24 ++++++++-------- .../NotificationSpecs/SDLOnWaypointChangeSpec.m | 6 ++-- .../ResponseSpecs/SDLGetWaypointsResponseSpec.m | 6 ++-- .../RPCSpecs/StructSpecs/SDLLocationDetailsSpec.m | 32 +++++++++++----------- 5 files changed, 43 insertions(+), 42 deletions(-) diff --git a/SmartDeviceLink/SDLLocationDetails.h b/SmartDeviceLink/SDLLocationDetails.h index 80676a26d..349a58265 100644 --- a/SmartDeviceLink/SDLLocationDetails.h +++ b/SmartDeviceLink/SDLLocationDetails.h @@ -5,6 +5,7 @@ @class SDLLocationCoordinate; @class SDLImage; +@class SDLOasisAddress; @interface SDLLocationDetails : SDLRPCStruct @@ -54,14 +55,14 @@ */ @property (strong, nonatomic) SDLImage *locationImage; -///** -// * @abstract Address to be used by navigation engines for search. -// * -// * @see SDLOASISAddress -// * -// * Optional -// */ -//@property (strong) SDLOasisAddress *searchAddress; +/** + * @abstract Address to be used by navigation engines for search. + * + * @see SDLOASISAddress + * + * Optional + */ +@property (strong) SDLOasisAddress *searchAddress; @end diff --git a/SmartDeviceLink/SDLLocationDetails.m b/SmartDeviceLink/SDLLocationDetails.m index e46ca1fc1..b0c99bf55 100644 --- a/SmartDeviceLink/SDLLocationDetails.m +++ b/SmartDeviceLink/SDLLocationDetails.m @@ -6,7 +6,7 @@ #import "SDLLocationCoordinate.h" #import "SDLImage.h" #import "SDLNames.h" -//#import "SDLOasisAddress.h" +#import "SDLOasisAddress.h" @implementation SDLLocationDetails @@ -82,16 +82,16 @@ return store[NAMES_locationImage]; } -//- (void)setSearchAddress:(SDLOasisAddress *)searchAddress { -// if (searchAddress != nil) { -// store[NAMES_address] = searchAddress; -// } else { -// [store removeObjectForKey:NAMES_address]; -// } -//} -// -//- (SDLOasisAddress *)searchAddress { -// return store[NAMES_address]; -//} +- (void)setSearchAddress:(SDLOasisAddress *)searchAddress { + if (searchAddress != nil) { + store[NAMES_address] = searchAddress; + } else { + [store removeObjectForKey:NAMES_address]; + } +} + +- (SDLOasisAddress *)searchAddress { + return store[NAMES_address]; +} @end diff --git a/SmartDeviceLinkTests/RPCSpecs/NotificationSpecs/SDLOnWaypointChangeSpec.m b/SmartDeviceLinkTests/RPCSpecs/NotificationSpecs/SDLOnWaypointChangeSpec.m index 0d0e6eb80..b08d8bb5d 100644 --- a/SmartDeviceLinkTests/RPCSpecs/NotificationSpecs/SDLOnWaypointChangeSpec.m +++ b/SmartDeviceLinkTests/RPCSpecs/NotificationSpecs/SDLOnWaypointChangeSpec.m @@ -12,7 +12,7 @@ #import "SDLLocationCoordinate.h" #import "SDLLocationDetails.h" #import "SDLNames.h" -//#import "SDLOasisAddress.h" +#import "SDLOasisAddress.h" QuickSpecBegin(SDLOnWaypointChangeSpec) @@ -34,7 +34,7 @@ describe(@"Getter/Setter Tests", ^ { someLocation.addressLines = @[@"3136 Hilton Rd", @"Ferndale, MI", @"48220"]; someLocation.phoneNumber = @"248-591-0333"; someLocation.locationImage = [[SDLImage alloc] init]; -// someLocation.address = [[SDLOasisAddress alloc] init]; + someLocation.searchAddress = [[SDLOasisAddress alloc] init]; someWaypoints = @[someLocation]; @@ -59,7 +59,7 @@ describe(@"Getter/Setter Tests", ^ { someLocation.addressLines = @[@"3136 Hilton Rd", @"Ferndale, MI", @"48220"]; someLocation.phoneNumber = @"248-591-0333"; someLocation.locationImage = [[SDLImage alloc] init]; -// someLocation.address = [[SDLOasisAddress alloc] init]; + someLocation.searchAddress = [[SDLOasisAddress alloc] init]; someWaypoints = @[someLocation]; diff --git a/SmartDeviceLinkTests/RPCSpecs/ResponseSpecs/SDLGetWaypointsResponseSpec.m b/SmartDeviceLinkTests/RPCSpecs/ResponseSpecs/SDLGetWaypointsResponseSpec.m index ab1dff69e..4754fe4e8 100644 --- a/SmartDeviceLinkTests/RPCSpecs/ResponseSpecs/SDLGetWaypointsResponseSpec.m +++ b/SmartDeviceLinkTests/RPCSpecs/ResponseSpecs/SDLGetWaypointsResponseSpec.m @@ -12,7 +12,7 @@ #import "SDLLocationCoordinate.h" #import "SDLLocationDetails.h" #import "SDLNames.h" -//#import "SDLOasisAddress.h" +#import "SDLOasisAddress.h" QuickSpecBegin(SDLGetWaypointsResponseSpec) @@ -34,7 +34,7 @@ describe(@"Getter/Setter Tests", ^ { someLocation.addressLines = @[@"3136 Hilton Rd", @"Ferndale, MI", @"48220"]; someLocation.phoneNumber = @"248-591-0333"; someLocation.locationImage = [[SDLImage alloc] init]; -// someLocation.address = [[SDLOasisAddress alloc] init]; + someLocation.searchAddress = [[SDLOasisAddress alloc] init]; someWaypoints = @[someLocation]; @@ -59,7 +59,7 @@ describe(@"Getter/Setter Tests", ^ { someLocation.addressLines = @[@"3136 Hilton Rd", @"Ferndale, MI", @"48220"]; someLocation.phoneNumber = @"248-591-0333"; someLocation.locationImage = [[SDLImage alloc] init]; -// someLocation.address = [[SDLOasisAddress alloc] init]; + someLocation.searchAddress = [[SDLOasisAddress alloc] init]; someWaypoints = @[someLocation]; diff --git a/SmartDeviceLinkTests/RPCSpecs/StructSpecs/SDLLocationDetailsSpec.m b/SmartDeviceLinkTests/RPCSpecs/StructSpecs/SDLLocationDetailsSpec.m index 6915ad324..a0903293c 100644 --- a/SmartDeviceLinkTests/RPCSpecs/StructSpecs/SDLLocationDetailsSpec.m +++ b/SmartDeviceLinkTests/RPCSpecs/StructSpecs/SDLLocationDetailsSpec.m @@ -11,7 +11,7 @@ #import "SDLImage.h" #import "SDLLocationCoordinate.h" #import "SDLNames.h" -//#import "SDLOasisAddress.h" +#import "SDLOasisAddress.h" QuickSpecBegin(SDLLocationDetailsSpec) @@ -23,7 +23,7 @@ describe(@"Getter/Setter Tests", ^ { __block NSString *somePhoneNumber = nil; __block SDLImage* someImage = nil; __block SDLLocationCoordinate* someCoordinate = nil; -// __block SDLOasisAddress* someAddress = nil; + __block SDLOasisAddress* someAddress = nil; describe(@"when initialized with init", ^{ beforeEach(^{ @@ -38,7 +38,7 @@ describe(@"Getter/Setter Tests", ^ { someAddressLines = @[@"3136 Hilton Rd", @"Ferndale, MI", @"48220"]; somePhoneNumber = @"248-591-0333"; someImage = [[SDLImage alloc] init]; -// someAddress = [[SDLOasisAddress alloc] init]; + someAddress = [[SDLOasisAddress alloc] init]; testStruct.coordinate = someCoordinate; testStruct.locationName = someLocation; @@ -46,7 +46,7 @@ describe(@"Getter/Setter Tests", ^ { testStruct.addressLines = someAddressLines; testStruct.phoneNumber = somePhoneNumber; testStruct.locationImage = someImage; -// testStruct.searchAddress = someAddress; + testStruct.searchAddress = someAddress; }); // Since all the properties are immutable, a copy should be executed as a retain, which means they should be identical @@ -80,10 +80,10 @@ describe(@"Getter/Setter Tests", ^ { expect(testStruct.locationImage).to(beIdenticalTo(someImage)); }); -// it(@"should get address correctly", ^{ -// expect(testStruct.searchAddress).to(equal(someAddress)); -// expect(testStruct.searchAddress).to(beIdenticalTo(someAddress)); -// }); + it(@"should get address correctly", ^{ + expect(testStruct.searchAddress).to(equal(someAddress)); + expect(testStruct.searchAddress).to(beIdenticalTo(someAddress)); + }); }); }); @@ -104,7 +104,7 @@ describe(@"Getter/Setter Tests", ^ { NAMES_addressLines: someAddressLines, NAMES_phoneNumber: somePhoneNumber, NAMES_locationImage: someImage, -// NAMES_address: someAddress + NAMES_address: someAddress }; testStruct = [[SDLLocationDetails alloc] initWithDictionary:[NSMutableDictionary dictionaryWithDictionary:initDict]]; @@ -141,10 +141,10 @@ describe(@"Getter/Setter Tests", ^ { expect(testStruct.locationImage).to(beIdenticalTo(someImage)); }); -// it(@"should get address correctly", ^{ -// expect(testStruct.searchAddress).to(equal(someAddress)); -// expect(testStruct.searchAddress).to(beIdenticalTo(someAddress)); -// }); + it(@"should get address correctly", ^{ + expect(testStruct.searchAddress).to(equal(someAddress)); + expect(testStruct.searchAddress).to(beIdenticalTo(someAddress)); + }); }); context(@"when parameters are not set", ^{ @@ -182,9 +182,9 @@ describe(@"Getter/Setter Tests", ^ { expect(testStruct.locationImage).to(beNil()); }); -// it(@"should return nil for address", ^{ -// expect(testStruct.searchAddress).to(beNil()); -// }); + it(@"should return nil for address", ^{ + expect(testStruct.searchAddress).to(beNil()); + }); }); }); }); -- cgit v1.2.1