diff options
Diffstat (limited to 'SmartDeviceLinkTests/RPCSpecs/ResponseSpecs')
42 files changed, 1513 insertions, 0 deletions
diff --git a/SmartDeviceLinkTests/RPCSpecs/ResponseSpecs/SDLAddCommandResponseSpec.m b/SmartDeviceLinkTests/RPCSpecs/ResponseSpecs/SDLAddCommandResponseSpec.m new file mode 100644 index 000000000..ff1f36682 --- /dev/null +++ b/SmartDeviceLinkTests/RPCSpecs/ResponseSpecs/SDLAddCommandResponseSpec.m @@ -0,0 +1,16 @@ +// +// SDLAddCommandResponseSpec.m +// SmartDeviceLink + + +#import <Foundation/Foundation.h> + +#import <Quick/Quick.h> +#import <Nimble/Nimble.h> + +#import "SDLAddCommandResponse.h" +#import "SDLNames.h" + +QuickSpecBegin(SDLAddCommandResponseSpec) + +QuickSpecEnd diff --git a/SmartDeviceLinkTests/RPCSpecs/ResponseSpecs/SDLAddSubMenuResponseSpec.m b/SmartDeviceLinkTests/RPCSpecs/ResponseSpecs/SDLAddSubMenuResponseSpec.m new file mode 100644 index 000000000..a351d0ee2 --- /dev/null +++ b/SmartDeviceLinkTests/RPCSpecs/ResponseSpecs/SDLAddSubMenuResponseSpec.m @@ -0,0 +1,16 @@ +// +// SDLAddSubMenuResponseSpec.m +// SmartDeviceLink + + +#import <Foundation/Foundation.h> + +#import <Quick/Quick.h> +#import <Nimble/Nimble.h> + +#import "SDLAddSubMenuResponse.h" +#import "SDLNames.h" + +QuickSpecBegin(SDLAddSubMenuResponseSpec) + +QuickSpecEnd
\ No newline at end of file diff --git a/SmartDeviceLinkTests/RPCSpecs/ResponseSpecs/SDLAlertManeuverResponseSpec.m b/SmartDeviceLinkTests/RPCSpecs/ResponseSpecs/SDLAlertManeuverResponseSpec.m new file mode 100644 index 000000000..5b4860134 --- /dev/null +++ b/SmartDeviceLinkTests/RPCSpecs/ResponseSpecs/SDLAlertManeuverResponseSpec.m @@ -0,0 +1,16 @@ +// +// SDLAlertManeuverResponseSpec.m +// SmartDeviceLink + + +#import <Foundation/Foundation.h> + +#import <Quick/Quick.h> +#import <Nimble/Nimble.h> + +#import "SDLAlertManeuverResponse.h" +#import "SDLNames.h" + +QuickSpecBegin(SDLAlertManeuverResponseSpec) + +QuickSpecEnd
\ No newline at end of file diff --git a/SmartDeviceLinkTests/RPCSpecs/ResponseSpecs/SDLAlertResponseSpec.m b/SmartDeviceLinkTests/RPCSpecs/ResponseSpecs/SDLAlertResponseSpec.m new file mode 100644 index 000000000..e29e23ed3 --- /dev/null +++ b/SmartDeviceLinkTests/RPCSpecs/ResponseSpecs/SDLAlertResponseSpec.m @@ -0,0 +1,16 @@ +// +// SDLAlertResponseSpec.m +// SmartDeviceLink + + +#import <Foundation/Foundation.h> + +#import <Quick/Quick.h> +#import <Nimble/Nimble.h> + +#import "SDLAlertResponse.h" +#import "SDLNames.h" + +QuickSpecBegin(SDLAlertResponseSpec) + +QuickSpecEnd
\ No newline at end of file diff --git a/SmartDeviceLinkTests/RPCSpecs/ResponseSpecs/SDLChangeRegistrationResponseSpec.m b/SmartDeviceLinkTests/RPCSpecs/ResponseSpecs/SDLChangeRegistrationResponseSpec.m new file mode 100644 index 000000000..c6e0b27d9 --- /dev/null +++ b/SmartDeviceLinkTests/RPCSpecs/ResponseSpecs/SDLChangeRegistrationResponseSpec.m @@ -0,0 +1,16 @@ +// +// SDLChangeRegistrationResponseSpec.m +// SmartDeviceLink + + +#import <Foundation/Foundation.h> + +#import <Quick/Quick.h> +#import <Nimble/Nimble.h> + +#import "SDLChangeRegistrationResponse.h" +#import "SDLNames.h" + +QuickSpecBegin(SDLChangeRegistrationResponseSpec) + +QuickSpecEnd
\ No newline at end of file diff --git a/SmartDeviceLinkTests/RPCSpecs/ResponseSpecs/SDLCreateInteractionChoiceSetResponseSpec.m b/SmartDeviceLinkTests/RPCSpecs/ResponseSpecs/SDLCreateInteractionChoiceSetResponseSpec.m new file mode 100644 index 000000000..3b3d27e90 --- /dev/null +++ b/SmartDeviceLinkTests/RPCSpecs/ResponseSpecs/SDLCreateInteractionChoiceSetResponseSpec.m @@ -0,0 +1,16 @@ +// +// SDLCreateInteractionChoiceSetResponseSpec.m +// SmartDeviceLink + + +#import <Foundation/Foundation.h> + +#import <Quick/Quick.h> +#import <Nimble/Nimble.h> + +#import "SDLCreateInteractionChoiceSetResponse.h" +#import "SDLNames.h" + +QuickSpecBegin(SDLCreateInteractionChoiceSetResponseSpec) + +QuickSpecEnd
\ No newline at end of file diff --git a/SmartDeviceLinkTests/RPCSpecs/ResponseSpecs/SDLDeleteCommandResponseSpec.m b/SmartDeviceLinkTests/RPCSpecs/ResponseSpecs/SDLDeleteCommandResponseSpec.m new file mode 100644 index 000000000..013702513 --- /dev/null +++ b/SmartDeviceLinkTests/RPCSpecs/ResponseSpecs/SDLDeleteCommandResponseSpec.m @@ -0,0 +1,16 @@ +// +// SDLDeleteCommandResponseSpec.m +// SmartDeviceLink + + +#import <Foundation/Foundation.h> + +#import <Quick/Quick.h> +#import <Nimble/Nimble.h> + +#import "SDLDeleteCommandResponse.h" +#import "SDLNames.h" + +QuickSpecBegin(SDLDeleteCommandResponseSpec) + +QuickSpecEnd
\ No newline at end of file diff --git a/SmartDeviceLinkTests/RPCSpecs/ResponseSpecs/SDLDeleteFileResponseSpec.m b/SmartDeviceLinkTests/RPCSpecs/ResponseSpecs/SDLDeleteFileResponseSpec.m new file mode 100644 index 000000000..64e8522c9 --- /dev/null +++ b/SmartDeviceLinkTests/RPCSpecs/ResponseSpecs/SDLDeleteFileResponseSpec.m @@ -0,0 +1,42 @@ +// +// SDLDeleteFileResponseSpec.m +// SmartDeviceLink + + +#import <Foundation/Foundation.h> + +#import <Quick/Quick.h> +#import <Nimble/Nimble.h> + +#import "SDLDeleteFileResponse.h" +#import "SDLNames.h" + +QuickSpecBegin(SDLDeleteFileResponseSpec) + +describe(@"Getter/Setter Tests", ^ { + it(@"Should set and get correctly", ^ { + SDLDeleteFileResponse* testResponse = [[SDLDeleteFileResponse alloc] init]; + + testResponse.spaceAvailable = @0; + + expect(testResponse.spaceAvailable).to(equal(@0)); + }); + + it(@"Should get correctly when initialized", ^ { + NSMutableDictionary* dict = [@{NAMES_response: + @{NAMES_parameters: + @{NAMES_spaceAvailable:@0}, + NAMES_operation_name:NAMES_DeleteFile}} mutableCopy]; + SDLDeleteFileResponse* testResponse = [[SDLDeleteFileResponse alloc] initWithDictionary:dict]; + + expect(testResponse.spaceAvailable).to(equal(@0)); + }); + + it(@"Should return nil if not set", ^ { + SDLDeleteFileResponse* testResponse = [[SDLDeleteFileResponse alloc] init]; + + expect(testResponse.spaceAvailable).to(beNil()); + }); +}); + +QuickSpecEnd
\ No newline at end of file diff --git a/SmartDeviceLinkTests/RPCSpecs/ResponseSpecs/SDLDeleteInteractionChoiceSetResponseSpec.m b/SmartDeviceLinkTests/RPCSpecs/ResponseSpecs/SDLDeleteInteractionChoiceSetResponseSpec.m new file mode 100644 index 000000000..4f3f0c4c1 --- /dev/null +++ b/SmartDeviceLinkTests/RPCSpecs/ResponseSpecs/SDLDeleteInteractionChoiceSetResponseSpec.m @@ -0,0 +1,16 @@ +// +// SDLDeleteInteractionChoiceSetResponseSpec.m +// SmartDeviceLink + + +#import <Foundation/Foundation.h> + +#import <Quick/Quick.h> +#import <Nimble/Nimble.h> + +#import "SDLDeleteInteractionChoiceSetResponse.h" +#import "SDLNames.h" + +QuickSpecBegin(SDLDeleteInteractionChoiceSetResponseSpec) + +QuickSpecEnd
\ No newline at end of file diff --git a/SmartDeviceLinkTests/RPCSpecs/ResponseSpecs/SDLDeleteSubMenuResponseSpec.m b/SmartDeviceLinkTests/RPCSpecs/ResponseSpecs/SDLDeleteSubMenuResponseSpec.m new file mode 100644 index 000000000..c17b91d1c --- /dev/null +++ b/SmartDeviceLinkTests/RPCSpecs/ResponseSpecs/SDLDeleteSubMenuResponseSpec.m @@ -0,0 +1,16 @@ +// +// SDLDeleteSubMenuResponseSpec.m +// SmartDeviceLink + + +#import <Foundation/Foundation.h> + +#import <Quick/Quick.h> +#import <Nimble/Nimble.h> + +#import "SDLDeleteSubMenuResponse.h" +#import "SDLNames.h" + +QuickSpecBegin(SDLDeleteSubMenuResponseSpec) + +QuickSpecEnd
\ No newline at end of file diff --git a/SmartDeviceLinkTests/RPCSpecs/ResponseSpecs/SDLDiagnosticMessageResponseSpec.m b/SmartDeviceLinkTests/RPCSpecs/ResponseSpecs/SDLDiagnosticMessageResponseSpec.m new file mode 100644 index 000000000..7507bbe5a --- /dev/null +++ b/SmartDeviceLinkTests/RPCSpecs/ResponseSpecs/SDLDiagnosticMessageResponseSpec.m @@ -0,0 +1,42 @@ +// +// SDLDiagnosticMessageResponseSpec.m +// SmartDeviceLink + + +#import <Foundation/Foundation.h> + +#import <Quick/Quick.h> +#import <Nimble/Nimble.h> + +#import "SDLDiagnosticMessageResponse.h" +#import "SDLNames.h" + +QuickSpecBegin(SDLDiagnosticMessageResponseSpec) + +describe(@"Getter/Setter Tests", ^ { + it(@"Should set and get correctly", ^ { + SDLDiagnosticMessageResponse* testResponse = [[SDLDiagnosticMessageResponse alloc] init]; + + testResponse.messageDataResult = [@[@3, @9, @27, @81] mutableCopy]; + + expect(testResponse.messageDataResult).to(equal([@[@3, @9, @27, @81] mutableCopy])); + }); + + it(@"Should get correctly when initialized", ^ { + NSMutableDictionary* dict = [@{NAMES_response: + @{NAMES_parameters: + @{NAMES_messageDataResult:[@[@3, @9, @27, @81] mutableCopy]}, + NAMES_operation_name:NAMES_DiagnosticMessage}} mutableCopy]; + SDLDiagnosticMessageResponse* testResponse = [[SDLDiagnosticMessageResponse alloc] initWithDictionary:dict]; + + expect(testResponse.messageDataResult).to(equal([@[@3, @9, @27, @81] mutableCopy])); + }); + + it(@"Should return nil if not set", ^ { + SDLDiagnosticMessageResponse* testResponse = [[SDLDiagnosticMessageResponse alloc] init]; + + expect(testResponse.messageDataResult).to(beNil()); + }); +}); + +QuickSpecEnd
\ No newline at end of file diff --git a/SmartDeviceLinkTests/RPCSpecs/ResponseSpecs/SDLDialNumberResponseSpec.m b/SmartDeviceLinkTests/RPCSpecs/ResponseSpecs/SDLDialNumberResponseSpec.m new file mode 100644 index 000000000..2adf33aeb --- /dev/null +++ b/SmartDeviceLinkTests/RPCSpecs/ResponseSpecs/SDLDialNumberResponseSpec.m @@ -0,0 +1,10 @@ +// +// SDLDialNumberResponseSpec.m +// SmartDeviceLink-iOS + +#import <Quick/Quick.h> +#import <Nimble/Nimble.h> + +QuickSpecBegin(SDLDialNumberResponseSpec) + +QuickSpecEnd diff --git a/SmartDeviceLinkTests/RPCSpecs/ResponseSpecs/SDLEncodedSyncPDataResponseSpec.m b/SmartDeviceLinkTests/RPCSpecs/ResponseSpecs/SDLEncodedSyncPDataResponseSpec.m new file mode 100644 index 000000000..4324f0bb8 --- /dev/null +++ b/SmartDeviceLinkTests/RPCSpecs/ResponseSpecs/SDLEncodedSyncPDataResponseSpec.m @@ -0,0 +1,16 @@ +// +// SDLEncodedSyncPDataResponseSpec.m +// SmartDeviceLink + + +#import <Foundation/Foundation.h> + +#import <Quick/Quick.h> +#import <Nimble/Nimble.h> + +#import "SDLEncodedSyncPDataResponse.h" +#import "SDLNames.h" + +QuickSpecBegin(SDLEncodedSyncPDataResponseSpec) + +QuickSpecEnd
\ No newline at end of file diff --git a/SmartDeviceLinkTests/RPCSpecs/ResponseSpecs/SDLEndAudioPassThruResponseSpec.m b/SmartDeviceLinkTests/RPCSpecs/ResponseSpecs/SDLEndAudioPassThruResponseSpec.m new file mode 100644 index 000000000..5fcc7d6d8 --- /dev/null +++ b/SmartDeviceLinkTests/RPCSpecs/ResponseSpecs/SDLEndAudioPassThruResponseSpec.m @@ -0,0 +1,16 @@ +// +// SDLEndAudioPassThruResponseSpec.m +// SmartDeviceLink + + +#import <Foundation/Foundation.h> + +#import <Quick/Quick.h> +#import <Nimble/Nimble.h> + +#import "SDLEndAudioPassThruResponse.h" +#import "SDLNames.h" + +QuickSpecBegin(SDLEndAudioPassThruResponseSpec) + +QuickSpecEnd
\ No newline at end of file diff --git a/SmartDeviceLinkTests/RPCSpecs/ResponseSpecs/SDLGenericResponseSpec.m b/SmartDeviceLinkTests/RPCSpecs/ResponseSpecs/SDLGenericResponseSpec.m new file mode 100644 index 000000000..227aea92d --- /dev/null +++ b/SmartDeviceLinkTests/RPCSpecs/ResponseSpecs/SDLGenericResponseSpec.m @@ -0,0 +1,16 @@ +// +// SDLGenericResponseSpec.m +// SmartDeviceLink + + +#import <Foundation/Foundation.h> + +#import <Quick/Quick.h> +#import <Nimble/Nimble.h> + +#import "SDLGenericResponse.h" +#import "SDLNames.h" + +QuickSpecBegin(SDLGenericResponseSpec) + +QuickSpecEnd
\ No newline at end of file diff --git a/SmartDeviceLinkTests/RPCSpecs/ResponseSpecs/SDLGetDTCsResponseSpec.m b/SmartDeviceLinkTests/RPCSpecs/ResponseSpecs/SDLGetDTCsResponseSpec.m new file mode 100644 index 000000000..150f9bd73 --- /dev/null +++ b/SmartDeviceLinkTests/RPCSpecs/ResponseSpecs/SDLGetDTCsResponseSpec.m @@ -0,0 +1,47 @@ +// +// SDLGetDTCsResponseSpec.m +// SmartDeviceLink + + +#import <Foundation/Foundation.h> + +#import <Quick/Quick.h> +#import <Nimble/Nimble.h> + +#import "SDLGetDTCsResponse.h" +#import "SDLNames.h" + +QuickSpecBegin(SDLGetDTCsResponseSpec) + +describe(@"Getter/Setter Tests", ^ { + it(@"Should set and get correctly", ^ { + SDLGetDTCsResponse* testResponse = [[SDLGetDTCsResponse alloc] init]; + + testResponse.ecuHeader = @404; + testResponse.dtc = [@[@"FFFF", @"FFFE", @"FFFD"] mutableCopy]; + + expect(testResponse.ecuHeader).to(equal(@404)); + expect(testResponse.dtc).to(equal([@[@"FFFF", @"FFFE", @"FFFD"] mutableCopy])); + }); + + it(@"Should get correctly when initialized", ^ { + NSMutableDictionary* dict = [@{NAMES_response: + @{NAMES_parameters: + @{NAMES_ecuHeader:@404, + NAMES_dtc:[@[@"FFFF", @"FFFE", @"FFFD"] mutableCopy]}, + NAMES_operation_name:NAMES_GetDTCs}} mutableCopy]; + SDLGetDTCsResponse* testResponse = [[SDLGetDTCsResponse alloc] initWithDictionary:dict]; + + expect(testResponse.ecuHeader).to(equal(@404)); + expect(testResponse.dtc).to(equal([@[@"FFFF", @"FFFE", @"FFFD"] mutableCopy])); + }); + + it(@"Should return nil if not set", ^ { + SDLGetDTCsResponse* testResponse = [[SDLGetDTCsResponse alloc] init]; + + expect(testResponse.ecuHeader).to(beNil()); + expect(testResponse.dtc).to(beNil()); + }); +}); + +QuickSpecEnd
\ No newline at end of file diff --git a/SmartDeviceLinkTests/RPCSpecs/ResponseSpecs/SDLGetVehicleDataResponseSpec.m b/SmartDeviceLinkTests/RPCSpecs/ResponseSpecs/SDLGetVehicleDataResponseSpec.m new file mode 100644 index 000000000..d70e8f12b --- /dev/null +++ b/SmartDeviceLinkTests/RPCSpecs/ResponseSpecs/SDLGetVehicleDataResponseSpec.m @@ -0,0 +1,175 @@ +// +// SDLGetVehicleDataResponseSpec.m +// SmartDeviceLink + + +#import <Foundation/Foundation.h> + +#import <Quick/Quick.h> +#import <Nimble/Nimble.h> + +#import "SmartDeviceLink.h" +#import "SDLNames.h" + + +QuickSpecBegin(SDLGetVehicleDataResponseSpec) + +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]; + +describe(@"Getter/Setter Tests", ^ { + it(@"Should set and get correctly", ^ { + SDLGetVehicleDataResponse* testResponse = [[SDLGetVehicleDataResponse alloc] init]; + + testResponse.gps = gps; + testResponse.speed = @100; + testResponse.rpm = @3; + testResponse.fuelLevel = @99.9999; + testResponse.fuelLevel_State = [SDLComponentVolumeStatus FAULT]; + testResponse.instantFuelConsumption = @40.7; + testResponse.externalTemperature = @0; + testResponse.vin = @"6574839201"; + testResponse.prndl = [SDLPRNDL PARK]; + testResponse.tirePressure = tires; + testResponse.odometer = @70000; + testResponse.beltStatus = belt; + testResponse.bodyInformation = body; + testResponse.deviceStatus = device; + testResponse.driverBraking = [SDLVehicleDataEventStatus NO_EVENT]; + testResponse.wiperStatus = [SDLWiperStatus AUTO_HIGH]; + testResponse.headLampStatus = headLamp; + testResponse.engineTorque = @630.4; + testResponse.accPedalPosition = @0; + testResponse.steeringWheelAngle = @-1500; + testResponse.eCallInfo = eCall; + testResponse.airbagStatus = airbag; + testResponse.emergencyEvent = event; + testResponse.clusterModeStatus = clusterMode; + testResponse.myKey = myKey; + + expect(testResponse.gps).to(equal(gps)); + expect(testResponse.speed).to(equal(@100)); + expect(testResponse.rpm).to(equal(@3)); + expect(testResponse.fuelLevel).to(equal(@99.9999)); + expect(testResponse.fuelLevel_State).to(equal([SDLComponentVolumeStatus FAULT])); + expect(testResponse.instantFuelConsumption).to(equal(@40.7)); + expect(testResponse.externalTemperature).to(equal(@0)); + expect(testResponse.vin).to(equal(@"6574839201")); + expect(testResponse.prndl).to(equal([SDLPRNDL PARK])); + expect(testResponse.tirePressure).to(equal(tires)); + expect(testResponse.odometer).to(equal(@70000)); + expect(testResponse.beltStatus).to(equal(belt)); + expect(testResponse.bodyInformation).to(equal(body)); + expect(testResponse.deviceStatus).to(equal(device)); + expect(testResponse.driverBraking).to(equal([SDLVehicleDataEventStatus NO_EVENT])); + expect(testResponse.wiperStatus).to(equal([SDLWiperStatus AUTO_HIGH])); + expect(testResponse.headLampStatus).to(equal(headLamp)); + expect(testResponse.engineTorque).to(equal(@630.4)); + expect(testResponse.accPedalPosition).to(equal(@0)); + expect(testResponse.steeringWheelAngle).to(equal(@-1500)); + expect(testResponse.eCallInfo).to(equal(eCall)); + expect(testResponse.airbagStatus).to(equal(airbag)); + expect(testResponse.emergencyEvent).to(equal(event)); + expect(testResponse.clusterModeStatus).to(equal(clusterMode)); + expect(testResponse.myKey).to(equal(myKey)); + }); + + it(@"Should get correctly when initialized", ^ { + NSMutableDictionary* dict = [@{NAMES_notification: + @{NAMES_parameters: + @{NAMES_gps:gps, + NAMES_speed:@100, + NAMES_rpm:@3, + NAMES_fuelLevel:@99.9999, + NAMES_fuelLevel_State:[SDLComponentVolumeStatus FAULT], + NAMES_instantFuelConsumption:@40.7, + NAMES_externalTemperature:@0, + NAMES_vin:@"6574839201", + NAMES_prndl:[SDLPRNDL PARK], + NAMES_tirePressure:tires, + NAMES_odometer:@70000, + NAMES_beltStatus:belt, + NAMES_bodyInformation:body, + NAMES_deviceStatus:device, + NAMES_driverBraking:[SDLVehicleDataEventStatus NO_EVENT], + NAMES_wiperStatus:[SDLWiperStatus AUTO_HIGH], + NAMES_headLampStatus:headLamp, + NAMES_engineTorque:@630.4, + NAMES_accPedalPosition:@0, + NAMES_steeringWheelAngle:@-1500, + NAMES_eCallInfo:eCall, + NAMES_airbagStatus:airbag, + NAMES_emergencyEvent:event, + NAMES_clusterModeStatus:clusterMode, + NAMES_myKey:myKey}, + NAMES_operation_name:NAMES_GetVehicleData}} mutableCopy]; + SDLGetVehicleDataResponse* testResponse = [[SDLGetVehicleDataResponse alloc] initWithDictionary:dict]; + + expect(testResponse.gps).to(equal(gps)); + expect(testResponse.speed).to(equal(@100)); + expect(testResponse.rpm).to(equal(@3)); + expect(testResponse.fuelLevel).to(equal(@99.9999)); + expect(testResponse.fuelLevel_State).to(equal([SDLComponentVolumeStatus FAULT])); + expect(testResponse.instantFuelConsumption).to(equal(@40.7)); + expect(testResponse.externalTemperature).to(equal(@0)); + expect(testResponse.vin).to(equal(@"6574839201")); + expect(testResponse.prndl).to(equal([SDLPRNDL PARK])); + expect(testResponse.tirePressure).to(equal(tires)); + expect(testResponse.odometer).to(equal(@70000)); + expect(testResponse.beltStatus).to(equal(belt)); + expect(testResponse.bodyInformation).to(equal(body)); + expect(testResponse.deviceStatus).to(equal(device)); + expect(testResponse.driverBraking).to(equal([SDLVehicleDataEventStatus NO_EVENT])); + expect(testResponse.wiperStatus).to(equal([SDLWiperStatus AUTO_HIGH])); + expect(testResponse.headLampStatus).to(equal(headLamp)); + expect(testResponse.engineTorque).to(equal(@630.4)); + expect(testResponse.accPedalPosition).to(equal(@0)); + expect(testResponse.steeringWheelAngle).to(equal(@-1500)); + expect(testResponse.eCallInfo).to(equal(eCall)); + expect(testResponse.airbagStatus).to(equal(airbag)); + expect(testResponse.emergencyEvent).to(equal(event)); + expect(testResponse.clusterModeStatus).to(equal(clusterMode)); + expect(testResponse.myKey).to(equal(myKey)); + }); + + it(@"Should return nil if not set", ^ { + SDLGetVehicleDataResponse* testResponse = [[SDLGetVehicleDataResponse alloc] init]; + + expect(testResponse.gps).to(beNil()); + expect(testResponse.speed).to(beNil()); + expect(testResponse.rpm).to(beNil()); + expect(testResponse.fuelLevel).to(beNil()); + expect(testResponse.fuelLevel_State).to(beNil()); + expect(testResponse.instantFuelConsumption).to(beNil()); + expect(testResponse.externalTemperature).to(beNil()); + expect(testResponse.vin).to(beNil()); + expect(testResponse.prndl).to(beNil()); + expect(testResponse.tirePressure).to(beNil()); + expect(testResponse.odometer).to(beNil()); + expect(testResponse.beltStatus).to(beNil()); + expect(testResponse.bodyInformation).to(beNil()); + expect(testResponse.deviceStatus).to(beNil()); + expect(testResponse.driverBraking).to(beNil()); + expect(testResponse.wiperStatus).to(beNil()); + expect(testResponse.headLampStatus).to(beNil()); + expect(testResponse.engineTorque).to(beNil()); + expect(testResponse.accPedalPosition).to(beNil()); + expect(testResponse.steeringWheelAngle).to(beNil()); + expect(testResponse.eCallInfo).to(beNil()); + expect(testResponse.airbagStatus).to(beNil()); + expect(testResponse.emergencyEvent).to(beNil()); + expect(testResponse.clusterModeStatus).to(beNil()); + expect(testResponse.myKey).to(beNil()); + }); +}); + +QuickSpecEnd
\ No newline at end of file diff --git a/SmartDeviceLinkTests/RPCSpecs/ResponseSpecs/SDLListFilesResponseSpec.m b/SmartDeviceLinkTests/RPCSpecs/ResponseSpecs/SDLListFilesResponseSpec.m new file mode 100644 index 000000000..824bc7517 --- /dev/null +++ b/SmartDeviceLinkTests/RPCSpecs/ResponseSpecs/SDLListFilesResponseSpec.m @@ -0,0 +1,47 @@ +// +// SDLListFilesResponseSpec.m +// SmartDeviceLink + + +#import <Foundation/Foundation.h> + +#import <Quick/Quick.h> +#import <Nimble/Nimble.h> + +#import "SDLListFilesResponse.h" +#import "SDLNames.h" + +QuickSpecBegin(SDLListFilesResponseSpec) + +describe(@"Getter/Setter Tests", ^ { + it(@"Should set and get correctly", ^ { + SDLListFilesResponse* testResponse = [[SDLListFilesResponse alloc] init]; + + testResponse.filenames = [@[@"Music/music.mp3", @"Documents/document.txt", @"Downloads/format.exe"] mutableCopy]; + testResponse.spaceAvailable = @500000000; + + expect(testResponse.filenames).to(equal([@[@"Music/music.mp3", @"Documents/document.txt", @"Downloads/format.exe"] mutableCopy])); + expect(testResponse.spaceAvailable).to(equal(@500000000)); + }); + + it(@"Should get correctly when initialized", ^ { + NSMutableDictionary* dict = [@{NAMES_response: + @{NAMES_parameters: + @{NAMES_filenames:[@[@"Music/music.mp3", @"Documents/document.txt", @"Downloads/format.exe"] mutableCopy], + NAMES_spaceAvailable:@500000000}, + NAMES_operation_name:NAMES_ListFiles}} mutableCopy]; + SDLListFilesResponse* testResponse = [[SDLListFilesResponse alloc] initWithDictionary:dict]; + + expect(testResponse.filenames).to(equal([@[@"Music/music.mp3", @"Documents/document.txt", @"Downloads/format.exe"] mutableCopy])); + expect(testResponse.spaceAvailable).to(equal(@500000000)); + }); + + it(@"Should return nil if not set", ^ { + SDLListFilesResponse* testResponse = [[SDLListFilesResponse alloc] init]; + + expect(testResponse.filenames).to(beNil()); + expect(testResponse.spaceAvailable).to(beNil()); + }); +}); + +QuickSpecEnd
\ No newline at end of file diff --git a/SmartDeviceLinkTests/RPCSpecs/ResponseSpecs/SDLPerformAudioPassThruResponseSpec.m b/SmartDeviceLinkTests/RPCSpecs/ResponseSpecs/SDLPerformAudioPassThruResponseSpec.m new file mode 100644 index 000000000..eb661c3f2 --- /dev/null +++ b/SmartDeviceLinkTests/RPCSpecs/ResponseSpecs/SDLPerformAudioPassThruResponseSpec.m @@ -0,0 +1,16 @@ +// +// SDLPerformAudioPassThruResponseSpec.m +// SmartDeviceLink + + +#import <Foundation/Foundation.h> + +#import <Quick/Quick.h> +#import <Nimble/Nimble.h> + +#import "SDLPerformAudioPassThruResponse.h" +#import "SDLNames.h" + +QuickSpecBegin(SDLPerformAudioPassThruResponseSpec) + +QuickSpecEnd
\ No newline at end of file diff --git a/SmartDeviceLinkTests/RPCSpecs/ResponseSpecs/SDLPerformInteractionResponseSpec.m b/SmartDeviceLinkTests/RPCSpecs/ResponseSpecs/SDLPerformInteractionResponseSpec.m new file mode 100644 index 000000000..b32b44cd6 --- /dev/null +++ b/SmartDeviceLinkTests/RPCSpecs/ResponseSpecs/SDLPerformInteractionResponseSpec.m @@ -0,0 +1,54 @@ +// +// SDLPerformInteractionResponseSpec.m +// SmartDeviceLink + + +#import <Foundation/Foundation.h> + +#import <Quick/Quick.h> +#import <Nimble/Nimble.h> + +#import "SDLPerformInteractionResponse.h" +#import "SDLNames.h" +#import "SDLTriggerSource.h" + + +QuickSpecBegin(SDLPerformInteractionResponseSpec) + +describe(@"Getter/Setter Tests", ^ { + it(@"Should set and get correctly", ^ { + SDLPerformInteractionResponse* testResponse = [[SDLPerformInteractionResponse alloc] init]; + + testResponse.choiceID = @25; + testResponse.manualTextEntry = @"entry"; + testResponse.triggerSource = [SDLTriggerSource KEYBOARD]; + + expect(testResponse.choiceID).to(equal(@25)); + expect(testResponse.manualTextEntry).to(equal(@"entry")); + expect(testResponse.triggerSource).to(equal([SDLTriggerSource KEYBOARD])); + }); + + it(@"Should get correctly when initialized", ^ { + NSMutableDictionary* dict = [@{NAMES_response: + @{NAMES_parameters: + @{NAMES_choiceID:@25, + NAMES_manualTextEntry:@"entry", + NAMES_triggerSource:[SDLTriggerSource KEYBOARD]}, + NAMES_operation_name:NAMES_PerformInteraction}} mutableCopy]; + SDLPerformInteractionResponse* testResponse = [[SDLPerformInteractionResponse alloc] initWithDictionary:dict]; + + expect(testResponse.choiceID).to(equal(@25)); + expect(testResponse.manualTextEntry).to(equal(@"entry")); + expect(testResponse.triggerSource).to(equal([SDLTriggerSource KEYBOARD])); + }); + + it(@"Should return nil if not set", ^ { + SDLPerformInteractionResponse* testResponse = [[SDLPerformInteractionResponse alloc] init]; + + expect(testResponse.choiceID).to(beNil()); + expect(testResponse.manualTextEntry).to(beNil()); + expect(testResponse.triggerSource).to(beNil()); + }); +}); + +QuickSpecEnd
\ No newline at end of file diff --git a/SmartDeviceLinkTests/RPCSpecs/ResponseSpecs/SDLPutFileResponseSpec.m b/SmartDeviceLinkTests/RPCSpecs/ResponseSpecs/SDLPutFileResponseSpec.m new file mode 100644 index 000000000..565f97a79 --- /dev/null +++ b/SmartDeviceLinkTests/RPCSpecs/ResponseSpecs/SDLPutFileResponseSpec.m @@ -0,0 +1,42 @@ +// +// SDLPutFileResponseSpec.m +// SmartDeviceLink + + +#import <Foundation/Foundation.h> + +#import <Quick/Quick.h> +#import <Nimble/Nimble.h> + +#import "SDLPutFileResponse.h" +#import "SDLNames.h" + +QuickSpecBegin(SDLPutFileResponseSpec) + +describe(@"Getter/Setter Tests", ^ { + it(@"Should set and get correctly", ^ { + SDLPutFileResponse* testResponse = [[SDLPutFileResponse alloc] init]; + + testResponse.spaceAvailable = @1248; + + expect(testResponse.spaceAvailable).to(equal(@1248)); + }); + + it(@"Should get correctly when initialized", ^ { + NSMutableDictionary* dict = [@{NAMES_response: + @{NAMES_parameters: + @{NAMES_spaceAvailable:@1248}, + NAMES_operation_name:NAMES_PutFile}} mutableCopy]; + SDLPutFileResponse* testResponse = [[SDLPutFileResponse alloc] initWithDictionary:dict]; + + expect(testResponse.spaceAvailable).to(equal(@1248)); + }); + + it(@"Should return nil if not set", ^ { + SDLPutFileResponse* testResponse = [[SDLPutFileResponse alloc] init]; + + expect(testResponse.spaceAvailable).to(beNil()); + }); +}); + +QuickSpecEnd
\ No newline at end of file diff --git a/SmartDeviceLinkTests/RPCSpecs/ResponseSpecs/SDLReadDIDResponseSpec.m b/SmartDeviceLinkTests/RPCSpecs/ResponseSpecs/SDLReadDIDResponseSpec.m new file mode 100644 index 000000000..0ae2c5b9d --- /dev/null +++ b/SmartDeviceLinkTests/RPCSpecs/ResponseSpecs/SDLReadDIDResponseSpec.m @@ -0,0 +1,45 @@ +// +// SDLReadDIDResponseSpec.m +// SmartDeviceLink + + +#import <Foundation/Foundation.h> + +#import <Quick/Quick.h> +#import <Nimble/Nimble.h> + +#import "SDLReadDIDResponse.h" +#import "SDLDIDResult.h" +#import "SDLNames.h" + +QuickSpecBegin(SDLReadDIDResponseSpec) + +SDLDIDResult* result = [[SDLDIDResult alloc] init]; + +describe(@"Getter/Setter Tests", ^ { + it(@"Should set and get correctly", ^ { + SDLReadDIDResponse* testResponse = [[SDLReadDIDResponse alloc] init]; + + testResponse.didResult = [@[result] mutableCopy]; + + expect(testResponse.didResult).to(equal([@[result] mutableCopy])); + }); + + it(@"Should get correctly when initialized", ^ { + NSMutableDictionary* dict = [@{NAMES_response: + @{NAMES_parameters: + @{NAMES_didResult:[@[result] mutableCopy]}, + NAMES_operation_name:NAMES_ReadDID}} mutableCopy]; + SDLReadDIDResponse* testResponse = [[SDLReadDIDResponse alloc] initWithDictionary:dict]; + + expect(testResponse.didResult).to(equal([@[result] mutableCopy])); + }); + + it(@"Should return nil if not set", ^ { + SDLReadDIDResponse* testResponse = [[SDLReadDIDResponse alloc] init]; + + expect(testResponse.didResult).to(beNil()); + }); +}); + +QuickSpecEnd
\ No newline at end of file diff --git a/SmartDeviceLinkTests/RPCSpecs/ResponseSpecs/SDLRegisterAppInterfaceResponseSpec.m b/SmartDeviceLinkTests/RPCSpecs/ResponseSpecs/SDLRegisterAppInterfaceResponseSpec.m new file mode 100644 index 000000000..62eb9b152 --- /dev/null +++ b/SmartDeviceLinkTests/RPCSpecs/ResponseSpecs/SDLRegisterAppInterfaceResponseSpec.m @@ -0,0 +1,133 @@ +// +// SDLRegisterAppInterfaceResponseSpec.m +// SmartDeviceLink + + +#import <Foundation/Foundation.h> + +#import <Quick/Quick.h> +#import <Nimble/Nimble.h> + +#import "SmartDeviceLink.h" +#import "SDLNames.h" + + +QuickSpecBegin(SDLRegisterAppInterfaceResponseSpec) + +SDLSyncMsgVersion* version = [[SDLSyncMsgVersion alloc] init]; +SDLDisplayCapabilities* info = [[SDLDisplayCapabilities alloc] init]; +SDLButtonCapabilities* button = [[SDLButtonCapabilities alloc] init]; +SDLSoftButtonCapabilities* softButton = [[SDLSoftButtonCapabilities alloc] init]; +SDLPresetBankCapabilities* presetBank = [[SDLPresetBankCapabilities alloc] init]; +SDLAudioPassThruCapabilities* audioPassThru = [[SDLAudioPassThruCapabilities alloc] init]; +SDLVehicleType* vehicle = [[SDLVehicleType alloc] init]; +SDLHMICapabilities *hmiCapabilities = [[SDLHMICapabilities alloc] init]; + +describe(@"Getter/Setter Tests", ^ { + it(@"Should set and get correctly", ^ { + SDLRegisterAppInterfaceResponse* testResponse = [[SDLRegisterAppInterfaceResponse alloc] init]; + + testResponse.syncMsgVersion = version; + testResponse.language = [SDLLanguage ES_MX]; + testResponse.hmiDisplayLanguage = [SDLLanguage RU_RU]; + testResponse.displayCapabilities = info; + testResponse.buttonCapabilities = [@[button] mutableCopy]; + testResponse.softButtonCapabilities = [@[softButton] mutableCopy]; + testResponse.presetBankCapabilities = presetBank; + testResponse.hmiZoneCapabilities = [@[[SDLHMIZoneCapabilities BACK], [SDLHMIZoneCapabilities FRONT]] copy]; + testResponse.speechCapabilities = [@[[SDLSpeechCapabilities SAPI_PHONEMES], [SDLSpeechCapabilities SILENCE]] copy]; + testResponse.vrCapabilities = [@[[SDLVRCapabilities TEXT]] copy]; + testResponse.audioPassThruCapabilities = [@[audioPassThru] mutableCopy]; + testResponse.vehicleType = vehicle; + testResponse.prerecordedSpeech = [@[[SDLPrerecordedSpeech LISTEN_JINGLE], [SDLPrerecordedSpeech HELP_JINGLE]] copy]; + testResponse.supportedDiagModes = [@[@67, @99, @111] mutableCopy]; + testResponse.hmiCapabilities = hmiCapabilities; + testResponse.sdlVersion = @"sdlVersion"; + testResponse.systemSoftwareVersion = @"systemSoftwareVersion"; + + expect(testResponse.syncMsgVersion).to(equal(version)); + expect(testResponse.language).to(equal([SDLLanguage ES_MX])); + expect(testResponse.hmiDisplayLanguage).to(equal([SDLLanguage RU_RU])); + expect(testResponse.displayCapabilities).to(equal(info)); + expect(testResponse.buttonCapabilities).to(equal([@[button] mutableCopy])); + expect(testResponse.softButtonCapabilities).to(equal([@[softButton] mutableCopy])); + expect(testResponse.presetBankCapabilities).to(equal(presetBank)); + expect(testResponse.hmiZoneCapabilities).to(equal([@[[SDLHMIZoneCapabilities BACK], [SDLHMIZoneCapabilities FRONT]] copy])); + expect(testResponse.speechCapabilities).to(equal([@[[SDLSpeechCapabilities SAPI_PHONEMES], [SDLSpeechCapabilities SILENCE]] copy])); + expect(testResponse.vrCapabilities).to(equal([@[[SDLVRCapabilities TEXT]] copy])); + expect(testResponse.audioPassThruCapabilities).to(equal([@[audioPassThru] mutableCopy])); + expect(testResponse.vehicleType).to(equal(vehicle)); + expect(testResponse.prerecordedSpeech).to(equal([@[[SDLPrerecordedSpeech LISTEN_JINGLE], [SDLPrerecordedSpeech HELP_JINGLE]] copy])); + expect(testResponse.supportedDiagModes).to(equal([@[@67, @99, @111] mutableCopy])); + expect(testResponse.hmiCapabilities).to(equal(hmiCapabilities)); + expect(testResponse.sdlVersion).to(equal(@"sdlVersion")); + expect(testResponse.systemSoftwareVersion).to(equal(@"systemSoftwareVersion")); + }); + + it(@"Should get correctly when initialized", ^ { + NSMutableDictionary* dict = [@{NAMES_request: + @{NAMES_parameters: + @{NAMES_syncMsgVersion:version, + NAMES_language:[SDLLanguage ES_MX], + NAMES_hmiDisplayLanguage:[SDLLanguage RU_RU], + NAMES_displayCapabilities:info, + NAMES_buttonCapabilities:[@[button] mutableCopy], + NAMES_softButtonCapabilities:[@[softButton] mutableCopy], + NAMES_presetBankCapabilities:presetBank, + NAMES_hmiZoneCapabilities:[@[[SDLHMIZoneCapabilities BACK], [SDLHMIZoneCapabilities FRONT]] copy], + NAMES_speechCapabilities:[@[[SDLSpeechCapabilities SAPI_PHONEMES], [SDLSpeechCapabilities SILENCE]] copy], + NAMES_vrCapabilities:[@[[SDLVRCapabilities TEXT]] copy], + NAMES_audioPassThruCapabilities:[@[audioPassThru] mutableCopy], + NAMES_vehicleType:vehicle, + NAMES_prerecordedSpeech:[@[[SDLPrerecordedSpeech LISTEN_JINGLE], [SDLPrerecordedSpeech HELP_JINGLE]] mutableCopy], + NAMES_supportedDiagModes:[@[@67, @99, @111] mutableCopy], + NAMES_hmiCapabilities: hmiCapabilities, + NAMES_sdlVersion: @"sdlVersion", + NAMES_systemSoftwareVersion: @"systemSoftwareVersion" + }, + NAMES_operation_name:NAMES_RegisterAppInterface}} mutableCopy]; + SDLRegisterAppInterfaceResponse* testResponse = [[SDLRegisterAppInterfaceResponse alloc] initWithDictionary:dict]; + + expect(testResponse.syncMsgVersion).to(equal(version)); + expect(testResponse.language).to(equal([SDLLanguage ES_MX])); + expect(testResponse.hmiDisplayLanguage).to(equal([SDLLanguage RU_RU])); + expect(testResponse.displayCapabilities).to(equal(info)); + expect(testResponse.buttonCapabilities).to(equal([@[button] mutableCopy])); + expect(testResponse.softButtonCapabilities).to(equal([@[softButton] mutableCopy])); + expect(testResponse.presetBankCapabilities).to(equal(presetBank)); + expect(testResponse.hmiZoneCapabilities).to(equal([@[[SDLHMIZoneCapabilities BACK], [SDLHMIZoneCapabilities FRONT]] copy])); + expect(testResponse.speechCapabilities).to(equal([@[[SDLSpeechCapabilities SAPI_PHONEMES], [SDLSpeechCapabilities SILENCE]] copy])); + expect(testResponse.vrCapabilities).to(equal([@[[SDLVRCapabilities TEXT]] copy])); + expect(testResponse.audioPassThruCapabilities).to(equal([@[audioPassThru] mutableCopy])); + expect(testResponse.vehicleType).to(equal(vehicle)); + expect(testResponse.prerecordedSpeech).to(equal([@[[SDLPrerecordedSpeech LISTEN_JINGLE], [SDLPrerecordedSpeech HELP_JINGLE]] copy])); + expect(testResponse.supportedDiagModes).to(equal([@[@67, @99, @111] mutableCopy])); + expect(testResponse.hmiCapabilities).to(equal(hmiCapabilities)); + expect(testResponse.sdlVersion).to(equal(@"sdlVersion")); + expect(testResponse.systemSoftwareVersion).to(equal(@"systemSoftwareVersion")); + }); + + it(@"Should return nil if not set", ^ { + SDLRegisterAppInterfaceResponse* testResponse = [[SDLRegisterAppInterfaceResponse alloc] init]; + + expect(testResponse.syncMsgVersion).to(beNil()); + expect(testResponse.language).to(beNil()); + expect(testResponse.hmiDisplayLanguage).to(beNil()); + expect(testResponse.displayCapabilities).to(beNil()); + expect(testResponse.buttonCapabilities).to(beNil()); + expect(testResponse.softButtonCapabilities).to(beNil()); + expect(testResponse.presetBankCapabilities).to(beNil()); + expect(testResponse.hmiZoneCapabilities).to(beNil()); + expect(testResponse.speechCapabilities).to(beNil()); + expect(testResponse.vrCapabilities).to(beNil()); + expect(testResponse.audioPassThruCapabilities).to(beNil()); + expect(testResponse.vehicleType).to(beNil()); + expect(testResponse.prerecordedSpeech).to(beNil()); + expect(testResponse.supportedDiagModes).to(beNil()); + expect(testResponse.hmiCapabilities).to(beNil()); + expect(testResponse.sdlVersion).to(beNil()); + expect(testResponse.systemSoftwareVersion).to(beNil()); + }); +}); + +QuickSpecEnd diff --git a/SmartDeviceLinkTests/RPCSpecs/ResponseSpecs/SDLResetGlobalPropertiesResponseSpec.m b/SmartDeviceLinkTests/RPCSpecs/ResponseSpecs/SDLResetGlobalPropertiesResponseSpec.m new file mode 100644 index 000000000..fb9b4a2ed --- /dev/null +++ b/SmartDeviceLinkTests/RPCSpecs/ResponseSpecs/SDLResetGlobalPropertiesResponseSpec.m @@ -0,0 +1,16 @@ +// +// SDLResetGlobalPropertiesResponseSpec.m +// SmartDeviceLink + + +#import <Foundation/Foundation.h> + +#import <Quick/Quick.h> +#import <Nimble/Nimble.h> + +#import "SDLResetGlobalPropertiesResponse.h" +#import "SDLNames.h" + +QuickSpecBegin(SDLResetGlobalPropertiesResponseSpec) + +QuickSpecEnd
\ No newline at end of file diff --git a/SmartDeviceLinkTests/RPCSpecs/ResponseSpecs/SDLScrollableMessageResponseSpec.m b/SmartDeviceLinkTests/RPCSpecs/ResponseSpecs/SDLScrollableMessageResponseSpec.m new file mode 100644 index 000000000..5cebb0229 --- /dev/null +++ b/SmartDeviceLinkTests/RPCSpecs/ResponseSpecs/SDLScrollableMessageResponseSpec.m @@ -0,0 +1,16 @@ +// +// SDLScrollableMessageResponseSpec.m +// SmartDeviceLink + + +#import <Foundation/Foundation.h> + +#import <Quick/Quick.h> +#import <Nimble/Nimble.h> + +#import "SDLScrollableMessageResponse.h" +#import "SDLNames.h" + +QuickSpecBegin(SDLScrollableMessageResponseSpec) + +QuickSpecEnd
\ No newline at end of file diff --git a/SmartDeviceLinkTests/RPCSpecs/ResponseSpecs/SDLSendLocationResponseSpec.m b/SmartDeviceLinkTests/RPCSpecs/ResponseSpecs/SDLSendLocationResponseSpec.m new file mode 100644 index 000000000..83d1ee55a --- /dev/null +++ b/SmartDeviceLinkTests/RPCSpecs/ResponseSpecs/SDLSendLocationResponseSpec.m @@ -0,0 +1,12 @@ +// +// SDLSendLocationResponseSpec.m +// SmartDeviceLink-iOS + +#import <Quick/Quick.h> +#import <Nimble/Nimble.h> + +QuickSpecBegin(SDLSendLocationResponseSpec) + + + +QuickSpecEnd diff --git a/SmartDeviceLinkTests/RPCSpecs/ResponseSpecs/SDLSetAppIconResponseSpec.m b/SmartDeviceLinkTests/RPCSpecs/ResponseSpecs/SDLSetAppIconResponseSpec.m new file mode 100644 index 000000000..44593a080 --- /dev/null +++ b/SmartDeviceLinkTests/RPCSpecs/ResponseSpecs/SDLSetAppIconResponseSpec.m @@ -0,0 +1,16 @@ +// +// SDLSetAppIconResponseSpec.m +// SmartDeviceLink + + +#import <Foundation/Foundation.h> + +#import <Quick/Quick.h> +#import <Nimble/Nimble.h> + +#import "SDLSetAppIconResponse.h" +#import "SDLNames.h" + +QuickSpecBegin(SDLSetAppIconResponseSpec) + +QuickSpecEnd diff --git a/SmartDeviceLinkTests/RPCSpecs/ResponseSpecs/SDLSetDisplayLayoutResponseSpec.m b/SmartDeviceLinkTests/RPCSpecs/ResponseSpecs/SDLSetDisplayLayoutResponseSpec.m new file mode 100644 index 000000000..3eeab76a1 --- /dev/null +++ b/SmartDeviceLinkTests/RPCSpecs/ResponseSpecs/SDLSetDisplayLayoutResponseSpec.m @@ -0,0 +1,67 @@ +// +// SDLSetDisplayLayoutResponseSpec.m +// SmartDeviceLink + + +#import <Foundation/Foundation.h> + +#import <Quick/Quick.h> +#import <Nimble/Nimble.h> + +#import "SDLButtonCapabilities.h" +#import "SDLDisplayCapabilities.h" +#import "SDLNames.h" +#import "SDLPresetBankCapabilities.h" +#import "SDLSetDisplayLayoutResponse.h" +#import "SDLSoftButtonCapabilities.h" + + +QuickSpecBegin(SDLSetDisplayLayoutResponseSpec) + +SDLDisplayCapabilities* info = [[SDLDisplayCapabilities alloc] init]; +SDLButtonCapabilities* button = [[SDLButtonCapabilities alloc] init]; +SDLSoftButtonCapabilities* softButton = [[SDLSoftButtonCapabilities alloc] init]; +SDLPresetBankCapabilities* presetBank = [[SDLPresetBankCapabilities alloc] init]; + +describe(@"Getter/Setter Tests", ^ { + it(@"Should set and get correctly", ^ { + SDLSetDisplayLayoutResponse* testResponse = [[SDLSetDisplayLayoutResponse alloc] init]; + + testResponse.displayCapabilities = info; + testResponse.buttonCapabilities = [@[button] mutableCopy]; + testResponse.softButtonCapabilities = [@[softButton] mutableCopy]; + testResponse.presetBankCapabilities = presetBank; + + expect(testResponse.displayCapabilities).to(equal(info)); + expect(testResponse.buttonCapabilities).to(equal([@[button] mutableCopy])); + expect(testResponse.softButtonCapabilities).to(equal([@[softButton] mutableCopy])); + expect(testResponse.presetBankCapabilities).to(equal(presetBank)); + }); + + it(@"Should get correctly when initialized", ^ { + NSMutableDictionary* dict = [@{NAMES_request: + @{NAMES_parameters: + @{NAMES_displayCapabilities:info, + NAMES_buttonCapabilities:[@[button] mutableCopy], + NAMES_softButtonCapabilities:[@[softButton] mutableCopy], + NAMES_presetBankCapabilities:presetBank}, + NAMES_operation_name:NAMES_SetDisplayLayout}} mutableCopy]; + SDLSetDisplayLayoutResponse* testResponse = [[SDLSetDisplayLayoutResponse alloc] initWithDictionary:dict]; + + expect(testResponse.displayCapabilities).to(equal(info)); + expect(testResponse.buttonCapabilities).to(equal([@[button] mutableCopy])); + expect(testResponse.softButtonCapabilities).to(equal([@[softButton] mutableCopy])); + expect(testResponse.presetBankCapabilities).to(equal(presetBank)); + }); + + it(@"Should return nil if not set", ^ { + SDLSetDisplayLayoutResponse* testResponse = [[SDLSetDisplayLayoutResponse alloc] init]; + + expect(testResponse.displayCapabilities).to(beNil()); + expect(testResponse.buttonCapabilities).to(beNil()); + expect(testResponse.softButtonCapabilities).to(beNil()); + expect(testResponse.presetBankCapabilities).to(beNil()); + }); +}); + +QuickSpecEnd
\ No newline at end of file diff --git a/SmartDeviceLinkTests/RPCSpecs/ResponseSpecs/SDLSetGlobalPropertiesResponseSpec.m b/SmartDeviceLinkTests/RPCSpecs/ResponseSpecs/SDLSetGlobalPropertiesResponseSpec.m new file mode 100644 index 000000000..80a5f47ec --- /dev/null +++ b/SmartDeviceLinkTests/RPCSpecs/ResponseSpecs/SDLSetGlobalPropertiesResponseSpec.m @@ -0,0 +1,16 @@ +// +// SDLSetGlobalPropertiesResponseSpec.m +// SmartDeviceLink + + +#import <Foundation/Foundation.h> + +#import <Quick/Quick.h> +#import <Nimble/Nimble.h> + +#import "SDLSetGlobalPropertiesResponse.h" +#import "SDLNames.h" + +QuickSpecBegin(SDLSetGlobalPropertiesResponseSpec) + +QuickSpecEnd diff --git a/SmartDeviceLinkTests/RPCSpecs/ResponseSpecs/SDLSetMediaClockTimerResponseSpec.m b/SmartDeviceLinkTests/RPCSpecs/ResponseSpecs/SDLSetMediaClockTimerResponseSpec.m new file mode 100644 index 000000000..e840213d6 --- /dev/null +++ b/SmartDeviceLinkTests/RPCSpecs/ResponseSpecs/SDLSetMediaClockTimerResponseSpec.m @@ -0,0 +1,16 @@ +// +// SDLSetMediaClockTimerResponseSpec.m +// SmartDeviceLink + + +#import <Foundation/Foundation.h> + +#import <Quick/Quick.h> +#import <Nimble/Nimble.h> + +#import "SDLSetMediaClockTimerResponse.h" +#import "SDLNames.h" + +QuickSpecBegin(SDLSetMediaClockTimerResponseSpec) + +QuickSpecEnd diff --git a/SmartDeviceLinkTests/RPCSpecs/ResponseSpecs/SDLShowConstantTBTResponseSpec.m b/SmartDeviceLinkTests/RPCSpecs/ResponseSpecs/SDLShowConstantTBTResponseSpec.m new file mode 100644 index 000000000..1bd2c57cd --- /dev/null +++ b/SmartDeviceLinkTests/RPCSpecs/ResponseSpecs/SDLShowConstantTBTResponseSpec.m @@ -0,0 +1,16 @@ +// +// SDLShowConstantTBTResponseSpec.m +// SmartDeviceLink + + +#import <Foundation/Foundation.h> + +#import <Quick/Quick.h> +#import <Nimble/Nimble.h> + +#import "SDLShowConstantTBTResponse.h" +#import "SDLNames.h" + +QuickSpecBegin(SDLShowConstantTBTResponseSpec) + +QuickSpecEnd diff --git a/SmartDeviceLinkTests/RPCSpecs/ResponseSpecs/SDLShowResponseSpec.m b/SmartDeviceLinkTests/RPCSpecs/ResponseSpecs/SDLShowResponseSpec.m new file mode 100644 index 000000000..bbfa524c0 --- /dev/null +++ b/SmartDeviceLinkTests/RPCSpecs/ResponseSpecs/SDLShowResponseSpec.m @@ -0,0 +1,16 @@ +// +// SDLShowResponseSpec.m +// SmartDeviceLink + + +#import <Foundation/Foundation.h> + +#import <Quick/Quick.h> +#import <Nimble/Nimble.h> + +#import "SDLShowResponse.h" +#import "SDLNames.h" + +QuickSpecBegin(SDLShowResponseSpec) + +QuickSpecEnd diff --git a/SmartDeviceLinkTests/RPCSpecs/ResponseSpecs/SDLSliderResponseSpec.m b/SmartDeviceLinkTests/RPCSpecs/ResponseSpecs/SDLSliderResponseSpec.m new file mode 100644 index 000000000..6f92c1e48 --- /dev/null +++ b/SmartDeviceLinkTests/RPCSpecs/ResponseSpecs/SDLSliderResponseSpec.m @@ -0,0 +1,43 @@ +// +// SDLSliderResponseSpec.m +// SmartDeviceLink + + +#import <Foundation/Foundation.h> + +#import <Quick/Quick.h> +#import <Nimble/Nimble.h> + +#import "SDLSliderResponse.h" +#import "SDLDIDResult.h" +#import "SDLNames.h" + +QuickSpecBegin(SDLSliderResponseSpec) + +describe(@"Getter/Setter Tests", ^ { + it(@"Should set and get correctly", ^ { + SDLSliderResponse* testResponse = [[SDLSliderResponse alloc] init]; + + testResponse.sliderPosition = @13; + + expect(testResponse.sliderPosition).to(equal(@13)); + }); + + it(@"Should get correctly when initialized", ^ { + NSMutableDictionary* dict = [@{NAMES_response: + @{NAMES_parameters: + @{NAMES_sliderPosition:@13}, + NAMES_operation_name:NAMES_Slider}} mutableCopy]; + SDLSliderResponse* testResponse = [[SDLSliderResponse alloc] initWithDictionary:dict]; + + expect(testResponse.sliderPosition).to(equal(@13)); + }); + + it(@"Should return nil if not set", ^ { + SDLSliderResponse* testResponse = [[SDLSliderResponse alloc] init]; + + expect(testResponse.sliderPosition).to(beNil()); + }); +}); + +QuickSpecEnd
\ No newline at end of file diff --git a/SmartDeviceLinkTests/RPCSpecs/ResponseSpecs/SDLSpeakResponseSpec.m b/SmartDeviceLinkTests/RPCSpecs/ResponseSpecs/SDLSpeakResponseSpec.m new file mode 100644 index 000000000..688e8f34c --- /dev/null +++ b/SmartDeviceLinkTests/RPCSpecs/ResponseSpecs/SDLSpeakResponseSpec.m @@ -0,0 +1,16 @@ +// +// SDLSpeakResponseSpec.m +// SmartDeviceLink + + +#import <Foundation/Foundation.h> + +#import <Quick/Quick.h> +#import <Nimble/Nimble.h> + +#import "SDLSpeakResponse.h" +#import "SDLNames.h" + +QuickSpecBegin(SDLSpeakResponseSpec) + +QuickSpecEnd diff --git a/SmartDeviceLinkTests/RPCSpecs/ResponseSpecs/SDLSubscribeButtonResponseSpec.m b/SmartDeviceLinkTests/RPCSpecs/ResponseSpecs/SDLSubscribeButtonResponseSpec.m new file mode 100644 index 000000000..5e78d95ed --- /dev/null +++ b/SmartDeviceLinkTests/RPCSpecs/ResponseSpecs/SDLSubscribeButtonResponseSpec.m @@ -0,0 +1,16 @@ +// +// SDLSubscribeButtonResponseSpec.m +// SmartDeviceLink + + +#import <Foundation/Foundation.h> + +#import <Quick/Quick.h> +#import <Nimble/Nimble.h> + +#import "SDLSubscribeButtonResponse.h" +#import "SDLNames.h" + +QuickSpecBegin(SDLSubscribeButtonResponseSpec) + +QuickSpecEnd
\ No newline at end of file diff --git a/SmartDeviceLinkTests/RPCSpecs/ResponseSpecs/SDLSubscribeVehicleDataResponseSpec.m b/SmartDeviceLinkTests/RPCSpecs/ResponseSpecs/SDLSubscribeVehicleDataResponseSpec.m new file mode 100644 index 000000000..d6c0dc6ac --- /dev/null +++ b/SmartDeviceLinkTests/RPCSpecs/ResponseSpecs/SDLSubscribeVehicleDataResponseSpec.m @@ -0,0 +1,161 @@ +// +// SDLSubscribeVehicleDataResponseSpec.m +// SmartDeviceLink + + +#import <Foundation/Foundation.h> + +#import <Quick/Quick.h> +#import <Nimble/Nimble.h> + +#import "SDLNames.h" +#import "SDLSubscribeVehicleDataResponse.h" +#import "SDLVehicleDataResult.h" + + +QuickSpecBegin(SDLSubscribeVehicleDataResponseSpec) + +SDLVehicleDataResult* vehicleDataResult = [[SDLVehicleDataResult alloc] init]; + +describe(@"Getter/Setter Tests", ^ { + it(@"Should set and get correctly", ^ { + SDLSubscribeVehicleDataResponse* testResponse = [[SDLSubscribeVehicleDataResponse alloc] init]; + + testResponse.gps = vehicleDataResult; + testResponse.speed = vehicleDataResult; + testResponse.rpm = vehicleDataResult; + testResponse.fuelLevel = vehicleDataResult; + testResponse.fuelLevel_State = vehicleDataResult; + testResponse.instantFuelConsumption = vehicleDataResult; + testResponse.externalTemperature = vehicleDataResult; + testResponse.prndl = vehicleDataResult; + testResponse.tirePressure = vehicleDataResult; + testResponse.odometer = vehicleDataResult; + testResponse.beltStatus = vehicleDataResult; + testResponse.bodyInformation = vehicleDataResult; + testResponse.deviceStatus = vehicleDataResult; + testResponse.driverBraking = vehicleDataResult; + testResponse.wiperStatus = vehicleDataResult; + testResponse.headLampStatus = vehicleDataResult; + testResponse.engineTorque = vehicleDataResult; + testResponse.accPedalPosition = vehicleDataResult; + testResponse.steeringWheelAngle = vehicleDataResult; + testResponse.eCallInfo = vehicleDataResult; + testResponse.airbagStatus = vehicleDataResult; + testResponse.emergencyEvent = vehicleDataResult; + testResponse.clusterModes = vehicleDataResult; + testResponse.myKey = vehicleDataResult; + + expect(testResponse.gps).to(equal(vehicleDataResult)); + expect(testResponse.speed).to(equal(vehicleDataResult)); + expect(testResponse.rpm).to(equal(vehicleDataResult)); + expect(testResponse.fuelLevel).to(equal(vehicleDataResult)); + expect(testResponse.fuelLevel_State).to(equal(vehicleDataResult)); + expect(testResponse.instantFuelConsumption).to(equal(vehicleDataResult)); + expect(testResponse.externalTemperature).to(equal(vehicleDataResult)); + expect(testResponse.prndl).to(equal(vehicleDataResult)); + expect(testResponse.tirePressure).to(equal(vehicleDataResult)); + expect(testResponse.odometer).to(equal(vehicleDataResult)); + expect(testResponse.beltStatus).to(equal(vehicleDataResult)); + expect(testResponse.bodyInformation).to(equal(vehicleDataResult)); + expect(testResponse.deviceStatus).to(equal(vehicleDataResult)); + expect(testResponse.driverBraking).to(equal(vehicleDataResult)); + expect(testResponse.wiperStatus).to(equal(vehicleDataResult)); + expect(testResponse.headLampStatus).to(equal(vehicleDataResult)); + expect(testResponse.engineTorque).to(equal(vehicleDataResult)); + expect(testResponse.accPedalPosition).to(equal(vehicleDataResult)); + expect(testResponse.steeringWheelAngle).to(equal(vehicleDataResult)); + expect(testResponse.eCallInfo).to(equal(vehicleDataResult)); + expect(testResponse.airbagStatus).to(equal(vehicleDataResult)); + expect(testResponse.emergencyEvent).to(equal(vehicleDataResult)); + expect(testResponse.clusterModes).to(equal(vehicleDataResult)); + expect(testResponse.myKey).to(equal(vehicleDataResult)); + }); + + it(@"Should get correctly when initialized", ^ { + NSMutableDictionary* dict = [@{NAMES_response: + @{NAMES_parameters: + @{NAMES_gps:vehicleDataResult, + NAMES_speed:vehicleDataResult, + NAMES_rpm:vehicleDataResult, + NAMES_fuelLevel:vehicleDataResult, + NAMES_fuelLevel_State:vehicleDataResult, + NAMES_instantFuelConsumption:vehicleDataResult, + NAMES_externalTemperature:vehicleDataResult, + NAMES_prndl:vehicleDataResult, + NAMES_tirePressure:vehicleDataResult, + NAMES_odometer:vehicleDataResult, + NAMES_beltStatus:vehicleDataResult, + NAMES_bodyInformation:vehicleDataResult, + NAMES_deviceStatus:vehicleDataResult, + NAMES_driverBraking:vehicleDataResult, + NAMES_wiperStatus:vehicleDataResult, + NAMES_headLampStatus:vehicleDataResult, + NAMES_engineTorque:vehicleDataResult, + NAMES_accPedalPosition:vehicleDataResult, + NAMES_steeringWheelAngle:vehicleDataResult, + NAMES_eCallInfo:vehicleDataResult, + NAMES_airbagStatus:vehicleDataResult, + NAMES_emergencyEvent:vehicleDataResult, + NAMES_clusterModes:vehicleDataResult, + NAMES_myKey:vehicleDataResult}, + NAMES_operation_name:NAMES_SubscribeVehicleData}} mutableCopy]; + SDLSubscribeVehicleDataResponse* testResponse = [[SDLSubscribeVehicleDataResponse alloc] initWithDictionary:dict]; + + expect(testResponse.gps).to(equal(vehicleDataResult)); + expect(testResponse.speed).to(equal(vehicleDataResult)); + expect(testResponse.rpm).to(equal(vehicleDataResult)); + expect(testResponse.fuelLevel).to(equal(vehicleDataResult)); + expect(testResponse.fuelLevel_State).to(equal(vehicleDataResult)); + expect(testResponse.instantFuelConsumption).to(equal(vehicleDataResult)); + expect(testResponse.externalTemperature).to(equal(vehicleDataResult)); + expect(testResponse.prndl).to(equal(vehicleDataResult)); + expect(testResponse.tirePressure).to(equal(vehicleDataResult)); + expect(testResponse.odometer).to(equal(vehicleDataResult)); + expect(testResponse.beltStatus).to(equal(vehicleDataResult)); + expect(testResponse.bodyInformation).to(equal(vehicleDataResult)); + expect(testResponse.deviceStatus).to(equal(vehicleDataResult)); + expect(testResponse.driverBraking).to(equal(vehicleDataResult)); + expect(testResponse.wiperStatus).to(equal(vehicleDataResult)); + expect(testResponse.headLampStatus).to(equal(vehicleDataResult)); + expect(testResponse.engineTorque).to(equal(vehicleDataResult)); + expect(testResponse.accPedalPosition).to(equal(vehicleDataResult)); + expect(testResponse.steeringWheelAngle).to(equal(vehicleDataResult)); + expect(testResponse.eCallInfo).to(equal(vehicleDataResult)); + expect(testResponse.airbagStatus).to(equal(vehicleDataResult)); + expect(testResponse.emergencyEvent).to(equal(vehicleDataResult)); + expect(testResponse.clusterModes).to(equal(vehicleDataResult)); + expect(testResponse.myKey).to(equal(vehicleDataResult)); + }); + + it(@"Should return nil if not set", ^ { + SDLSubscribeVehicleDataResponse* testResponse = [[SDLSubscribeVehicleDataResponse alloc] init]; + + expect(testResponse.gps).to(beNil()); + expect(testResponse.speed).to(beNil()); + expect(testResponse.rpm).to(beNil()); + expect(testResponse.fuelLevel).to(beNil()); + expect(testResponse.fuelLevel_State).to(beNil()); + expect(testResponse.instantFuelConsumption).to(beNil()); + expect(testResponse.externalTemperature).to(beNil()); + expect(testResponse.prndl).to(beNil()); + expect(testResponse.tirePressure).to(beNil()); + expect(testResponse.odometer).to(beNil()); + expect(testResponse.beltStatus).to(beNil()); + expect(testResponse.bodyInformation).to(beNil()); + expect(testResponse.deviceStatus).to(beNil()); + expect(testResponse.driverBraking).to(beNil()); + expect(testResponse.wiperStatus).to(beNil()); + expect(testResponse.headLampStatus).to(beNil()); + expect(testResponse.engineTorque).to(beNil()); + expect(testResponse.accPedalPosition).to(beNil()); + expect(testResponse.steeringWheelAngle).to(beNil()); + expect(testResponse.eCallInfo).to(beNil()); + expect(testResponse.airbagStatus).to(beNil()); + expect(testResponse.emergencyEvent).to(beNil()); + expect(testResponse.clusterModes).to(beNil()); + expect(testResponse.myKey).to(beNil()); + }); +}); + +QuickSpecEnd diff --git a/SmartDeviceLinkTests/RPCSpecs/ResponseSpecs/SDLSyncPDataResponseSpec.m b/SmartDeviceLinkTests/RPCSpecs/ResponseSpecs/SDLSyncPDataResponseSpec.m new file mode 100644 index 000000000..6a287f226 --- /dev/null +++ b/SmartDeviceLinkTests/RPCSpecs/ResponseSpecs/SDLSyncPDataResponseSpec.m @@ -0,0 +1,16 @@ +// +// SDLSyncPDataResponseSpec.m +// SmartDeviceLink + + +#import <Foundation/Foundation.h> + +#import <Quick/Quick.h> +#import <Nimble/Nimble.h> + +#import "SDLSyncPDataResponse.h" +#import "SDLNames.h" + +QuickSpecBegin(SDLSyncPDataResponseSpec) + +QuickSpecEnd
\ No newline at end of file diff --git a/SmartDeviceLinkTests/RPCSpecs/ResponseSpecs/SDLSystemRequestResponseSpec.m b/SmartDeviceLinkTests/RPCSpecs/ResponseSpecs/SDLSystemRequestResponseSpec.m new file mode 100644 index 000000000..2571379c8 --- /dev/null +++ b/SmartDeviceLinkTests/RPCSpecs/ResponseSpecs/SDLSystemRequestResponseSpec.m @@ -0,0 +1,16 @@ +// +// SDLSystemRequestResponseSpec.m +// SmartDeviceLink + + +#import <Foundation/Foundation.h> + +#import <Quick/Quick.h> +#import <Nimble/Nimble.h> + +#import "SDLSystemRequestResponse.h" +#import "SDLNames.h" + +QuickSpecBegin(SDLSystemRequestResponseSpec) + +QuickSpecEnd
\ No newline at end of file diff --git a/SmartDeviceLinkTests/RPCSpecs/ResponseSpecs/SDLUnregisterAppInterfaceResponseSpec.m b/SmartDeviceLinkTests/RPCSpecs/ResponseSpecs/SDLUnregisterAppInterfaceResponseSpec.m new file mode 100644 index 000000000..f10eb6048 --- /dev/null +++ b/SmartDeviceLinkTests/RPCSpecs/ResponseSpecs/SDLUnregisterAppInterfaceResponseSpec.m @@ -0,0 +1,16 @@ +// +// SDLUnregisterAppInterfaceResponseSpec.m +// SmartDeviceLink + + +#import <Foundation/Foundation.h> + +#import <Quick/Quick.h> +#import <Nimble/Nimble.h> + +#import "SDLUnregisterAppInterfaceResponse.h" +#import "SDLNames.h" + +QuickSpecBegin(SDLUnregisterAppInterfaceResponseSpec) + +QuickSpecEnd
\ No newline at end of file diff --git a/SmartDeviceLinkTests/RPCSpecs/ResponseSpecs/SDLUnsubscribeButtonResponseSpec.m b/SmartDeviceLinkTests/RPCSpecs/ResponseSpecs/SDLUnsubscribeButtonResponseSpec.m new file mode 100644 index 000000000..ca76ef4e7 --- /dev/null +++ b/SmartDeviceLinkTests/RPCSpecs/ResponseSpecs/SDLUnsubscribeButtonResponseSpec.m @@ -0,0 +1,16 @@ +// +// SDLUnsubscribeButtonResponseSpec.m +// SmartDeviceLink + + +#import <Foundation/Foundation.h> + +#import <Quick/Quick.h> +#import <Nimble/Nimble.h> + +#import "SDLUnsubscribeButtonResponse.h" +#import "SDLNames.h" + +QuickSpecBegin(SDLUnsubscribeButtonResponseSpec) + +QuickSpecEnd
\ No newline at end of file diff --git a/SmartDeviceLinkTests/RPCSpecs/ResponseSpecs/SDLUnsubscribeVehicleDataResponseSpec.m b/SmartDeviceLinkTests/RPCSpecs/ResponseSpecs/SDLUnsubscribeVehicleDataResponseSpec.m new file mode 100644 index 000000000..29cb4e08c --- /dev/null +++ b/SmartDeviceLinkTests/RPCSpecs/ResponseSpecs/SDLUnsubscribeVehicleDataResponseSpec.m @@ -0,0 +1,161 @@ +// +// SDLUnsubscribeVehicleDataResponseSpec.m +// SmartDeviceLink + + +#import <Foundation/Foundation.h> + +#import <Quick/Quick.h> +#import <Nimble/Nimble.h> + +#import "SDLUnsubscribeVehicleDataResponse.h" +#import "SDLNames.h" +#import "SDLVehicleDataResult.h" + + +QuickSpecBegin(SDLUnsubscribeVehicleDataResponseSpec) + +SDLVehicleDataResult* vehicleDataResult = [[SDLVehicleDataResult alloc] init]; + +describe(@"Getter/Setter Tests", ^ { + it(@"Should set and get correctly", ^ { + SDLUnsubscribeVehicleDataResponse* testResponse = [[SDLUnsubscribeVehicleDataResponse alloc] init]; + + testResponse.gps = vehicleDataResult; + testResponse.speed = vehicleDataResult; + testResponse.rpm = vehicleDataResult; + testResponse.fuelLevel = vehicleDataResult; + testResponse.fuelLevel_State = vehicleDataResult; + testResponse.instantFuelConsumption = vehicleDataResult; + testResponse.externalTemperature = vehicleDataResult; + testResponse.prndl = vehicleDataResult; + testResponse.tirePressure = vehicleDataResult; + testResponse.odometer = vehicleDataResult; + testResponse.beltStatus = vehicleDataResult; + testResponse.bodyInformation = vehicleDataResult; + testResponse.deviceStatus = vehicleDataResult; + testResponse.driverBraking = vehicleDataResult; + testResponse.wiperStatus = vehicleDataResult; + testResponse.headLampStatus = vehicleDataResult; + testResponse.engineTorque = vehicleDataResult; + testResponse.accPedalPosition = vehicleDataResult; + testResponse.steeringWheelAngle = vehicleDataResult; + testResponse.eCallInfo = vehicleDataResult; + testResponse.airbagStatus = vehicleDataResult; + testResponse.emergencyEvent = vehicleDataResult; + testResponse.clusterModes = vehicleDataResult; + testResponse.myKey = vehicleDataResult; + + expect(testResponse.gps).to(equal(vehicleDataResult)); + expect(testResponse.speed).to(equal(vehicleDataResult)); + expect(testResponse.rpm).to(equal(vehicleDataResult)); + expect(testResponse.fuelLevel).to(equal(vehicleDataResult)); + expect(testResponse.fuelLevel_State).to(equal(vehicleDataResult)); + expect(testResponse.instantFuelConsumption).to(equal(vehicleDataResult)); + expect(testResponse.externalTemperature).to(equal(vehicleDataResult)); + expect(testResponse.prndl).to(equal(vehicleDataResult)); + expect(testResponse.tirePressure).to(equal(vehicleDataResult)); + expect(testResponse.odometer).to(equal(vehicleDataResult)); + expect(testResponse.beltStatus).to(equal(vehicleDataResult)); + expect(testResponse.bodyInformation).to(equal(vehicleDataResult)); + expect(testResponse.deviceStatus).to(equal(vehicleDataResult)); + expect(testResponse.driverBraking).to(equal(vehicleDataResult)); + expect(testResponse.wiperStatus).to(equal(vehicleDataResult)); + expect(testResponse.headLampStatus).to(equal(vehicleDataResult)); + expect(testResponse.engineTorque).to(equal(vehicleDataResult)); + expect(testResponse.accPedalPosition).to(equal(vehicleDataResult)); + expect(testResponse.steeringWheelAngle).to(equal(vehicleDataResult)); + expect(testResponse.eCallInfo).to(equal(vehicleDataResult)); + expect(testResponse.airbagStatus).to(equal(vehicleDataResult)); + expect(testResponse.emergencyEvent).to(equal(vehicleDataResult)); + expect(testResponse.clusterModes).to(equal(vehicleDataResult)); + expect(testResponse.myKey).to(equal(vehicleDataResult)); + }); + + it(@"Should get correctly when initialized", ^ { + NSMutableDictionary* dict = [@{NAMES_response: + @{NAMES_parameters: + @{NAMES_gps:vehicleDataResult, + NAMES_speed:vehicleDataResult, + NAMES_rpm:vehicleDataResult, + NAMES_fuelLevel:vehicleDataResult, + NAMES_fuelLevel_State:vehicleDataResult, + NAMES_instantFuelConsumption:vehicleDataResult, + NAMES_externalTemperature:vehicleDataResult, + NAMES_prndl:vehicleDataResult, + NAMES_tirePressure:vehicleDataResult, + NAMES_odometer:vehicleDataResult, + NAMES_beltStatus:vehicleDataResult, + NAMES_bodyInformation:vehicleDataResult, + NAMES_deviceStatus:vehicleDataResult, + NAMES_driverBraking:vehicleDataResult, + NAMES_wiperStatus:vehicleDataResult, + NAMES_headLampStatus:vehicleDataResult, + NAMES_engineTorque:vehicleDataResult, + NAMES_accPedalPosition:vehicleDataResult, + NAMES_steeringWheelAngle:vehicleDataResult, + NAMES_eCallInfo:vehicleDataResult, + NAMES_airbagStatus:vehicleDataResult, + NAMES_emergencyEvent:vehicleDataResult, + NAMES_clusterModes:vehicleDataResult, + NAMES_myKey:vehicleDataResult}, + NAMES_operation_name:NAMES_UnsubscribeVehicleData}} mutableCopy]; + SDLUnsubscribeVehicleDataResponse* testResponse = [[SDLUnsubscribeVehicleDataResponse alloc] initWithDictionary:dict]; + + expect(testResponse.gps).to(equal(vehicleDataResult)); + expect(testResponse.speed).to(equal(vehicleDataResult)); + expect(testResponse.rpm).to(equal(vehicleDataResult)); + expect(testResponse.fuelLevel).to(equal(vehicleDataResult)); + expect(testResponse.fuelLevel_State).to(equal(vehicleDataResult)); + expect(testResponse.instantFuelConsumption).to(equal(vehicleDataResult)); + expect(testResponse.externalTemperature).to(equal(vehicleDataResult)); + expect(testResponse.prndl).to(equal(vehicleDataResult)); + expect(testResponse.tirePressure).to(equal(vehicleDataResult)); + expect(testResponse.odometer).to(equal(vehicleDataResult)); + expect(testResponse.beltStatus).to(equal(vehicleDataResult)); + expect(testResponse.bodyInformation).to(equal(vehicleDataResult)); + expect(testResponse.deviceStatus).to(equal(vehicleDataResult)); + expect(testResponse.driverBraking).to(equal(vehicleDataResult)); + expect(testResponse.wiperStatus).to(equal(vehicleDataResult)); + expect(testResponse.headLampStatus).to(equal(vehicleDataResult)); + expect(testResponse.engineTorque).to(equal(vehicleDataResult)); + expect(testResponse.accPedalPosition).to(equal(vehicleDataResult)); + expect(testResponse.steeringWheelAngle).to(equal(vehicleDataResult)); + expect(testResponse.eCallInfo).to(equal(vehicleDataResult)); + expect(testResponse.airbagStatus).to(equal(vehicleDataResult)); + expect(testResponse.emergencyEvent).to(equal(vehicleDataResult)); + expect(testResponse.clusterModes).to(equal(vehicleDataResult)); + expect(testResponse.myKey).to(equal(vehicleDataResult)); + }); + + it(@"Should return nil if not set", ^ { + SDLUnsubscribeVehicleDataResponse* testResponse = [[SDLUnsubscribeVehicleDataResponse alloc] init]; + + expect(testResponse.gps).to(beNil()); + expect(testResponse.speed).to(beNil()); + expect(testResponse.rpm).to(beNil()); + expect(testResponse.fuelLevel).to(beNil()); + expect(testResponse.fuelLevel_State).to(beNil()); + expect(testResponse.instantFuelConsumption).to(beNil()); + expect(testResponse.externalTemperature).to(beNil()); + expect(testResponse.prndl).to(beNil()); + expect(testResponse.tirePressure).to(beNil()); + expect(testResponse.odometer).to(beNil()); + expect(testResponse.beltStatus).to(beNil()); + expect(testResponse.bodyInformation).to(beNil()); + expect(testResponse.deviceStatus).to(beNil()); + expect(testResponse.driverBraking).to(beNil()); + expect(testResponse.wiperStatus).to(beNil()); + expect(testResponse.headLampStatus).to(beNil()); + expect(testResponse.engineTorque).to(beNil()); + expect(testResponse.accPedalPosition).to(beNil()); + expect(testResponse.steeringWheelAngle).to(beNil()); + expect(testResponse.eCallInfo).to(beNil()); + expect(testResponse.airbagStatus).to(beNil()); + expect(testResponse.emergencyEvent).to(beNil()); + expect(testResponse.clusterModes).to(beNil()); + expect(testResponse.myKey).to(beNil()); + }); +}); + +QuickSpecEnd diff --git a/SmartDeviceLinkTests/RPCSpecs/ResponseSpecs/SDLUpdateTurnListResponseSpec.m b/SmartDeviceLinkTests/RPCSpecs/ResponseSpecs/SDLUpdateTurnListResponseSpec.m new file mode 100644 index 000000000..d455dea46 --- /dev/null +++ b/SmartDeviceLinkTests/RPCSpecs/ResponseSpecs/SDLUpdateTurnListResponseSpec.m @@ -0,0 +1,16 @@ +// +// SDLUpdateTurnListResponseSpec.m +// SmartDeviceLink + + +#import <Foundation/Foundation.h> + +#import <Quick/Quick.h> +#import <Nimble/Nimble.h> + +#import "SDLUpdateTurnListResponse.h" +#import "SDLNames.h" + +QuickSpecBegin(SDLUpdateTurnListResponseSpec) + +QuickSpecEnd
\ No newline at end of file |