summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNicoleYarroch <nicole@livio.io>2019-02-27 13:05:46 -0500
committerNicoleYarroch <nicole@livio.io>2019-02-27 13:05:46 -0500
commit48f0e6dfacc647dcaa98f06c1bd325d2ef652c99 (patch)
treeed3611ab791eb505764f6d4422bb5f99e695ba59
parent6a7d7a39d444559e07ed1c82643567b7be4e8314 (diff)
downloadsdl_ios-48f0e6dfacc647dcaa98f06c1bd325d2ef652c99.tar.gz
Added param to OnVehicleData
Added cloudAppVehicleID param to OnVehicleData
-rw-r--r--SmartDeviceLink/SDLOnVehicleData.h5
-rw-r--r--SmartDeviceLink/SDLOnVehicleData.m8
-rw-r--r--SmartDeviceLinkTests/RPCSpecs/NotificationSpecs/SDLOnVehicleDataSpec.m48
-rw-r--r--SmartDeviceLinkTests/RPCSpecs/ResponseSpecs/SDLGetVehicleDataResponseSpec.m45
4 files changed, 79 insertions, 27 deletions
diff --git a/SmartDeviceLink/SDLOnVehicleData.h b/SmartDeviceLink/SDLOnVehicleData.h
index f4449c070..463245d30 100644
--- a/SmartDeviceLink/SDLOnVehicleData.h
+++ b/SmartDeviceLink/SDLOnVehicleData.h
@@ -181,6 +181,11 @@ NS_ASSUME_NONNULL_BEGIN
*/
@property (nullable, strong, nonatomic) SDLTurnSignal turnSignal;
+/**
+ The cloud app vehicle ID
+ */
+@property (nullable, strong, nonatomic) NSString *cloudAppVehicleID;
+
@end
NS_ASSUME_NONNULL_END
diff --git a/SmartDeviceLink/SDLOnVehicleData.m b/SmartDeviceLink/SDLOnVehicleData.m
index 8c77db316..6cebb5460 100644
--- a/SmartDeviceLink/SDLOnVehicleData.m
+++ b/SmartDeviceLink/SDLOnVehicleData.m
@@ -261,6 +261,14 @@ NS_ASSUME_NONNULL_BEGIN
return [parameters sdl_objectForName:SDLNameTurnSignal];
}
+- (void)setCloudAppVehicleID:(nullable NSString *)cloudAppVehicleID {
+ [parameters sdl_setObject:cloudAppVehicleID forName:SDLNameCloudAppVehicleID];
+}
+
+- (nullable NSString *)cloudAppVehicleID {
+ return [parameters sdl_objectForName:SDLNameCloudAppVehicleID];
+}
+
@end
NS_ASSUME_NONNULL_END
diff --git a/SmartDeviceLinkTests/RPCSpecs/NotificationSpecs/SDLOnVehicleDataSpec.m b/SmartDeviceLinkTests/RPCSpecs/NotificationSpecs/SDLOnVehicleDataSpec.m
index aba995df9..a743fc0d9 100644
--- a/SmartDeviceLinkTests/RPCSpecs/NotificationSpecs/SDLOnVehicleDataSpec.m
+++ b/SmartDeviceLinkTests/RPCSpecs/NotificationSpecs/SDLOnVehicleDataSpec.m
@@ -14,20 +14,37 @@
QuickSpecBegin(SDLOnVehicleDataSpec)
-SDLGPSData* gps = [[SDLGPSData alloc] init];
-SDLTireStatus* tires = [[SDLTireStatus alloc] init];
-SDLBeltStatus* belt = [[SDLBeltStatus alloc] init];
-SDLBodyInformation* body = [[SDLBodyInformation alloc] init];
-SDLDeviceStatus* device = [[SDLDeviceStatus alloc] init];
-SDLHeadLampStatus* headLamp = [[SDLHeadLampStatus alloc] init];
-SDLECallInfo* eCall = [[SDLECallInfo alloc] init];
-SDLAirbagStatus* airbag = [[SDLAirbagStatus alloc] init];
-SDLEmergencyEvent* event = [[SDLEmergencyEvent alloc] init];
-SDLClusterModeStatus* clusterMode = [[SDLClusterModeStatus alloc] init];
-SDLMyKey* myKey = [[SDLMyKey alloc] init];
-SDLFuelRange* fuelRange = [[SDLFuelRange alloc] init];
-
describe(@"Getter/Setter Tests", ^ {
+ __block SDLGPSData* gps = nil;
+ __block SDLTireStatus* tires = nil;
+ __block SDLBeltStatus* belt = nil;
+ __block SDLBodyInformation* body = nil;
+ __block SDLDeviceStatus* device = nil;
+ __block SDLHeadLampStatus* headLamp = nil;
+ __block SDLECallInfo* eCall = nil;
+ __block SDLAirbagStatus* airbag = nil;
+ __block SDLEmergencyEvent* event = nil;
+ __block SDLClusterModeStatus* clusterMode = nil;
+ __block SDLMyKey* myKey = nil;
+ __block SDLFuelRange* fuelRange = nil;
+ __block NSString* cloudAppVehicleID = nil;
+
+ beforeEach(^{
+ gps = [[SDLGPSData alloc] init];
+ tires = [[SDLTireStatus alloc] init];
+ belt = [[SDLBeltStatus alloc] init];
+ body = [[SDLBodyInformation alloc] init];
+ device = [[SDLDeviceStatus alloc] init];
+ headLamp = [[SDLHeadLampStatus alloc] init];
+ eCall = [[SDLECallInfo alloc] init];
+ airbag = [[SDLAirbagStatus alloc] init];
+ event = [[SDLEmergencyEvent alloc] init];
+ clusterMode = [[SDLClusterModeStatus alloc] init];
+ myKey = [[SDLMyKey alloc] init];
+ fuelRange = [[SDLFuelRange alloc] init];
+ cloudAppVehicleID = @"testCloudAppVehicleID";
+ });
+
it(@"Should set and get correctly", ^ {
SDLOnVehicleData* testNotification = [[SDLOnVehicleData alloc] init];
@@ -35,6 +52,7 @@ describe(@"Getter/Setter Tests", ^ {
testNotification.airbagStatus = airbag;
testNotification.beltStatus = belt;
testNotification.bodyInformation = body;
+ testNotification.cloudAppVehicleID = cloudAppVehicleID;
testNotification.clusterModeStatus = clusterMode;
testNotification.deviceStatus = device;
testNotification.driverBraking = SDLVehicleDataEventStatusYes;
@@ -65,6 +83,7 @@ describe(@"Getter/Setter Tests", ^ {
expect(testNotification.airbagStatus).to(equal(airbag));
expect(testNotification.beltStatus).to(equal(belt));
expect(testNotification.bodyInformation).to(equal(body));
+ expect(testNotification.cloudAppVehicleID).to(equal(cloudAppVehicleID));
expect(testNotification.clusterModeStatus).to(equal(clusterMode));
expect(testNotification.deviceStatus).to(equal(device));
expect(testNotification.driverBraking).to(equal(SDLVehicleDataEventStatusYes));
@@ -99,6 +118,7 @@ describe(@"Getter/Setter Tests", ^ {
SDLNameAirbagStatus:airbag,
SDLNameBeltStatus:belt,
SDLNameBodyInformation:body,
+ SDLNameCloudAppVehicleID:cloudAppVehicleID,
SDLNameClusterModeStatus:clusterMode,
SDLNameDeviceStatus:device,
SDLNameDriverBraking:SDLVehicleDataEventStatusYes,
@@ -131,6 +151,7 @@ describe(@"Getter/Setter Tests", ^ {
expect(testNotification.airbagStatus).to(equal(airbag));
expect(testNotification.beltStatus).to(equal(belt));
expect(testNotification.bodyInformation).to(equal(body));
+ expect(testNotification.cloudAppVehicleID).to(equal(cloudAppVehicleID));
expect(testNotification.clusterModeStatus).to(equal(clusterMode));
expect(testNotification.deviceStatus).to(equal(device));
expect(testNotification.driverBraking).to(equal(SDLVehicleDataEventStatusYes));
@@ -165,6 +186,7 @@ describe(@"Getter/Setter Tests", ^ {
expect(testNotification.airbagStatus).to(beNil());
expect(testNotification.beltStatus).to(beNil());
expect(testNotification.bodyInformation).to(beNil());
+ expect(testNotification.cloudAppVehicleID).to(beNil());
expect(testNotification.clusterModeStatus).to(beNil());
expect(testNotification.deviceStatus).to(beNil());
expect(testNotification.driverBraking).to(beNil());
diff --git a/SmartDeviceLinkTests/RPCSpecs/ResponseSpecs/SDLGetVehicleDataResponseSpec.m b/SmartDeviceLinkTests/RPCSpecs/ResponseSpecs/SDLGetVehicleDataResponseSpec.m
index bf9ebae48..e844bc02f 100644
--- a/SmartDeviceLinkTests/RPCSpecs/ResponseSpecs/SDLGetVehicleDataResponseSpec.m
+++ b/SmartDeviceLinkTests/RPCSpecs/ResponseSpecs/SDLGetVehicleDataResponseSpec.m
@@ -15,20 +15,37 @@
QuickSpecBegin(SDLGetVehicleDataResponseSpec)
describe(@"Getter/Setter Tests", ^ {
- __block SDLGPSData* gps = [[SDLGPSData alloc] init];
- __block SDLTireStatus* tires = [[SDLTireStatus alloc] init];
- __block SDLBeltStatus* belt = [[SDLBeltStatus alloc] init];
- __block SDLBodyInformation* body = [[SDLBodyInformation alloc] init];
- __block SDLDeviceStatus* device = [[SDLDeviceStatus alloc] init];
- __block SDLHeadLampStatus* headLamp = [[SDLHeadLampStatus alloc] init];
- __block SDLECallInfo* eCall = [[SDLECallInfo alloc] init];
- __block SDLAirbagStatus* airbag = [[SDLAirbagStatus alloc] init];
- __block SDLEmergencyEvent* event = [[SDLEmergencyEvent alloc] init];
- __block SDLClusterModeStatus* clusterMode = [[SDLClusterModeStatus alloc] init];
- __block SDLMyKey* myKey = [[SDLMyKey alloc] init];
- __block SDLFuelRange* fuelRange = [[SDLFuelRange alloc] init];
- __block NSString* vin = @"6574839201a";
- __block NSString* cloudAppVehicleID = @"cloudAppVehicleID";
+ __block SDLGPSData* gps = nil;
+ __block SDLTireStatus* tires = nil;
+ __block SDLBeltStatus* belt = nil;
+ __block SDLBodyInformation* body = nil;
+ __block SDLDeviceStatus* device = nil;
+ __block SDLHeadLampStatus* headLamp = nil;
+ __block SDLECallInfo* eCall = nil;
+ __block SDLAirbagStatus* airbag = nil;
+ __block SDLEmergencyEvent* event = nil;
+ __block SDLClusterModeStatus* clusterMode = nil;
+ __block SDLMyKey* myKey = nil;
+ __block SDLFuelRange* fuelRange = nil;
+ __block NSString* vin = nil;
+ __block NSString* cloudAppVehicleID = nil;
+
+ beforeEach(^{
+ gps = [[SDLGPSData alloc] init];
+ tires = [[SDLTireStatus alloc] init];
+ belt = [[SDLBeltStatus alloc] init];
+ body = [[SDLBodyInformation alloc] init];
+ device = [[SDLDeviceStatus alloc] init];
+ headLamp = [[SDLHeadLampStatus alloc] init];
+ eCall = [[SDLECallInfo alloc] init];
+ airbag = [[SDLAirbagStatus alloc] init];
+ event = [[SDLEmergencyEvent alloc] init];
+ clusterMode = [[SDLClusterModeStatus alloc] init];
+ myKey = [[SDLMyKey alloc] init];
+ fuelRange = [[SDLFuelRange alloc] init];
+ vin = @"6574839201a";
+ cloudAppVehicleID = @"cloudAppVehicleID";
+ });
it(@"Should set and get correctly", ^ {
SDLGetVehicleDataResponse* testResponse = [[SDLGetVehicleDataResponse alloc] init];