summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMuller, Alexander (A.) <amulle19@ford.com>2017-01-19 16:40:59 -0800
committerMuller, Alexander (A.) <amulle19@ford.com>2017-01-19 16:40:59 -0800
commitb6eec6c3fcf7136e791f9b686cbb251d55ae12f1 (patch)
treef50d789ce6ca5d66d82c3ad149fe1610c3a9e40e
parentce17803ea6f24a566c408d8607aabdf3716953b8 (diff)
parent36dc4c265062deb354358006156c4dd35b049332 (diff)
downloadsdl_ios-feature/issue_217_abstract_protocol_removal.tar.gz
Merge remote-tracking branch 'origin/develop' into feature/issue_217_abstract_protocol_removalfeature/issue_217_abstract_protocol_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