summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMuller, Alexander (A.) <amulle19@ford.com>2017-01-19 16:41:26 -0800
committerMuller, Alexander (A.) <amulle19@ford.com>2017-01-19 16:41:26 -0800
commit3faad1fe26ac7eefb9d9613b5884c809396a2035 (patch)
tree867434390c1f51a42842f54b24cc7cfa7b2d47d5
parent60c55a9d1b1b01c1dbb1366046ca7022e49e1d54 (diff)
parent36dc4c265062deb354358006156c4dd35b049332 (diff)
downloadsdl_ios-feature/issue_419_iOS6_removal.tar.gz
Merge remote-tracking branch 'origin/develop' into feature/issue_419_iOS6_removalfeature/issue_419_iOS6_removal
* origin/develop: Fixed issue with incorrectly parsing SDLRPCResponses.
-rw-r--r--SmartDeviceLink/SDLRPCResponse.m12
-rw-r--r--SmartDeviceLinkTests/RPCSpecs/SuperclassSpecs/SDLRPCResponseSpec.m19
2 files changed, 25 insertions, 6 deletions
diff --git a/SmartDeviceLink/SDLRPCResponse.m b/SmartDeviceLink/SDLRPCResponse.m
index f27369270..a7a839f54 100644
--- a/SmartDeviceLink/SDLRPCResponse.m
+++ b/SmartDeviceLink/SDLRPCResponse.m
@@ -45,27 +45,27 @@ NS_ASSUME_NONNULL_BEGIN
}
- (void)setSuccess:(NSNumber<SDLBool> *)success {
- [store sdl_setObject:success forName:SDLNameSuccess];
+ [parameters sdl_setObject:success forName:SDLNameSuccess];
}
- (NSNumber<SDLBool> *)success {
- return [store sdl_objectForName:SDLNameSuccess];
+ return [parameters sdl_objectForName:SDLNameSuccess];
}
- (void)setResultCode:(SDLResult)resultCode {
- [store sdl_setObject:resultCode forName:SDLNameResultCode];
+ [parameters sdl_setObject:resultCode forName:SDLNameResultCode];
}
- (SDLResult)resultCode {
- return [store sdl_objectForName:SDLNameResultCode];
+ return [parameters sdl_objectForName:SDLNameResultCode];
}
- (void)setInfo:(nullable NSString *)info {
- [store sdl_setObject:info forName:SDLNameInfo];
+ [parameters sdl_setObject:info forName:SDLNameInfo];
}
- (nullable NSString *)info {
- return [store sdl_objectForName:SDLNameInfo];
+ return [parameters sdl_objectForName:SDLNameInfo];
}
@end
diff --git a/SmartDeviceLinkTests/RPCSpecs/SuperclassSpecs/SDLRPCResponseSpec.m b/SmartDeviceLinkTests/RPCSpecs/SuperclassSpecs/SDLRPCResponseSpec.m
index f99d19b5b..073135985 100644
--- a/SmartDeviceLinkTests/RPCSpecs/SuperclassSpecs/SDLRPCResponseSpec.m
+++ b/SmartDeviceLinkTests/RPCSpecs/SuperclassSpecs/SDLRPCResponseSpec.m
@@ -8,6 +8,7 @@
#import <Quick/Quick.h>
#import <Nimble/Nimble.h>
+#import "SDLNames.h"
#import "SDLResult.h"
#import "SDLRPCResponse.h"
@@ -28,6 +29,24 @@ describe(@"Getter/Setter Tests", ^ {
expect(response.resultCode).to(equal(SDLResultIgnored));
expect(response.info).to(equal(@"It has been done"));
});
+
+ it(@"Should get correctly when initialized", ^ {
+ NSMutableDictionary* dict = [@{SDLNameResponse:
+ @{SDLNameParameters:
+ @{SDLNameSuccess:@YES,
+ SDLNameResultCode:SDLNameSuccess,
+ SDLNameInfo:@"Test Info"},
+ SDLNameCorrelationId:@1004,
+ SDLNameOperationName:SDLNameResponse}} mutableCopy];
+ SDLRPCResponse* testResponse = [[SDLRPCResponse alloc] initWithDictionary:dict];
+
+ expect(testResponse.getFunctionName).to(equal(SDLNameResponse));
+ expect(testResponse.correlationID).to(equal(@1004));
+ expect(testResponse.success).to(equal(@YES));
+ expect(testResponse.resultCode).to(equal(SDLNameSuccess));
+ expect(testResponse.info).to(equal(@"Test Info"));
+
+ });
});
QuickSpecEnd