diff options
author | NicoleYarroch <nicole@livio.io> | 2019-03-12 11:03:49 -0400 |
---|---|---|
committer | NicoleYarroch <nicole@livio.io> | 2019-03-12 11:03:49 -0400 |
commit | 19dd8c1ce0b3d7476d6211c171a33d4de53636d1 (patch) | |
tree | a03cbb764675c6d10f109659001168fe89a64dbd /SmartDeviceLinkTests | |
parent | 163df4a223c06f1cb9bcaf09981fcc1a618cdd31 (diff) | |
parent | 9cc2c49fd044341897693b27e2acfe70c30d8952 (diff) | |
download | sdl_ios-19dd8c1ce0b3d7476d6211c171a33d4de53636d1.tar.gz |
Merge branch 'develop' into feature/issue_1166_cloud_app_transport
# Conflicts:
# SmartDeviceLink-iOS.podspec
# SmartDeviceLink-iOS.xcodeproj/project.pbxproj
# SmartDeviceLink.podspec
# SmartDeviceLink/SDLFunctionID.m
# SmartDeviceLink/SDLNames.h
# SmartDeviceLink/SDLNames.m
# SmartDeviceLink/SDLNotificationConstants.h
# SmartDeviceLink/SDLNotificationConstants.m
# SmartDeviceLink/SDLNotificationDispatcher.m
# SmartDeviceLink/SDLProxyListener.h
# SmartDeviceLink/SmartDeviceLink.h
# SmartDeviceLinkTests/DevAPISpecs/SDLNotificationDispatcherSpec.m
# SmartDeviceLinkTests/ProtocolSpecs/SDLFunctionIDSpec.m
# SmartDeviceLinkTests/RPCSpecs/NotificationSpecs/SDLOnVehicleDataSpec.m
# SmartDeviceLinkTests/RPCSpecs/RequestSpecs/SDLGetVehicleDataSpec.m
# SmartDeviceLinkTests/RPCSpecs/RequestSpecs/SDLSubscribeVehicleDataSpec.m
# SmartDeviceLinkTests/RPCSpecs/RequestSpecs/SDLUnsubscribeVehicleDataSpec.m
# SmartDeviceLinkTests/RPCSpecs/ResponseSpecs/SDLGetVehicleDataResponseSpec.m
# SmartDeviceLinkTests/RPCSpecs/ResponseSpecs/SDLSubscribeVehicleDataResponseSpec.m
# SmartDeviceLinkTests/RPCSpecs/ResponseSpecs/SDLUnsubscribeVehicleDataResponseSpec.m
Diffstat (limited to 'SmartDeviceLinkTests')
256 files changed, 4834 insertions, 1669 deletions
diff --git a/SmartDeviceLinkTests/DevAPISpecs/Notification Tests/SDLRPCNotificationNotificationSpec.m b/SmartDeviceLinkTests/DevAPISpecs/Notification Tests/SDLRPCNotificationNotificationSpec.m new file mode 100644 index 000000000..307e45d81 --- /dev/null +++ b/SmartDeviceLinkTests/DevAPISpecs/Notification Tests/SDLRPCNotificationNotificationSpec.m @@ -0,0 +1,41 @@ +// +// SDLRPCNotificationNotificationSpec.m +// SmartDeviceLinkTests +// +// Created by Nicole on 3/1/19. +// Copyright © 2019 smartdevicelink. All rights reserved. +// + +#import <Quick/Quick.h> +#import <Nimble/Nimble.h> + +#import "SDLNotificationConstants.h" +#import "SDLOnCommand.h" +#import "SDLRPCNotification.h" +#import "SDLRPCNotificationNotification.h" + +QuickSpecBegin(SDLRPCNotificationNotificationSpec) + +describe(@"A request notification notification", ^{ + __block SDLRPCNotification *testNotification = nil; + __block NSString *testName = nil; + + beforeEach(^{ + testNotification = [[SDLOnCommand alloc] initWithName:@"testNotification"]; + testName = SDLDidReceiveCommandNotification; + }); + + it(@"Should initialize correctly with initWithName:object:rpcRequest:", ^{ + SDLRPCNotificationNotification *testRequestNotification = [[SDLRPCNotificationNotification alloc] initWithName:testName object:nil rpcNotification:testNotification]; + + expect(testRequestNotification.name).to(equal(testName)); + expect(testRequestNotification.userInfo).to(equal(@{SDLNotificationUserInfoObject: testNotification})); + expect(testRequestNotification.object).to(beNil()); + expect(testRequestNotification.notification).to(equal(testNotification)); + expect([testRequestNotification isNotificationKindOfClass:SDLRPCNotification.class]).to(beTrue()); + expect([testRequestNotification isNotificationMemberOfClass:SDLOnCommand.class]).to(beTrue()); + }); +}); + +QuickSpecEnd + diff --git a/SmartDeviceLinkTests/DevAPISpecs/Notification Tests/SDLRPCRequestNotificationSpec.m b/SmartDeviceLinkTests/DevAPISpecs/Notification Tests/SDLRPCRequestNotificationSpec.m new file mode 100644 index 000000000..4751c9361 --- /dev/null +++ b/SmartDeviceLinkTests/DevAPISpecs/Notification Tests/SDLRPCRequestNotificationSpec.m @@ -0,0 +1,41 @@ +// +// SDLRPCRequestNotificationSpec.m +// SmartDeviceLinkTests +// +// Created by Nicole on 2/14/19. +// Copyright © 2019 smartdevicelink. All rights reserved. +// + +#import <Quick/Quick.h> +#import <Nimble/Nimble.h> + +#import "SDLNotificationConstants.h" +#import "SDLAddCommand.h" +#import "SDLRPCRequestNotification.h" + + +QuickSpecBegin(SDLRPCRequestNotificationSpec) + +describe(@"A request notification", ^{ + __block SDLRPCRequest *testRequest = nil; + __block NSString *testName = nil; + + beforeEach(^{ + testRequest = [[SDLAddCommand alloc] initWithName:@"testRequest"]; + testName = SDLDidReceiveAddCommandResponse; + }); + + it(@"Should initialize correctly with initWithName:object:rpcRequest:", ^{ + SDLRPCRequestNotification *testNotification = [[SDLRPCRequestNotification alloc] initWithName:testName object:nil rpcRequest:testRequest]; + + expect(testNotification.name).to(equal(testName)); + expect(testNotification.userInfo).to(equal(@{SDLNotificationUserInfoObject: testRequest})); + expect(testNotification.object).to(beNil()); + expect(testNotification.request).to(equal(testRequest)); + expect([testNotification isRequestKindOfClass:SDLRPCRequest.class]).to(beTrue()); + expect([testNotification isRequestMemberOfClass:SDLAddCommand.class]).to(beTrue()); + }); +}); + +QuickSpecEnd + diff --git a/SmartDeviceLinkTests/DevAPISpecs/Notification Tests/SDLRPCResponseNotificationSpec.m b/SmartDeviceLinkTests/DevAPISpecs/Notification Tests/SDLRPCResponseNotificationSpec.m new file mode 100644 index 000000000..a0aaf3b08 --- /dev/null +++ b/SmartDeviceLinkTests/DevAPISpecs/Notification Tests/SDLRPCResponseNotificationSpec.m @@ -0,0 +1,39 @@ +// +// SDLRPCResponseNotificationSpec.m +// SmartDeviceLinkTests +// +// Created by Nicole on 3/1/19. +// Copyright © 2019 smartdevicelink. All rights reserved. +// + +#import <Quick/Quick.h> +#import <Nimble/Nimble.h> + +#import "SDLNotificationConstants.h" +#import "SDLAddCommandResponse.h" +#import "SDLRPCResponseNotification.h" + +QuickSpecBegin(SDLRPCResponseNotificationSpec) + +describe(@"A response notification", ^{ + __block SDLRPCResponse *testResponse = nil; + __block NSString *testName = nil; + + beforeEach(^{ + testResponse = [[SDLAddCommandResponse alloc] initWithName:@"testResponse"]; + testName = SDLDidReceiveAddCommandRequest; + }); + + it(@"Should initialize correctly with initWithName:object:rpcRequest:", ^{ + SDLRPCResponseNotification *testNotification = [[SDLRPCResponseNotification alloc] initWithName:testName object:nil rpcResponse:testResponse]; + + expect(testNotification.name).to(equal(testName)); + expect(testNotification.userInfo).to(equal(@{SDLNotificationUserInfoObject: testResponse})); + expect(testNotification.object).to(beNil()); + expect(testNotification.response).to(equal(testResponse)); + expect([testNotification isResponseKindOfClass:SDLRPCResponse.class]).to(beTrue()); + expect([testNotification isResponseMemberOfClass:SDLAddCommandResponse.class]).to(beTrue()); + }); +}); + +QuickSpecEnd diff --git a/SmartDeviceLinkTests/DevAPISpecs/SDLLifecycleManagerSpec.m b/SmartDeviceLinkTests/DevAPISpecs/SDLLifecycleManagerSpec.m index f2429beb9..728dcc99f 100644 --- a/SmartDeviceLinkTests/DevAPISpecs/SDLLifecycleManagerSpec.m +++ b/SmartDeviceLinkTests/DevAPISpecs/SDLLifecycleManagerSpec.m @@ -4,6 +4,7 @@ #import "SDLLifecycleManager.h" +#import "SDLAppServiceData.h" #import "SDLConfiguration.h" #import "SDLConnectionManagerType.h" #import "SDLError.h" @@ -16,8 +17,10 @@ #import "SDLLogConfiguration.h" #import "SDLManagerDelegate.h" #import "SDLNotificationDispatcher.h" +#import "SDLOnAppServiceData.h" #import "SDLOnHashChange.h" #import "SDLOnHMIStatus.h" +#import "SDLPerformAppServiceInteractionResponse.h" #import "SDLPermissionManager.h" #import "SDLProxy.h" #import "SDLProtocol.h" @@ -129,6 +132,8 @@ describe(@"a lifecycle manager", ^{ expect(testManager.responseDispatcher).toNot(beNil()); expect(testManager.streamManager).toNot(beNil()); expect(testManager.systemCapabilityManager).toNot(beNil()); + expect(testManager.rpcOperationQueue).toNot(beNil()); + expect(testManager.rpcOperationQueue.maxConcurrentOperationCount).to(equal(3)); expect(@([testManager conformsToProtocol:@protocol(SDLConnectionManagerType)])).to(equal(@YES)); expect(testManager.authToken).to(beNil()); }); @@ -471,13 +476,44 @@ describe(@"a lifecycle manager", ^{ [testManager.lifecycleStateMachine setToState:SDLLifecycleStateReady fromOldState:nil callEnterTransition:NO]; }); - it(@"can send an RPC", ^{ + it(@"can send an RPC of type Request", ^{ SDLShow *testShow = [[SDLShow alloc] initWithMainField1:@"test" mainField2:nil alignment:nil]; - [testManager sendRequest:testShow]; + [testManager sendRPC:testShow]; - OCMVerify([proxyMock sendRPC:[OCMArg isKindOfClass:[SDLShow class]]]); + [NSThread sleepForTimeInterval:0.1]; + + OCMVerify([proxyMock sendRPC:[OCMArg isKindOfClass:SDLShow.class]]); }); - + + it(@"can send an RPC of type Response", ^{ + SDLPerformAppServiceInteractionResponse *testResponse = [[SDLPerformAppServiceInteractionResponse alloc] init]; + [testManager sendRPC:testResponse]; + testResponse.correlationID = @(2); + testResponse.success = @(true); + testResponse.resultCode = SDLResultSuccess; + testResponse.info = @"testResponse info"; + + [NSThread sleepForTimeInterval:0.1]; + + OCMVerify([proxyMock sendRPC:[OCMArg isKindOfClass:SDLPerformAppServiceInteractionResponse.class]]); + }); + + it(@"can send an RPC of type Notification", ^{ + SDLOnAppServiceData *testNotification = [[SDLOnAppServiceData alloc] initWithServiceData:[[SDLAppServiceData alloc] init]]; + [testManager sendRPC:testNotification]; + + [NSThread sleepForTimeInterval:0.1]; + + OCMVerify([proxyMock sendRPC:[OCMArg isKindOfClass:SDLOnAppServiceData.class]]); + }); + + it(@"should throw an exception if the RPC is not of type `Request`, `Response` or `Notification`", ^{ + SDLRPCMessage *testMessage = [[SDLRPCMessage alloc] init]; + expectAction(^{ + [testManager sendRPC:testMessage]; + }).to(raiseException()); + }); + describe(@"stopping the manager", ^{ beforeEach(^{ [testManager stop]; diff --git a/SmartDeviceLinkTests/DevAPISpecs/SDLNotificationDispatcherSpec.m b/SmartDeviceLinkTests/DevAPISpecs/SDLNotificationDispatcherSpec.m deleted file mode 100644 index 975d55cb5..000000000 --- a/SmartDeviceLinkTests/DevAPISpecs/SDLNotificationDispatcherSpec.m +++ /dev/null @@ -1,120 +0,0 @@ -#import <Quick/Quick.h> -#import <Nimble/Nimble.h> - -#import "SDLNotificationConstants.h" -#import "SDLNotificationDispatcher.h" - - -QuickSpecBegin(SDLNotificationDispatcherSpec) - -describe(@"a notification dispatcher", ^{ - __block SDLNotificationDispatcher *testDispatcher = nil; - - beforeEach(^{ - testDispatcher = [[SDLNotificationDispatcher alloc] init]; - }); - - it(@"should conform to SDLProxyListener", ^{ - expect(@([testDispatcher conformsToProtocol:@protocol(SDLProxyListener)])).to(beTruthy()); - - expect(@([testDispatcher respondsToSelector:@selector(onSetCloudAppProperties:)])).to(beTruthy()); - expect(@([testDispatcher respondsToSelector:@selector(onGetCloudAppProperties:)])).to(beTruthy()); - - expect(@([testDispatcher respondsToSelector:@selector(onOnDriverDistraction:)])).to(beTruthy()); - expect(@([testDispatcher respondsToSelector:@selector(onOnHMIStatus:)])).to(beTruthy()); - expect(@([testDispatcher respondsToSelector:@selector(onProxyClosed)])).to(beTruthy()); - expect(@([testDispatcher respondsToSelector:@selector(onProxyOpened)])).to(beTruthy()); - expect(@([testDispatcher respondsToSelector:@selector(onAddCommandResponse:)])).to(beTruthy()); - expect(@([testDispatcher respondsToSelector:@selector(onAddSubMenuResponse:)])).to(beTruthy()); - expect(@([testDispatcher respondsToSelector:@selector(onAlertManeuverResponse:)])).to(beTruthy()); - expect(@([testDispatcher respondsToSelector:@selector(onAlertResponse:)])).to(beTruthy()); - expect(@([testDispatcher respondsToSelector:@selector(onButtonPressResponse:)])).to(beTruthy()); - expect(@([testDispatcher respondsToSelector:@selector(onChangeRegistrationResponse:)])).to(beTruthy()); - expect(@([testDispatcher respondsToSelector:@selector(onCreateInteractionChoiceSetResponse:)])).to(beTruthy()); - expect(@([testDispatcher respondsToSelector:@selector(onDeleteCommandResponse:)])).to(beTruthy()); - expect(@([testDispatcher respondsToSelector:@selector(onDeleteInteractionChoiceSetResponse:)])).to(beTruthy()); - expect(@([testDispatcher respondsToSelector:@selector(onDeleteSubMenuResponse:)])).to(beTruthy()); - expect(@([testDispatcher respondsToSelector:@selector(onDiagnosticMessageResponse:)])).to(beTruthy()); - expect(@([testDispatcher respondsToSelector:@selector(onDialNumberResponse:)])).to(beTruthy()); - expect(@([testDispatcher respondsToSelector:@selector(onEncodedSyncPDataResponse:)])).to(beTruthy()); - expect(@([testDispatcher respondsToSelector:@selector(onEndAudioPassThruResponse:)])).to(beTruthy()); - expect(@([testDispatcher respondsToSelector:@selector(onError:)])).to(beTruthy()); - expect(@([testDispatcher respondsToSelector:@selector(onGenericResponse:)])).to(beTruthy()); - expect(@([testDispatcher respondsToSelector:@selector(onGetCloudAppPropertiesResponse:)])).to(beTruthy()); - expect(@([testDispatcher respondsToSelector:@selector(onGetDTCsResponse:)])).to(beTruthy()); - expect(@([testDispatcher respondsToSelector:@selector(onGetInteriorVehicleDataResponse:)])).to(beTruthy()); - expect(@([testDispatcher respondsToSelector:@selector(onGetSystemCapabilityResponse:)])).to(beTruthy()); - expect(@([testDispatcher respondsToSelector:@selector(onGetVehicleDataResponse:)])).to(beTruthy()); - expect(@([testDispatcher respondsToSelector:@selector(onGetWayPointsResponse:)])).to(beTruthy()); - expect(@([testDispatcher respondsToSelector:@selector(onReceivedLockScreenIcon:)])).to(beTruthy()); - expect(@([testDispatcher respondsToSelector:@selector(onOnAppInterfaceUnregistered:)])).to(beTruthy()); - expect(@([testDispatcher respondsToSelector:@selector(onOnAudioPassThru:)])).to(beTruthy()); - expect(@([testDispatcher respondsToSelector:@selector(onOnButtonEvent:)])).to(beTruthy()); - expect(@([testDispatcher respondsToSelector:@selector(onOnButtonPress:)])).to(beTruthy()); - expect(@([testDispatcher respondsToSelector:@selector(onOnCommand:)])).to(beTruthy()); - expect(@([testDispatcher respondsToSelector:@selector(onOnEncodedSyncPData:)])).to(beTruthy()); - expect(@([testDispatcher respondsToSelector:@selector(onOnHashChange:)])).to(beTruthy()); - expect(@([testDispatcher respondsToSelector:@selector(onOnLanguageChange:)])).to(beTruthy()); - expect(@([testDispatcher respondsToSelector:@selector(onOnLockScreenNotification:)])).to(beTruthy()); - expect(@([testDispatcher respondsToSelector:@selector(onOnSyncPData:)])).to(beTruthy()); - expect(@([testDispatcher respondsToSelector:@selector(onOnRCStatus:)])).to(beTruthy()); - expect(@([testDispatcher respondsToSelector:@selector(onOnSystemRequest:)])).to(beTruthy()); - expect(@([testDispatcher respondsToSelector:@selector(onOnTBTClientState:)])).to(beTruthy()); - expect(@([testDispatcher respondsToSelector:@selector(onOnTouchEvent:)])).to(beTruthy()); - expect(@([testDispatcher respondsToSelector:@selector(onOnVehicleData:)])).to(beTruthy()); - expect(@([testDispatcher respondsToSelector:@selector(onOnWayPointChange:)])).to(beTruthy()); - expect(@([testDispatcher respondsToSelector:@selector(onPerformAudioPassThruResponse:)])).to(beTruthy()); - expect(@([testDispatcher respondsToSelector:@selector(onPerformInteractionResponse:)])).to(beTruthy()); - expect(@([testDispatcher respondsToSelector:@selector(onPutFileResponse:)])).to(beTruthy()); - expect(@([testDispatcher respondsToSelector:@selector(onReadDIDResponse:)])).to(beTruthy()); - expect(@([testDispatcher respondsToSelector:@selector(onRegisterAppInterfaceResponse:)])).to(beTruthy()); - expect(@([testDispatcher respondsToSelector:@selector(onResetGlobalPropertiesResponse:)])).to(beTruthy()); - expect(@([testDispatcher respondsToSelector:@selector(onScrollableMessageResponse:)])).to(beTruthy()); - expect(@([testDispatcher respondsToSelector:@selector(onSendHapticDataResponse:)])).to(beTruthy()); - expect(@([testDispatcher respondsToSelector:@selector(onSendLocationResponse:)])).to(beTruthy()); - expect(@([testDispatcher respondsToSelector:@selector(onSetAppIconResponse:)])).to(beTruthy()); - expect(@([testDispatcher respondsToSelector:@selector(onSetCloudAppPropertiesResponse:)])).to(beTruthy()); - expect(@([testDispatcher respondsToSelector:@selector(onSetDisplayLayoutResponse:)])).to(beTruthy()); - expect(@([testDispatcher respondsToSelector:@selector(onSetGlobalPropertiesResponse:)])).to(beTruthy()); - expect(@([testDispatcher respondsToSelector:@selector(onSetInteriorVehicleDataResponse:)])).to(beTruthy()); - expect(@([testDispatcher respondsToSelector:@selector(onSetMediaClockTimerResponse:)])).to(beTruthy()); - expect(@([testDispatcher respondsToSelector:@selector(onShowConstantTBTResponse:)])).to(beTruthy()); - expect(@([testDispatcher respondsToSelector:@selector(onShowResponse:)])).to(beTruthy()); - expect(@([testDispatcher respondsToSelector:@selector(onSliderResponse:)])).to(beTruthy()); - expect(@([testDispatcher respondsToSelector:@selector(onSpeakResponse:)])).to(beTruthy()); - expect(@([testDispatcher respondsToSelector:@selector(onSubscribeButtonResponse:)])).to(beTruthy()); - expect(@([testDispatcher respondsToSelector:@selector(onSubscribeVehicleDataResponse:)])).to(beTruthy()); - expect(@([testDispatcher respondsToSelector:@selector(onSubscribeWayPointsResponse:)])).to(beTruthy()); - expect(@([testDispatcher respondsToSelector:@selector(onSyncPDataResponse:)])).to(beTruthy()); - expect(@([testDispatcher respondsToSelector:@selector(onUpdateTurnListResponse:)])).to(beTruthy()); - expect(@([testDispatcher respondsToSelector:@selector(onUnregisterAppInterfaceResponse:)])).to(beTruthy()); - expect(@([testDispatcher respondsToSelector:@selector(onUnsubscribeButtonResponse:)])).to(beTruthy()); - expect(@([testDispatcher respondsToSelector:@selector(onUnsubscribeVehicleDataResponse:)])).to(beTruthy()); - expect(@([testDispatcher respondsToSelector:@selector(onUnsubscribeWayPointsResponse:)])).to(beTruthy()); - }); - - describe(@"when told to post a notification", ^{ - __block NSString *testNotificationName = nil; - __block NSString *testUserInfo = nil; - - __block NSNotification *returnNotification = nil; - - beforeEach(^{ - testNotificationName = @"com.test.notification"; - testUserInfo = @"testuserinfo"; - - [[NSNotificationCenter defaultCenter] addObserverForName:testNotificationName object:nil queue:nil usingBlock:^(NSNotification * _Nonnull note) { - returnNotification = note; - }]; - - [testDispatcher postNotificationName:testNotificationName infoObject:testUserInfo]; - }); - - it(@"should post", ^{ - expect(returnNotification.userInfo[SDLNotificationUserInfoObject]).toEventually(match(testUserInfo)); - expect(returnNotification.object).toEventually(equal(testDispatcher)); - }); - }); -}); - -QuickSpecEnd diff --git a/SmartDeviceLinkTests/DevAPISpecs/SDLSoftButtonStateSpec.m b/SmartDeviceLinkTests/DevAPISpecs/SDLSoftButtonStateSpec.m index ffea7c58e..e62a9256f 100644 --- a/SmartDeviceLinkTests/DevAPISpecs/SDLSoftButtonStateSpec.m +++ b/SmartDeviceLinkTests/DevAPISpecs/SDLSoftButtonStateSpec.m @@ -60,6 +60,17 @@ describe(@"soft button state", ^{ expect(testSoftButton.image.value).to(equal(testArtworkName)); }); }); + +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wunused-value" + context(@"when created invalid", ^{ + it(@"should assert", ^{ + expectAction(^{ + [[SDLSoftButtonState alloc] initWithStateName:testStateName text:nil image:nil]; + }).to(raiseException()); + }); + }); +#pragma clang diagnostic pop }); QuickSpecEnd diff --git a/SmartDeviceLinkTests/Notifications/SDLNotificationDispatcherSpec.m b/SmartDeviceLinkTests/Notifications/SDLNotificationDispatcherSpec.m new file mode 100644 index 000000000..5b3f87212 --- /dev/null +++ b/SmartDeviceLinkTests/Notifications/SDLNotificationDispatcherSpec.m @@ -0,0 +1,255 @@ +#import <Quick/Quick.h> +#import <Nimble/Nimble.h> + +#import "SDLAddCommand.h" +#import "SDLAddCommandResponse.h" +#import "SDLNotificationConstants.h" +#import "SDLNotificationDispatcher.h" +#import "SDLOnCommand.h" +#import "SDLRPCNotificationNotification.h" +#import "SDLRPCRequestNotification.h" +#import "SDLRPCResponseNotification.h" + +QuickSpecBegin(SDLNotificationDispatcherSpec) + +describe(@"a notification dispatcher", ^{ + __block SDLNotificationDispatcher *testDispatcher = nil; + + beforeEach(^{ + testDispatcher = [[SDLNotificationDispatcher alloc] init]; + }); + + it(@"should conform to SDLProxyListener", ^{ + expect(@([testDispatcher conformsToProtocol:@protocol(SDLProxyListener)])).to(beTruthy()); + + // Responses + expect(@([testDispatcher respondsToSelector:@selector(onOnDriverDistraction:)])).to(beTruthy()); + expect(@([testDispatcher respondsToSelector:@selector(onOnHMIStatus:)])).to(beTruthy()); + expect(@([testDispatcher respondsToSelector:@selector(onProxyClosed)])).to(beTruthy()); + expect(@([testDispatcher respondsToSelector:@selector(onProxyOpened)])).to(beTruthy()); + expect(@([testDispatcher respondsToSelector:@selector(onAddCommandResponse:)])).to(beTruthy()); + expect(@([testDispatcher respondsToSelector:@selector(onAddSubMenuResponse:)])).to(beTruthy()); + expect(@([testDispatcher respondsToSelector:@selector(onAlertManeuverResponse:)])).to(beTruthy()); + expect(@([testDispatcher respondsToSelector:@selector(onAlertResponse:)])).to(beTruthy()); + expect(@([testDispatcher respondsToSelector:@selector(onButtonPressResponse:)])).to(beTruthy()); + expect(@([testDispatcher respondsToSelector:@selector(onChangeRegistrationResponse:)])).to(beTruthy()); + expect(@([testDispatcher respondsToSelector:@selector(onCreateInteractionChoiceSetResponse:)])).to(beTruthy()); + expect(@([testDispatcher respondsToSelector:@selector(onDeleteCommandResponse:)])).to(beTruthy()); + expect(@([testDispatcher respondsToSelector:@selector(onDeleteInteractionChoiceSetResponse:)])).to(beTruthy()); + expect(@([testDispatcher respondsToSelector:@selector(onDeleteSubMenuResponse:)])).to(beTruthy()); + expect(@([testDispatcher respondsToSelector:@selector(onDiagnosticMessageResponse:)])).to(beTruthy()); + expect(@([testDispatcher respondsToSelector:@selector(onDialNumberResponse:)])).to(beTruthy()); + expect(@([testDispatcher respondsToSelector:@selector(onEncodedSyncPDataResponse:)])).to(beTruthy()); + expect(@([testDispatcher respondsToSelector:@selector(onEndAudioPassThruResponse:)])).to(beTruthy()); + expect(@([testDispatcher respondsToSelector:@selector(onError:)])).to(beTruthy()); + expect(@([testDispatcher respondsToSelector:@selector(onGenericResponse:)])).to(beTruthy()); + expect(@([testDispatcher respondsToSelector:@selector(onGetAppServiceDataResponse:)])).to(beTruthy()); + expect(@([testDispatcher respondsToSelector:@selector(onGetDTCsResponse:)])).to(beTruthy()); + expect(@([testDispatcher respondsToSelector:@selector(onGetFileResponse:)])).to(beTruthy()); + expect(@([testDispatcher respondsToSelector:@selector(onGetInteriorVehicleDataResponse:)])).to(beTruthy()); + expect(@([testDispatcher respondsToSelector:@selector(onGetSystemCapabilityResponse:)])).to(beTruthy()); + expect(@([testDispatcher respondsToSelector:@selector(onGetVehicleDataResponse:)])).to(beTruthy()); + expect(@([testDispatcher respondsToSelector:@selector(onGetWayPointsResponse:)])).to(beTruthy()); + expect(@([testDispatcher respondsToSelector:@selector(onReceivedLockScreenIcon:)])).to(beTruthy()); + expect(@([testDispatcher respondsToSelector:@selector(onPerformAppServiceInteractionResponse:)])).to(beTruthy()); + expect(@([testDispatcher respondsToSelector:@selector(onPerformAudioPassThruResponse:)])).to(beTruthy()); + expect(@([testDispatcher respondsToSelector:@selector(onPerformInteractionResponse:)])).to(beTruthy()); + expect(@([testDispatcher respondsToSelector:@selector(onPublishAppServiceResponse:)])).to(beTruthy()); + expect(@([testDispatcher respondsToSelector:@selector(onPutFileResponse:)])).to(beTruthy()); + expect(@([testDispatcher respondsToSelector:@selector(onReadDIDResponse:)])).to(beTruthy()); + expect(@([testDispatcher respondsToSelector:@selector(onRegisterAppInterfaceResponse:)])).to(beTruthy()); + expect(@([testDispatcher respondsToSelector:@selector(onResetGlobalPropertiesResponse:)])).to(beTruthy()); + expect(@([testDispatcher respondsToSelector:@selector(onScrollableMessageResponse:)])).to(beTruthy()); + expect(@([testDispatcher respondsToSelector:@selector(onSendHapticDataResponse:)])).to(beTruthy()); + expect(@([testDispatcher respondsToSelector:@selector(onSendLocationResponse:)])).to(beTruthy()); + expect(@([testDispatcher respondsToSelector:@selector(onSetAppIconResponse:)])).to(beTruthy()); + expect(@([testDispatcher respondsToSelector:@selector(onSetDisplayLayoutResponse:)])).to(beTruthy()); + expect(@([testDispatcher respondsToSelector:@selector(onSetGlobalPropertiesResponse:)])).to(beTruthy()); + expect(@([testDispatcher respondsToSelector:@selector(onSetInteriorVehicleDataResponse:)])).to(beTruthy()); + expect(@([testDispatcher respondsToSelector:@selector(onSetMediaClockTimerResponse:)])).to(beTruthy()); + expect(@([testDispatcher respondsToSelector:@selector(onShowConstantTBTResponse:)])).to(beTruthy()); + expect(@([testDispatcher respondsToSelector:@selector(onShowResponse:)])).to(beTruthy()); + expect(@([testDispatcher respondsToSelector:@selector(onSliderResponse:)])).to(beTruthy()); + expect(@([testDispatcher respondsToSelector:@selector(onSpeakResponse:)])).to(beTruthy()); + expect(@([testDispatcher respondsToSelector:@selector(onSubscribeButtonResponse:)])).to(beTruthy()); + expect(@([testDispatcher respondsToSelector:@selector(onSubscribeVehicleDataResponse:)])).to(beTruthy()); + expect(@([testDispatcher respondsToSelector:@selector(onSubscribeWayPointsResponse:)])).to(beTruthy()); + expect(@([testDispatcher respondsToSelector:@selector(onSyncPDataResponse:)])).to(beTruthy()); + expect(@([testDispatcher respondsToSelector:@selector(onUpdateTurnListResponse:)])).to(beTruthy()); + expect(@([testDispatcher respondsToSelector:@selector(onUnregisterAppInterfaceResponse:)])).to(beTruthy()); + expect(@([testDispatcher respondsToSelector:@selector(onUnsubscribeButtonResponse:)])).to(beTruthy()); + expect(@([testDispatcher respondsToSelector:@selector(onUnsubscribeVehicleDataResponse:)])).to(beTruthy()); + expect(@([testDispatcher respondsToSelector:@selector(onUnsubscribeWayPointsResponse:)])).to(beTruthy()); + + // Requests + expect(@([testDispatcher respondsToSelector:@selector(onAddCommand:)])).to(beTruthy()); + expect(@([testDispatcher respondsToSelector:@selector(onAddSubMenu:)])).to(beTruthy()); + expect(@([testDispatcher respondsToSelector:@selector(onAlert:)])).to(beTruthy()); + expect(@([testDispatcher respondsToSelector:@selector(onAlertManeuver:)])).to(beTruthy()); + expect(@([testDispatcher respondsToSelector:@selector(onButtonPress:)])).to(beTruthy()); + expect(@([testDispatcher respondsToSelector:@selector(onChangeRegistration:)])).to(beTruthy()); + expect(@([testDispatcher respondsToSelector:@selector(onCreateInteractionChoiceSet:)])).to(beTruthy()); + expect(@([testDispatcher respondsToSelector:@selector(onDeleteCommand:)])).to(beTruthy()); + expect(@([testDispatcher respondsToSelector:@selector(onDeleteFile:)])).to(beTruthy()); + expect(@([testDispatcher respondsToSelector:@selector(onDeleteInteractionChoiceSet:)])).to(beTruthy()); + expect(@([testDispatcher respondsToSelector:@selector(onDeleteSubMenu:)])).to(beTruthy()); + expect(@([testDispatcher respondsToSelector:@selector(onDiagnosticMessage:)])).to(beTruthy()); + expect(@([testDispatcher respondsToSelector:@selector(onDialNumber:)])).to(beTruthy()); + expect(@([testDispatcher respondsToSelector:@selector(onEncodedSyncPData:)])).to(beTruthy()); + expect(@([testDispatcher respondsToSelector:@selector(onEndAudioPassThru:)])).to(beTruthy()); + expect(@([testDispatcher respondsToSelector:@selector(onGetAppServiceData:)])).to(beTruthy()); + expect(@([testDispatcher respondsToSelector:@selector(onGetDTCs:)])).to(beTruthy()); + expect(@([testDispatcher respondsToSelector:@selector(onGetFile:)])).to(beTruthy()); + expect(@([testDispatcher respondsToSelector:@selector(onGetInteriorVehicleData:)])).to(beTruthy()); + expect(@([testDispatcher respondsToSelector:@selector(onGetSystemCapability:)])).to(beTruthy()); + expect(@([testDispatcher respondsToSelector:@selector(onGetVehicleData:)])).to(beTruthy()); + expect(@([testDispatcher respondsToSelector:@selector(onGetWayPoints:)])).to(beTruthy()); + expect(@([testDispatcher respondsToSelector:@selector(onListFiles:)])).to(beTruthy()); + expect(@([testDispatcher respondsToSelector:@selector(onPerformAppServiceInteraction:)])).to(beTruthy()); + expect(@([testDispatcher respondsToSelector:@selector(onPerformAudioPassThru:)])).to(beTruthy()); + expect(@([testDispatcher respondsToSelector:@selector(onPerformInteraction:)])).to(beTruthy()); + expect(@([testDispatcher respondsToSelector:@selector(onPublishAppService:)])).to(beTruthy()); + expect(@([testDispatcher respondsToSelector:@selector(onPutFile:)])).to(beTruthy()); + expect(@([testDispatcher respondsToSelector:@selector(onReadDID:)])).to(beTruthy()); + expect(@([testDispatcher respondsToSelector:@selector(onRegisterAppInterface:)])).to(beTruthy()); + expect(@([testDispatcher respondsToSelector:@selector(onResetGlobalProperties:)])).to(beTruthy()); + expect(@([testDispatcher respondsToSelector:@selector(onScrollableMessage:)])).to(beTruthy()); + expect(@([testDispatcher respondsToSelector:@selector(onSendHapticData:)])).to(beTruthy()); + expect(@([testDispatcher respondsToSelector:@selector(onSendLocation:)])).to(beTruthy()); + expect(@([testDispatcher respondsToSelector:@selector(onSetAppIcon:)])).to(beTruthy()); + expect(@([testDispatcher respondsToSelector:@selector(onSetDisplayLayout:)])).to(beTruthy()); + expect(@([testDispatcher respondsToSelector:@selector(onSetGlobalProperties:)])).to(beTruthy()); + expect(@([testDispatcher respondsToSelector:@selector(onSetInteriorVehicleData:)])).to(beTruthy()); + expect(@([testDispatcher respondsToSelector:@selector(onSetMediaClockTimer:)])).to(beTruthy()); + expect(@([testDispatcher respondsToSelector:@selector(onShow:)])).to(beTruthy()); + expect(@([testDispatcher respondsToSelector:@selector(onShowConstantTBT:)])).to(beTruthy()); + expect(@([testDispatcher respondsToSelector:@selector(onSlider:)])).to(beTruthy()); + expect(@([testDispatcher respondsToSelector:@selector(onSpeak:)])).to(beTruthy()); + expect(@([testDispatcher respondsToSelector:@selector(onSubscribeButton:)])).to(beTruthy()); + expect(@([testDispatcher respondsToSelector:@selector(onSubscribeVehicleData:)])).to(beTruthy()); + expect(@([testDispatcher respondsToSelector:@selector(onSubscribeWayPoints:)])).to(beTruthy()); + expect(@([testDispatcher respondsToSelector:@selector(onSyncPData:)])).to(beTruthy()); + expect(@([testDispatcher respondsToSelector:@selector(onSystemRequest:)])).to(beTruthy()); + expect(@([testDispatcher respondsToSelector:@selector(onUnregisterAppInterface:)])).to(beTruthy()); + expect(@([testDispatcher respondsToSelector:@selector(onUnsubscribeButton:)])).to(beTruthy()); + expect(@([testDispatcher respondsToSelector:@selector(onUnsubscribeVehicleData:)])).to(beTruthy()); + expect(@([testDispatcher respondsToSelector:@selector(onUnsubscribeWayPoints:)])).to(beTruthy()); + expect(@([testDispatcher respondsToSelector:@selector(onUpdateTurnList:)])).to(beTruthy()); + + // Notifications + expect(@([testDispatcher respondsToSelector:@selector(onOnAppInterfaceUnregistered:)])).to(beTruthy()); + expect(@([testDispatcher respondsToSelector:@selector(onOnAppServiceData:)])).to(beTruthy()); + expect(@([testDispatcher respondsToSelector:@selector(onOnAudioPassThru:)])).to(beTruthy()); + expect(@([testDispatcher respondsToSelector:@selector(onOnButtonEvent:)])).to(beTruthy()); + expect(@([testDispatcher respondsToSelector:@selector(onOnButtonPress:)])).to(beTruthy()); + expect(@([testDispatcher respondsToSelector:@selector(onOnCommand:)])).to(beTruthy()); + expect(@([testDispatcher respondsToSelector:@selector(onOnEncodedSyncPData:)])).to(beTruthy()); + expect(@([testDispatcher respondsToSelector:@selector(onOnHashChange:)])).to(beTruthy()); + expect(@([testDispatcher respondsToSelector:@selector(onOnLanguageChange:)])).to(beTruthy()); + expect(@([testDispatcher respondsToSelector:@selector(onOnLockScreenNotification:)])).to(beTruthy()); + expect(@([testDispatcher respondsToSelector:@selector(onOnRCStatus:)])).to(beTruthy()); + expect(@([testDispatcher respondsToSelector:@selector(onOnSyncPData:)])).to(beTruthy()); + expect(@([testDispatcher respondsToSelector:@selector(onOnSystemCapabilityUpdated:)])).to(beTruthy()); + expect(@([testDispatcher respondsToSelector:@selector(onOnSystemRequest:)])).to(beTruthy()); + expect(@([testDispatcher respondsToSelector:@selector(onOnTBTClientState:)])).to(beTruthy()); + expect(@([testDispatcher respondsToSelector:@selector(onOnTouchEvent:)])).to(beTruthy()); + expect(@([testDispatcher respondsToSelector:@selector(onOnVehicleData:)])).to(beTruthy()); + expect(@([testDispatcher respondsToSelector:@selector(onOnWayPointChange:)])).to(beTruthy()); + }); + + describe(@"when told to post a notification", ^{ + __block NSString *testNotificationName = nil; + __block NSString *testUserInfo = nil; + __block NSNotification *returnNotification = nil; + + beforeEach(^{ + testNotificationName = @"com.test.notification"; + testUserInfo = @"testuserinfo"; + + [[NSNotificationCenter defaultCenter] addObserverForName:testNotificationName object:nil queue:nil usingBlock:^(NSNotification * _Nonnull note) { + returnNotification = note; + }]; + + [testDispatcher postNotificationName:testNotificationName infoObject:testUserInfo]; + }); + + it(@"should post", ^{ + expect(returnNotification.userInfo[SDLNotificationUserInfoObject]).toEventually(match(testUserInfo)); + expect(returnNotification.object).toEventually(equal(testDispatcher)); + }); + }); + + describe(@"when told to post a response", ^{ + __block NSString *testNotificationName = nil; + __block SDLAddCommandResponse *testResponse = nil; + __block SDLRPCResponseNotification *testNotification = nil; + + beforeEach(^{ + testNotificationName = SDLDidReceiveAddCommandResponse; + testResponse = [[SDLAddCommandResponse alloc] init]; + + [[NSNotificationCenter defaultCenter] addObserverForName:testNotificationName object:nil queue:nil usingBlock:^(NSNotification * _Nonnull note) { + SDLRPCResponseNotification *requestNotification = (SDLRPCResponseNotification *)note; + testNotification = requestNotification; + }]; + + [testDispatcher postRPCResponseNotification:testNotificationName response:testResponse]; + }); + + it(@"should successfully post a response", ^{ + expect(testNotification.name).toEventually(equal(testNotificationName)); + expect(testNotification.response).toEventually(equal(testResponse)); + expect(testNotification.object).toEventually(equal(testDispatcher)); + }); + }); + + describe(@"when told to post a request", ^{ + __block NSString *testNotificationName = nil; + __block SDLAddCommand *testRequest = nil; + __block SDLRPCRequestNotification *testNotification = nil; + + beforeEach(^{ + testNotificationName = SDLDidReceiveAddCommandRequest; + testRequest = [[SDLAddCommand alloc] init]; + + [[NSNotificationCenter defaultCenter] addObserverForName:testNotificationName object:nil queue:nil usingBlock:^(NSNotification * _Nonnull note) { + SDLRPCRequestNotification *requestNotification = (SDLRPCRequestNotification *)note; + testNotification = requestNotification; + }]; + + [testDispatcher postRPCRequestNotification:testNotificationName request:testRequest]; + }); + + it(@"should successfully post a request", ^{ + expect(testNotification.name).toEventually(equal(testNotificationName)); + expect(testNotification.request).toEventually(equal(testRequest)); + expect(testNotification.object).toEventually(equal(testDispatcher)); + }); + }); + + describe(@"when told to post a notification", ^{ + __block NSString *testNotificationName = nil; + __block SDLOnCommand *testNotificationRequest = nil; + __block SDLRPCNotificationNotification *testNotification = nil; + + beforeEach(^{ + testNotificationName = SDLDidReceiveCommandNotification; + testNotificationRequest = [[SDLOnCommand alloc] init]; + + [[NSNotificationCenter defaultCenter] addObserverForName:testNotificationName object:nil queue:nil usingBlock:^(NSNotification * _Nonnull note) { + SDLRPCNotificationNotification *requestNotification = (SDLRPCNotificationNotification *)note; + testNotification = requestNotification; + }]; + + [testDispatcher postRPCNotificationNotification:testNotificationName notification:testNotificationRequest]; + }); + + it(@"should successfully post a notification", ^{ + expect(testNotification.name).toEventually(equal(testNotificationName)); + expect(testNotification.notification).toEventually(equal(testNotificationRequest)); + expect(testNotification.object).toEventually(equal(testDispatcher)); + }); + }); +}); + +QuickSpecEnd diff --git a/SmartDeviceLinkTests/DevAPISpecs/SDLResponseDispatcherSpec.m b/SmartDeviceLinkTests/Notifications/SDLResponseDispatcherSpec.m index 410d24386..410d24386 100644 --- a/SmartDeviceLinkTests/DevAPISpecs/SDLResponseDispatcherSpec.m +++ b/SmartDeviceLinkTests/Notifications/SDLResponseDispatcherSpec.m diff --git a/SmartDeviceLinkTests/ProtocolSpecs/HeaderSpecs/SDLProtocolHeaderSpec.m b/SmartDeviceLinkTests/ProtocolSpecs/HeaderSpecs/SDLProtocolHeaderSpec.m index f2aeb1303..a578ec561 100644 --- a/SmartDeviceLinkTests/ProtocolSpecs/HeaderSpecs/SDLProtocolHeaderSpec.m +++ b/SmartDeviceLinkTests/ProtocolSpecs/HeaderSpecs/SDLProtocolHeaderSpec.m @@ -11,7 +11,7 @@ #import "SDLProtocolHeader.h" #import "SDLV1ProtocolHeader.h" #import "SDLV2ProtocolHeader.h" -#import "SDLNames.h" +#import "SDLRPCParameterNames.h" QuickSpecBegin(SDLProtocolHeaderSpec) diff --git a/SmartDeviceLinkTests/ProtocolSpecs/HeaderSpecs/SDLV1ProtocolHeaderSpec.m b/SmartDeviceLinkTests/ProtocolSpecs/HeaderSpecs/SDLV1ProtocolHeaderSpec.m index 66abf2022..a7c6c1660 100644 --- a/SmartDeviceLinkTests/ProtocolSpecs/HeaderSpecs/SDLV1ProtocolHeaderSpec.m +++ b/SmartDeviceLinkTests/ProtocolSpecs/HeaderSpecs/SDLV1ProtocolHeaderSpec.m @@ -9,7 +9,7 @@ #import <Nimble/Nimble.h> #import "SDLV1ProtocolHeader.h" -#import "SDLNames.h" +#import "SDLRPCParameterNames.h" QuickSpecBegin(SDLV1ProtocolHeaderSpec) diff --git a/SmartDeviceLinkTests/ProtocolSpecs/HeaderSpecs/SDLV2ProtocolHeaderSpec.m b/SmartDeviceLinkTests/ProtocolSpecs/HeaderSpecs/SDLV2ProtocolHeaderSpec.m index 74969e062..1ade6e426 100644 --- a/SmartDeviceLinkTests/ProtocolSpecs/HeaderSpecs/SDLV2ProtocolHeaderSpec.m +++ b/SmartDeviceLinkTests/ProtocolSpecs/HeaderSpecs/SDLV2ProtocolHeaderSpec.m @@ -9,7 +9,7 @@ #import <Nimble/Nimble.h> #import "SDLV2ProtocolHeader.h" -#import "SDLNames.h" +#import "SDLRPCParameterNames.h" QuickSpecBegin(SDLV2ProtocolHeaderSpec) diff --git a/SmartDeviceLinkTests/ProtocolSpecs/MessageSpecs/SDLProtocolMessageSpec.m b/SmartDeviceLinkTests/ProtocolSpecs/MessageSpecs/SDLProtocolMessageSpec.m index 8c6f03f9c..b562d8c2d 100644 --- a/SmartDeviceLinkTests/ProtocolSpecs/MessageSpecs/SDLProtocolMessageSpec.m +++ b/SmartDeviceLinkTests/ProtocolSpecs/MessageSpecs/SDLProtocolMessageSpec.m @@ -15,7 +15,7 @@ #import "SDLV1ProtocolMessage.h" #import "SDLV2ProtocolHeader.h" #import "SDLV2ProtocolMessage.h" -#import "SDLNames.h" +#import "SDLRPCParameterNames.h" QuickSpecBegin(SDLProtocolMessageSpec) diff --git a/SmartDeviceLinkTests/ProtocolSpecs/MessageSpecs/SDLProtocolSpec.m b/SmartDeviceLinkTests/ProtocolSpecs/MessageSpecs/SDLProtocolSpec.m index 7d625556a..a087dc86f 100644 --- a/SmartDeviceLinkTests/ProtocolSpecs/MessageSpecs/SDLProtocolSpec.m +++ b/SmartDeviceLinkTests/ProtocolSpecs/MessageSpecs/SDLProtocolSpec.m @@ -18,7 +18,7 @@ #import "SDLProtocolMessage.h" #import "SDLProtocolReceivedMessageRouter.h" #import "SDLRPCRequest.h" -#import "SDLNames.h" +#import "SDLRPCParameterNames.h" #import "SDLV1ProtocolMessage.h" #import "SDLV2ProtocolMessage.h" #import "SDLV1ProtocolHeader.h" @@ -28,12 +28,12 @@ QuickSpecBegin(SDLProtocolSpec) //Test dictionaries -NSDictionary* dictionaryV1 = @{SDLNameRequest: - @{SDLNameOperationName:@"DeleteCommand", - SDLNameCorrelationId:@0x98765, - SDLNameParameters: - @{SDLNameCommandId:@55}}}; -NSDictionary* dictionaryV2 = @{SDLNameCommandId:@55}; +NSDictionary* dictionaryV1 = @{SDLRPCParameterNameRequest: + @{SDLRPCParameterNameOperationName:@"DeleteCommand", + SDLRPCParameterNameCorrelationId:@0x98765, + SDLRPCParameterNameParameters: + @{SDLRPCParameterNameCommandId:@55}}}; +NSDictionary* dictionaryV2 = @{SDLRPCParameterNameCommandId:@55}; describe(@"Send StartService Tests", ^ { context(@"Unsecure", ^{ diff --git a/SmartDeviceLinkTests/ProtocolSpecs/MessageSpecs/SDLV2ProtocolMessageSpec.m b/SmartDeviceLinkTests/ProtocolSpecs/MessageSpecs/SDLV2ProtocolMessageSpec.m index 3b73eb172..fe447388c 100644 --- a/SmartDeviceLinkTests/ProtocolSpecs/MessageSpecs/SDLV2ProtocolMessageSpec.m +++ b/SmartDeviceLinkTests/ProtocolSpecs/MessageSpecs/SDLV2ProtocolMessageSpec.m @@ -12,7 +12,7 @@ #import "SDLV2ProtocolMessage.h" #import "SDLV2ProtocolHeader.h" #import "SDLRPCPayload.h" -#import "SDLNames.h" +#import "SDLRPCParameterNames.h" QuickSpecBegin(SDLV2ProtocolMessageSpec) diff --git a/SmartDeviceLinkTests/ProtocolSpecs/SDLFunctionIDSpec.m b/SmartDeviceLinkTests/ProtocolSpecs/SDLFunctionIDSpec.m index 322c410eb..e1b32df29 100644 --- a/SmartDeviceLinkTests/ProtocolSpecs/SDLFunctionIDSpec.m +++ b/SmartDeviceLinkTests/ProtocolSpecs/SDLFunctionIDSpec.m @@ -9,7 +9,7 @@ #import <Nimble/Nimble.h> #import "SDLFunctionID.h" -#import "SDLNames.h" +#import "SDLRPCFunctionNames.h" QuickSpecBegin(SDLFunctionIDSpec) @@ -17,153 +17,155 @@ SDLFunctionID* functionID = [SDLFunctionID sharedInstance]; describe(@"GetFunctionName Tests", ^ { it(@"Should return the correct function name", ^ { - expect([functionID functionNameForId:1]).to(equal(SDLNameRegisterAppInterface)); - expect([functionID functionNameForId:2]).to(equal(SDLNameUnregisterAppInterface)); - expect([functionID functionNameForId:3]).to(equal(SDLNameSetGlobalProperties)); - expect([functionID functionNameForId:4]).to(equal(SDLNameResetGlobalProperties)); - expect([functionID functionNameForId:5]).to(equal(SDLNameAddCommand)); - expect([functionID functionNameForId:6]).to(equal(SDLNameDeleteCommand)); - expect([functionID functionNameForId:7]).to(equal(SDLNameAddSubMenu)); - expect([functionID functionNameForId:8]).to(equal(SDLNameDeleteSubMenu)); - expect([functionID functionNameForId:9]).to(equal(SDLNameCreateInteractionChoiceSet)); - expect([functionID functionNameForId:10]).to(equal(SDLNamePerformInteraction)); - expect([functionID functionNameForId:11]).to(equal(SDLNameDeleteInteractionChoiceSet)); - expect([functionID functionNameForId:12]).to(equal(SDLNameAlert)); - expect([functionID functionNameForId:13]).to(equal(SDLNameShow)); - expect([functionID functionNameForId:14]).to(equal(SDLNameSpeak)); - expect([functionID functionNameForId:15]).to(equal(SDLNameSetMediaClockTimer)); - expect([functionID functionNameForId:16]).to(equal(SDLNamePerformAudioPassThru)); - expect([functionID functionNameForId:17]).to(equal(SDLNameEndAudioPassThru)); - expect([functionID functionNameForId:18]).to(equal(SDLNameSubscribeButton)); - expect([functionID functionNameForId:19]).to(equal(SDLNameUnsubscribeButton)); - expect([functionID functionNameForId:20]).to(equal(SDLNameSubscribeVehicleData)); - expect([functionID functionNameForId:21]).to(equal(SDLNameUnsubscribeVehicleData)); - expect([functionID functionNameForId:22]).to(equal(SDLNameGetVehicleData)); - expect([functionID functionNameForId:23]).to(equal(SDLNameReadDID)); - expect([functionID functionNameForId:24]).to(equal(SDLNameGetDTCs)); - expect([functionID functionNameForId:25]).to(equal(SDLNameScrollableMessage)); - expect([functionID functionNameForId:26]).to(equal(SDLNameSlider)); - expect([functionID functionNameForId:27]).to(equal(SDLNameShowConstantTBT)); - expect([functionID functionNameForId:28]).to(equal(SDLNameAlertManeuver)); - expect([functionID functionNameForId:29]).to(equal(SDLNameUpdateTurnList)); - expect([functionID functionNameForId:30]).to(equal(SDLNameChangeRegistration)); - expect([functionID functionNameForId:31]).to(equal(SDLNameGenericResponse)); - expect([functionID functionNameForId:32]).to(equal(SDLNamePutFile)); - expect([functionID functionNameForId:33]).to(equal(SDLNameDeleteFile)); - expect([functionID functionNameForId:34]).to(equal(SDLNameListFiles)); - expect([functionID functionNameForId:35]).to(equal(SDLNameSetAppIcon)); - expect([functionID functionNameForId:36]).to(equal(SDLNameSetDisplayLayout)); - expect([functionID functionNameForId:37]).to(equal(SDLNameDiagnosticMessage)); - expect([functionID functionNameForId:38]).to(equal(SDLNameSystemRequest)); - expect([functionID functionNameForId:39]).to(equal(SDLNameSendLocation)); - expect([functionID functionNameForId:40]).to(equal(SDLNameDialNumber)); - expect([functionID functionNameForId:45]).to(equal(SDLNameGetWayPoints)); - expect([functionID functionNameForId:46]).to(equal(SDLNameSubscribeWayPoints)); - expect([functionID functionNameForId:47]).to(equal(SDLNameUnsubscribeWayPoints)); - expect([functionID functionNameForId:48]).to(equal(SDLNameGetSystemCapability)); - expect([functionID functionNameForId:49]).to(equal(SDLNameSendHapticData)); - expect([functionID functionNameForId:50]).to(equal(SDLNameSetCloudAppProperties)); - expect([functionID functionNameForId:51]).to(equal(SDLNameGetCloudAppProperties)); - expect([functionID functionNameForId:32768]).to(equal(SDLNameOnHMIStatus)); - expect([functionID functionNameForId:32769]).to(equal(SDLNameOnAppInterfaceUnregistered)); - expect([functionID functionNameForId:32770]).to(equal(SDLNameOnButtonEvent)); - expect([functionID functionNameForId:32771]).to(equal(SDLNameOnButtonPress)); - expect([functionID functionNameForId:32772]).to(equal(SDLNameOnVehicleData)); - expect([functionID functionNameForId:32773]).to(equal(SDLNameOnCommand)); - expect([functionID functionNameForId:32774]).to(equal(SDLNameOnTBTClientState)); - expect([functionID functionNameForId:32775]).to(equal(SDLNameOnDriverDistraction)); - expect([functionID functionNameForId:32776]).to(equal(SDLNameOnPermissionsChange)); - expect([functionID functionNameForId:32777]).to(equal(SDLNameOnAudioPassThru)); - expect([functionID functionNameForId:32778]).to(equal(SDLNameOnLanguageChange)); - expect([functionID functionNameForId:32779]).to(equal(SDLNameOnKeyboardInput)); - expect([functionID functionNameForId:32780]).to(equal(SDLNameOnTouchEvent)); - expect([functionID functionNameForId:32781]).to(equal(SDLNameOnSystemRequest)); - expect([functionID functionNameForId:32782]).to(equal(SDLNameOnHashChange)); - expect([functionID functionNameForId:32784]).to(equal(SDLNameOnWayPointChange)); - expect([functionID functionNameForId:32785]).to(equal(SDLNameOnRCStatus)); + expect([functionID functionNameForId:1]).to(equal(SDLRPCFunctionNameRegisterAppInterface)); + expect([functionID functionNameForId:2]).to(equal(SDLRPCFunctionNameUnregisterAppInterface)); + expect([functionID functionNameForId:3]).to(equal(SDLRPCFunctionNameSetGlobalProperties)); + expect([functionID functionNameForId:4]).to(equal(SDLRPCFunctionNameResetGlobalProperties)); + expect([functionID functionNameForId:5]).to(equal(SDLRPCFunctionNameAddCommand)); + expect([functionID functionNameForId:6]).to(equal(SDLRPCFunctionNameDeleteCommand)); + expect([functionID functionNameForId:7]).to(equal(SDLRPCFunctionNameAddSubMenu)); + expect([functionID functionNameForId:8]).to(equal(SDLRPCFunctionNameDeleteSubMenu)); + expect([functionID functionNameForId:9]).to(equal(SDLRPCFunctionNameCreateInteractionChoiceSet)); + expect([functionID functionNameForId:10]).to(equal(SDLRPCFunctionNamePerformInteraction)); + expect([functionID functionNameForId:11]).to(equal(SDLRPCFunctionNameDeleteInteractionChoiceSet)); + expect([functionID functionNameForId:12]).to(equal(SDLRPCFunctionNameAlert)); + expect([functionID functionNameForId:13]).to(equal(SDLRPCFunctionNameShow)); + expect([functionID functionNameForId:14]).to(equal(SDLRPCFunctionNameSpeak)); + expect([functionID functionNameForId:15]).to(equal(SDLRPCFunctionNameSetMediaClockTimer)); + expect([functionID functionNameForId:16]).to(equal(SDLRPCFunctionNamePerformAudioPassThru)); + expect([functionID functionNameForId:17]).to(equal(SDLRPCFunctionNameEndAudioPassThru)); + expect([functionID functionNameForId:18]).to(equal(SDLRPCFunctionNameSubscribeButton)); + expect([functionID functionNameForId:19]).to(equal(SDLRPCFunctionNameUnsubscribeButton)); + expect([functionID functionNameForId:20]).to(equal(SDLRPCFunctionNameSubscribeVehicleData)); + expect([functionID functionNameForId:21]).to(equal(SDLRPCFunctionNameUnsubscribeVehicleData)); + expect([functionID functionNameForId:22]).to(equal(SDLRPCFunctionNameGetVehicleData)); + expect([functionID functionNameForId:23]).to(equal(SDLRPCFunctionNameReadDID)); + expect([functionID functionNameForId:24]).to(equal(SDLRPCFunctionNameGetDTCs)); + expect([functionID functionNameForId:25]).to(equal(SDLRPCFunctionNameScrollableMessage)); + expect([functionID functionNameForId:26]).to(equal(SDLRPCFunctionNameSlider)); + expect([functionID functionNameForId:27]).to(equal(SDLRPCFunctionNameShowConstantTBT)); + expect([functionID functionNameForId:28]).to(equal(SDLRPCFunctionNameAlertManeuver)); + expect([functionID functionNameForId:29]).to(equal(SDLRPCFunctionNameUpdateTurnList)); + expect([functionID functionNameForId:30]).to(equal(SDLRPCFunctionNameChangeRegistration)); + expect([functionID functionNameForId:31]).to(equal(SDLRPCFunctionNameGenericResponse)); + expect([functionID functionNameForId:32]).to(equal(SDLRPCFunctionNamePutFile)); + expect([functionID functionNameForId:33]).to(equal(SDLRPCFunctionNameDeleteFile)); + expect([functionID functionNameForId:34]).to(equal(SDLRPCFunctionNameListFiles)); + expect([functionID functionNameForId:35]).to(equal(SDLRPCFunctionNameSetAppIcon)); + expect([functionID functionNameForId:36]).to(equal(SDLRPCFunctionNameSetDisplayLayout)); + expect([functionID functionNameForId:37]).to(equal(SDLRPCFunctionNameDiagnosticMessage)); + expect([functionID functionNameForId:38]).to(equal(SDLRPCFunctionNameSystemRequest)); + expect([functionID functionNameForId:39]).to(equal(SDLRPCFunctionNameSendLocation)); + expect([functionID functionNameForId:40]).to(equal(SDLRPCFunctionNameDialNumber)); + expect([functionID functionNameForId:45]).to(equal(SDLRPCFunctionNameGetWayPoints)); + expect([functionID functionNameForId:46]).to(equal(SDLRPCFunctionNameSubscribeWayPoints)); + expect([functionID functionNameForId:47]).to(equal(SDLRPCFunctionNameUnsubscribeWayPoints)); + expect([functionID functionNameForId:48]).to(equal(SDLRPCFunctionNameGetSystemCapability)); + expect([functionID functionNameForId:49]).to(equal(SDLRPCFunctionNameSendHapticData)); + expect([functionID functionNameForId:52]).to(equal(SDLRPCFunctionNamePublishAppService)); + expect([functionID functionNameForId:53]).to(equal(SDLRPCFunctionNameGetAppServiceData)); + expect([functionID functionNameForId:54]).to(equal(SDLRPCFunctionNameGetFile)); + expect([functionID functionNameForId:55]).to(equal(SDLRPCFunctionNamePerformAppServiceInteraction)); + expect([functionID functionNameForId:32768]).to(equal(SDLRPCFunctionNameOnHMIStatus)); + expect([functionID functionNameForId:32769]).to(equal(SDLRPCFunctionNameOnAppInterfaceUnregistered)); + expect([functionID functionNameForId:32770]).to(equal(SDLRPCFunctionNameOnButtonEvent)); + expect([functionID functionNameForId:32771]).to(equal(SDLRPCFunctionNameOnButtonPress)); + expect([functionID functionNameForId:32772]).to(equal(SDLRPCFunctionNameOnVehicleData)); + expect([functionID functionNameForId:32773]).to(equal(SDLRPCFunctionNameOnCommand)); + expect([functionID functionNameForId:32774]).to(equal(SDLRPCFunctionNameOnTBTClientState)); + expect([functionID functionNameForId:32775]).to(equal(SDLRPCFunctionNameOnDriverDistraction)); + expect([functionID functionNameForId:32776]).to(equal(SDLRPCFunctionNameOnPermissionsChange)); + expect([functionID functionNameForId:32777]).to(equal(SDLRPCFunctionNameOnAudioPassThru)); + expect([functionID functionNameForId:32778]).to(equal(SDLRPCFunctionNameOnLanguageChange)); + expect([functionID functionNameForId:32779]).to(equal(SDLRPCFunctionNameOnKeyboardInput)); + expect([functionID functionNameForId:32780]).to(equal(SDLRPCFunctionNameOnTouchEvent)); + expect([functionID functionNameForId:32781]).to(equal(SDLRPCFunctionNameOnSystemRequest)); + expect([functionID functionNameForId:32782]).to(equal(SDLRPCFunctionNameOnHashChange)); + expect([functionID functionNameForId:32784]).to(equal(SDLRPCFunctionNameOnWayPointChange)); + expect([functionID functionNameForId:32785]).to(equal(SDLRPCFunctionNameOnRCStatus)); + expect([functionID functionNameForId:32786]).to(equal(SDLRPCFunctionNameOnAppServiceData)); + expect([functionID functionNameForId:32787]).to(equal(SDLRPCFunctionNameOnSystemCapabilityUpdated)); //Not listed in Spec - expect([functionID functionNameForId:65536]).to(equal(SDLNameEncodedSyncPData)); - expect([functionID functionNameForId:65537]).to(equal(SDLNameSyncPData)); + expect([functionID functionNameForId:65536]).to(equal(SDLRPCFunctionNameEncodedSyncPData)); + expect([functionID functionNameForId:65537]).to(equal(SDLRPCFunctionNameSyncPData)); - expect([functionID functionNameForId:98304]).to(equal(SDLNameOnEncodedSyncPData)); - expect([functionID functionNameForId:98305]).to(equal(SDLNameOnSyncPData)); + expect([functionID functionNameForId:98304]).to(equal(SDLRPCFunctionNameOnEncodedSyncPData)); + expect([functionID functionNameForId:98305]).to(equal(SDLRPCFunctionNameOnSyncPData)); }); }); describe(@"GetFunctionID Tests", ^ { it(@"Should return the correct function ID", ^ { - expect([functionID functionIdForName:SDLNameRegisterAppInterface]).to(equal(@1)); - expect([functionID functionIdForName:SDLNameUnregisterAppInterface]).to(equal(@2)); - expect([functionID functionIdForName:SDLNameSetGlobalProperties]).to(equal(@3)); - expect([functionID functionIdForName:SDLNameResetGlobalProperties]).to(equal(@4)); - expect([functionID functionIdForName:SDLNameAddCommand]).to(equal(@5)); - expect([functionID functionIdForName:SDLNameDeleteCommand]).to(equal(@6)); - expect([functionID functionIdForName:SDLNameAddSubMenu]).to(equal(@7)); - expect([functionID functionIdForName:SDLNameDeleteSubMenu]).to(equal(@8)); - expect([functionID functionIdForName:SDLNameCreateInteractionChoiceSet]).to(equal(@9)); - expect([functionID functionIdForName:SDLNamePerformInteraction]).to(equal(@10)); - expect([functionID functionIdForName:SDLNameDeleteInteractionChoiceSet]).to(equal(@11)); - expect([functionID functionIdForName:SDLNameAlert]).to(equal(@12)); - expect([functionID functionIdForName:SDLNameShow]).to(equal(@13)); - expect([functionID functionIdForName:SDLNameSpeak]).to(equal(@14)); - expect([functionID functionIdForName:SDLNameSetMediaClockTimer]).to(equal(@15)); - expect([functionID functionIdForName:SDLNamePerformAudioPassThru]).to(equal(@16)); - expect([functionID functionIdForName:SDLNameEndAudioPassThru]).to(equal(@17)); - expect([functionID functionIdForName:SDLNameSubscribeButton]).to(equal(@18)); - expect([functionID functionIdForName:SDLNameUnsubscribeButton]).to(equal(@19)); - expect([functionID functionIdForName:SDLNameSubscribeVehicleData]).to(equal(@20)); - expect([functionID functionIdForName:SDLNameUnsubscribeVehicleData]).to(equal(@21)); - expect([functionID functionIdForName:SDLNameGetVehicleData]).to(equal(@22)); - expect([functionID functionIdForName:SDLNameReadDID]).to(equal(@23)); - expect([functionID functionIdForName:SDLNameGetDTCs]).to(equal(@24)); - expect([functionID functionIdForName:SDLNameScrollableMessage]).to(equal(@25)); - expect([functionID functionIdForName:SDLNameSlider]).to(equal(@26)); - expect([functionID functionIdForName:SDLNameShowConstantTBT]).to(equal(@27)); - expect([functionID functionIdForName:SDLNameAlertManeuver]).to(equal(@28)); - expect([functionID functionIdForName:SDLNameUpdateTurnList]).to(equal(@29)); - expect([functionID functionIdForName:SDLNameChangeRegistration]).to(equal(@30)); - expect([functionID functionIdForName:SDLNameGenericResponse]).to(equal(@31)); - expect([functionID functionIdForName:SDLNamePutFile]).to(equal(@32)); - expect([functionID functionIdForName:SDLNameDeleteFile]).to(equal(@33)); - expect([functionID functionIdForName:SDLNameListFiles]).to(equal(@34)); - expect([functionID functionIdForName:SDLNameSetAppIcon]).to(equal(@35)); - expect([functionID functionIdForName:SDLNameSetDisplayLayout]).to(equal(@36)); - expect([functionID functionIdForName:SDLNameDiagnosticMessage]).to(equal(@37)); - expect([functionID functionIdForName:SDLNameSystemRequest]).to(equal(@38)); - expect([functionID functionIdForName:SDLNameSendLocation]).to(equal(@39)); - expect([functionID functionIdForName:SDLNameDialNumber]).to(equal(@40)); - expect([functionID functionIdForName:SDLNameGetWayPoints]).to(equal(@45)); - expect([functionID functionIdForName:SDLNameSubscribeWayPoints]).to(equal(@46)); - expect([functionID functionIdForName:SDLNameUnsubscribeWayPoints]).to(equal(@47)); - expect([functionID functionIdForName:SDLNameGetSystemCapability]).to(equal(@48)); - expect([functionID functionIdForName:SDLNameSendHapticData]).to(equal(@49)); - expect([functionID functionIdForName:SDLNameSetCloudAppProperties]).to(equal(@50)); - expect([functionID functionIdForName:SDLNameGetCloudAppProperties]).to(equal(@51)); - expect([functionID functionIdForName:SDLNameOnHMIStatus]).to(equal(@32768)); - expect([functionID functionIdForName:SDLNameOnAppInterfaceUnregistered]).to(equal(@32769)); - expect([functionID functionIdForName:SDLNameOnButtonEvent]).to(equal(@32770)); - expect([functionID functionIdForName:SDLNameOnButtonPress]).to(equal(@32771)); - expect([functionID functionIdForName:SDLNameOnVehicleData]).to(equal(@32772)); - expect([functionID functionIdForName:SDLNameOnCommand]).to(equal(@32773)); - expect([functionID functionIdForName:SDLNameOnTBTClientState]).to(equal(@32774)); - expect([functionID functionIdForName:SDLNameOnDriverDistraction]).to(equal(@32775)); - expect([functionID functionIdForName:SDLNameOnPermissionsChange]).to(equal(@32776)); - expect([functionID functionIdForName:SDLNameOnAudioPassThru]).to(equal(@32777)); - expect([functionID functionIdForName:SDLNameOnLanguageChange]).to(equal(@32778)); - expect([functionID functionIdForName:SDLNameOnKeyboardInput]).to(equal(@32779)); - expect([functionID functionIdForName:SDLNameOnTouchEvent]).to(equal(@32780)); - expect([functionID functionIdForName:SDLNameOnSystemRequest]).to(equal(@32781)); - expect([functionID functionIdForName:SDLNameOnHashChange]).to(equal(@32782)); - expect([functionID functionIdForName:SDLNameOnWayPointChange]).to(equal(@32784)); - expect([functionID functionIdForName:SDLNameOnRCStatus]).to(equal(@32785)); + expect([functionID functionIdForName:SDLRPCFunctionNameRegisterAppInterface]).to(equal(@1)); + expect([functionID functionIdForName:SDLRPCFunctionNameUnregisterAppInterface]).to(equal(@2)); + expect([functionID functionIdForName:SDLRPCFunctionNameSetGlobalProperties]).to(equal(@3)); + expect([functionID functionIdForName:SDLRPCFunctionNameResetGlobalProperties]).to(equal(@4)); + expect([functionID functionIdForName:SDLRPCFunctionNameAddCommand]).to(equal(@5)); + expect([functionID functionIdForName:SDLRPCFunctionNameDeleteCommand]).to(equal(@6)); + expect([functionID functionIdForName:SDLRPCFunctionNameAddSubMenu]).to(equal(@7)); + expect([functionID functionIdForName:SDLRPCFunctionNameDeleteSubMenu]).to(equal(@8)); + expect([functionID functionIdForName:SDLRPCFunctionNameCreateInteractionChoiceSet]).to(equal(@9)); + expect([functionID functionIdForName:SDLRPCFunctionNamePerformInteraction]).to(equal(@10)); + expect([functionID functionIdForName:SDLRPCFunctionNameDeleteInteractionChoiceSet]).to(equal(@11)); + expect([functionID functionIdForName:SDLRPCFunctionNameAlert]).to(equal(@12)); + expect([functionID functionIdForName:SDLRPCFunctionNameShow]).to(equal(@13)); + expect([functionID functionIdForName:SDLRPCFunctionNameSpeak]).to(equal(@14)); + expect([functionID functionIdForName:SDLRPCFunctionNameSetMediaClockTimer]).to(equal(@15)); + expect([functionID functionIdForName:SDLRPCFunctionNamePerformAudioPassThru]).to(equal(@16)); + expect([functionID functionIdForName:SDLRPCFunctionNameEndAudioPassThru]).to(equal(@17)); + expect([functionID functionIdForName:SDLRPCFunctionNameSubscribeButton]).to(equal(@18)); + expect([functionID functionIdForName:SDLRPCFunctionNameUnsubscribeButton]).to(equal(@19)); + expect([functionID functionIdForName:SDLRPCFunctionNameSubscribeVehicleData]).to(equal(@20)); + expect([functionID functionIdForName:SDLRPCFunctionNameUnsubscribeVehicleData]).to(equal(@21)); + expect([functionID functionIdForName:SDLRPCFunctionNameGetVehicleData]).to(equal(@22)); + expect([functionID functionIdForName:SDLRPCFunctionNameReadDID]).to(equal(@23)); + expect([functionID functionIdForName:SDLRPCFunctionNameGetDTCs]).to(equal(@24)); + expect([functionID functionIdForName:SDLRPCFunctionNameScrollableMessage]).to(equal(@25)); + expect([functionID functionIdForName:SDLRPCFunctionNameSlider]).to(equal(@26)); + expect([functionID functionIdForName:SDLRPCFunctionNameShowConstantTBT]).to(equal(@27)); + expect([functionID functionIdForName:SDLRPCFunctionNameAlertManeuver]).to(equal(@28)); + expect([functionID functionIdForName:SDLRPCFunctionNameUpdateTurnList]).to(equal(@29)); + expect([functionID functionIdForName:SDLRPCFunctionNameChangeRegistration]).to(equal(@30)); + expect([functionID functionIdForName:SDLRPCFunctionNameGenericResponse]).to(equal(@31)); + expect([functionID functionIdForName:SDLRPCFunctionNamePutFile]).to(equal(@32)); + expect([functionID functionIdForName:SDLRPCFunctionNameDeleteFile]).to(equal(@33)); + expect([functionID functionIdForName:SDLRPCFunctionNameListFiles]).to(equal(@34)); + expect([functionID functionIdForName:SDLRPCFunctionNameSetAppIcon]).to(equal(@35)); + expect([functionID functionIdForName:SDLRPCFunctionNameSetDisplayLayout]).to(equal(@36)); + expect([functionID functionIdForName:SDLRPCFunctionNameDiagnosticMessage]).to(equal(@37)); + expect([functionID functionIdForName:SDLRPCFunctionNameSystemRequest]).to(equal(@38)); + expect([functionID functionIdForName:SDLRPCFunctionNameSendLocation]).to(equal(@39)); + expect([functionID functionIdForName:SDLRPCFunctionNameDialNumber]).to(equal(@40)); + expect([functionID functionIdForName:SDLRPCFunctionNameGetWayPoints]).to(equal(@45)); + expect([functionID functionIdForName:SDLRPCFunctionNameSubscribeWayPoints]).to(equal(@46)); + expect([functionID functionIdForName:SDLRPCFunctionNameUnsubscribeWayPoints]).to(equal(@47)); + expect([functionID functionIdForName:SDLRPCFunctionNameGetSystemCapability]).to(equal(@48)); + expect([functionID functionIdForName:SDLRPCFunctionNameSendHapticData]).to(equal(@49)); + expect([functionID functionIdForName:SDLRPCFunctionNameOnHMIStatus]).to(equal(@32768)); + expect([functionID functionIdForName:SDLRPCFunctionNameOnAppInterfaceUnregistered]).to(equal(@32769)); + expect([functionID functionIdForName:SDLRPCFunctionNameOnButtonEvent]).to(equal(@32770)); + expect([functionID functionIdForName:SDLRPCFunctionNameOnButtonPress]).to(equal(@32771)); + expect([functionID functionIdForName:SDLRPCFunctionNameOnVehicleData]).to(equal(@32772)); + expect([functionID functionIdForName:SDLRPCFunctionNameOnCommand]).to(equal(@32773)); + expect([functionID functionIdForName:SDLRPCFunctionNameOnTBTClientState]).to(equal(@32774)); + expect([functionID functionIdForName:SDLRPCFunctionNameOnDriverDistraction]).to(equal(@32775)); + expect([functionID functionIdForName:SDLRPCFunctionNameOnPermissionsChange]).to(equal(@32776)); + expect([functionID functionIdForName:SDLRPCFunctionNameOnAudioPassThru]).to(equal(@32777)); + expect([functionID functionIdForName:SDLRPCFunctionNameOnLanguageChange]).to(equal(@32778)); + expect([functionID functionIdForName:SDLRPCFunctionNameOnKeyboardInput]).to(equal(@32779)); + expect([functionID functionIdForName:SDLRPCFunctionNameOnTouchEvent]).to(equal(@32780)); + expect([functionID functionIdForName:SDLRPCFunctionNameOnSystemRequest]).to(equal(@32781)); + expect([functionID functionIdForName:SDLRPCFunctionNameOnHashChange]).to(equal(@32782)); + expect([functionID functionIdForName:SDLRPCFunctionNameOnWayPointChange]).to(equal(@32784)); + expect([functionID functionIdForName:SDLRPCFunctionNameOnRCStatus]).to(equal(@32785)); //Not listed in Spec - expect([functionID functionIdForName:SDLNameEncodedSyncPData]).to(equal(@65536)); - expect([functionID functionIdForName:SDLNameSyncPData]).to(equal(@65537)); + expect([functionID functionIdForName:SDLRPCFunctionNameEncodedSyncPData]).to(equal(@65536)); + expect([functionID functionIdForName:SDLRPCFunctionNameSyncPData]).to(equal(@65537)); - expect([functionID functionIdForName:SDLNameOnEncodedSyncPData]).to(equal(@98304)); - expect([functionID functionIdForName:SDLNameOnSyncPData]).to(equal(@98305)); + expect([functionID functionIdForName:SDLRPCFunctionNameOnEncodedSyncPData]).to(equal(@98304)); + expect([functionID functionIdForName:SDLRPCFunctionNameOnSyncPData]).to(equal(@98305)); }); }); diff --git a/SmartDeviceLinkTests/ProtocolSpecs/SDLProtocolMessageAssemblerSpec.m b/SmartDeviceLinkTests/ProtocolSpecs/SDLProtocolMessageAssemblerSpec.m index 1c7187387..b3826428a 100644 --- a/SmartDeviceLinkTests/ProtocolSpecs/SDLProtocolMessageAssemblerSpec.m +++ b/SmartDeviceLinkTests/ProtocolSpecs/SDLProtocolMessageAssemblerSpec.m @@ -12,7 +12,7 @@ #import "SDLProtocolMessageAssembler.h" #import "SDLV2ProtocolHeader.h" #import "SDLV2ProtocolMessage.h" -#import "SDLNames.h" +#import "SDLRPCParameterNames.h" QuickSpecBegin(SDLProtocolMessageAssemblerSpec) diff --git a/SmartDeviceLinkTests/ProtocolSpecs/SDLProtocolMessageDisassemblerSpec.m b/SmartDeviceLinkTests/ProtocolSpecs/SDLProtocolMessageDisassemblerSpec.m index ad662b47b..9c211ba05 100644 --- a/SmartDeviceLinkTests/ProtocolSpecs/SDLProtocolMessageDisassemblerSpec.m +++ b/SmartDeviceLinkTests/ProtocolSpecs/SDLProtocolMessageDisassemblerSpec.m @@ -13,7 +13,7 @@ #import "SDLProtocolMessageDisassembler.h" #import "SDLV2ProtocolHeader.h" #import "SDLV2ProtocolMessage.h" -#import "SDLNames.h" +#import "SDLRPCParameterNames.h" #import "SDLVersion.h" QuickSpecBegin(SDLProtocolMessageDisassemblerSpec) diff --git a/SmartDeviceLinkTests/ProtocolSpecs/SDLProtocolReceivedMessageRouterSpec.m b/SmartDeviceLinkTests/ProtocolSpecs/SDLProtocolReceivedMessageRouterSpec.m index 747a087b1..ab91a5de2 100644 --- a/SmartDeviceLinkTests/ProtocolSpecs/SDLProtocolReceivedMessageRouterSpec.m +++ b/SmartDeviceLinkTests/ProtocolSpecs/SDLProtocolReceivedMessageRouterSpec.m @@ -12,7 +12,7 @@ #import "SDLProtocolReceivedMessageRouter.h" #import "SDLV2ProtocolHeader.h" #import "SDLV2ProtocolMessage.h" -#import "SDLNames.h" +#import "SDLRPCParameterNames.h" QuickSpecBegin(SDLProtocolReceivedMessageRouterSpec) diff --git a/SmartDeviceLinkTests/RPCSpecs/EnumSpecs/SDLAppServiceTypeSpec.m b/SmartDeviceLinkTests/RPCSpecs/EnumSpecs/SDLAppServiceTypeSpec.m new file mode 100644 index 000000000..269c14d31 --- /dev/null +++ b/SmartDeviceLinkTests/RPCSpecs/EnumSpecs/SDLAppServiceTypeSpec.m @@ -0,0 +1,26 @@ +// +// SDLAppServiceTypeSpec.m +// SmartDeviceLinkTests +// +// Created by Nicole on 1/30/19. +// Copyright © 2019 smartdevicelink. All rights reserved. +// + +#import <Quick/Quick.h> +#import <Nimble/Nimble.h> + +#import "SDLAppServiceType.h" + + +QuickSpecBegin(SDLAppServiceTypeSpec) + +describe(@"Individual Enum Value Tests", ^{ + it(@"Should match internal values", ^{ + expect(SDLAppServiceTypeMedia).to(equal(@"MEDIA")); + expect(SDLAppServiceTypeWeather).to(equal(@"WEATHER")); + expect(SDLAppServiceTypeNavigation).to(equal(@"NAVIGATION")); + }); +}); + +QuickSpecEnd + diff --git a/SmartDeviceLinkTests/RPCSpecs/EnumSpecs/SDLDirectionSpec.m b/SmartDeviceLinkTests/RPCSpecs/EnumSpecs/SDLDirectionSpec.m new file mode 100644 index 000000000..86033c90b --- /dev/null +++ b/SmartDeviceLinkTests/RPCSpecs/EnumSpecs/SDLDirectionSpec.m @@ -0,0 +1,23 @@ +// +// SDLDirectionSpec.m +// SmartDeviceLinkTests +// +// Created by Nicole on 2/22/19. +// Copyright © 2019 smartdevicelink. All rights reserved. +// + +#import <Quick/Quick.h> +#import <Nimble/Nimble.h> + +#import "SDLDirection.h" + +QuickSpecBegin(SDLDirectionSpec) + +describe(@"Individual Enum Value Tests", ^ { + it(@"Should match internal values", ^ { + expect(SDLDirectionLeft).to(equal(@"LEFT")); + expect(SDLDirectionRight).to(equal(@"RIGHT")); + }); +}); + +QuickSpecEnd diff --git a/SmartDeviceLinkTests/RPCSpecs/EnumSpecs/SDLMediaTypeSpec.m b/SmartDeviceLinkTests/RPCSpecs/EnumSpecs/SDLMediaTypeSpec.m new file mode 100644 index 000000000..6e355cdd4 --- /dev/null +++ b/SmartDeviceLinkTests/RPCSpecs/EnumSpecs/SDLMediaTypeSpec.m @@ -0,0 +1,25 @@ +// +// SDLMediaTypeSpec.m +// SmartDeviceLinkTests +// +// Created by Nicole on 2/8/19. +// Copyright © 2019 smartdevicelink. All rights reserved. +// + +#import <Quick/Quick.h> +#import <Nimble/Nimble.h> + +#import "SDLMediaType.h" + +QuickSpecBegin(SDLMediaTypeSpec) + +describe(@"Individual Enum Value Tests", ^{ + it(@"Should match internal values", ^{ + expect(SDLMediaTypeMusic).to(equal(@"MUSIC")); + expect(SDLMediaTypePodcast).to(equal(@"PODCAST")); + expect(SDLMediaTypeAudiobook).to(equal(@"AUDIOBOOK")); + expect(SDLMediaTypeOther).to(equal(@"OTHER")); + }); +}); + +QuickSpecEnd diff --git a/SmartDeviceLinkTests/RPCSpecs/EnumSpecs/SDLNavigationActionSpec.m b/SmartDeviceLinkTests/RPCSpecs/EnumSpecs/SDLNavigationActionSpec.m new file mode 100644 index 000000000..d4e4dbaa3 --- /dev/null +++ b/SmartDeviceLinkTests/RPCSpecs/EnumSpecs/SDLNavigationActionSpec.m @@ -0,0 +1,28 @@ +// +// SDLNavigationActionSpec.m +// SmartDeviceLinkTests +// +// Created by Nicole on 2/22/19. +// Copyright © 2019 smartdevicelink. All rights reserved. +// + +#import <Quick/Quick.h> +#import <Nimble/Nimble.h> + +#import "SDLNavigationAction.h" + +QuickSpecBegin(SDLNavigationActionSpec) + +describe(@"Individual Enum Value Tests", ^ { + it(@"Should match internal values", ^ { + expect(SDLNavigationActionTurn).to(equal(@"TURN")); + expect(SDLNavigationActionExit).to(equal(@"EXIT")); + expect(SDLNavigationActionStay).to(equal(@"STAY")); + expect(SDLNavigationActionMerge).to(equal(@"MERGE")); + expect(SDLNavigationActionFerry).to(equal(@"FERRY")); + expect(SDLNavigationActionCarShuttleTrain).to(equal(@"CAR_SHUTTLE_TRAIN")); + expect(SDLNavigationActionWaypoint).to(equal(@"WAYPOINT")); + }); +}); + +QuickSpecEnd diff --git a/SmartDeviceLinkTests/RPCSpecs/EnumSpecs/SDLNavigationJunctionSpec.m b/SmartDeviceLinkTests/RPCSpecs/EnumSpecs/SDLNavigationJunctionSpec.m new file mode 100644 index 000000000..456d4b5bc --- /dev/null +++ b/SmartDeviceLinkTests/RPCSpecs/EnumSpecs/SDLNavigationJunctionSpec.m @@ -0,0 +1,31 @@ +// +// SDLNavigationJunctionSpec.m +// SmartDeviceLinkTests +// +// Created by Nicole on 2/22/19. +// Copyright © 2019 smartdevicelink. All rights reserved. +// + +#import <Quick/Quick.h> +#import <Nimble/Nimble.h> + +#import "SDLNavigationJunction.h" + +QuickSpecBegin(SDLNavigationJunctionSpec) + +describe(@"Individual Enum Value Tests", ^ { + it(@"Should match internal values", ^ { + expect(SDLNavigationJunctionRegular).to(equal(@"REGULAR")); + expect(SDLNavigationJunctionBifurcation).to(equal(@"BIFURCATION")); + expect(SDLNavigationJunctionMultiCarriageway).to(equal(@"MULTI_CARRIAGEWAY")); + expect(SDLNavigationJunctionRoundabout).to(equal(@"ROUNDABOUT")); + expect(SDLNavigationJunctionTraversableRoundabout).to(equal(@"TRAVERSABLE_ROUNDABOUT")); + expect(SDLNavigationJunctionJughandle).to(equal(@"JUGHANDLE")); + expect(SDLNavigationJunctionAllWayYield).to(equal(@"ALL_WAY_YIELD")); + expect(SDLNavigationJunctionTurnAround).to(equal(@"TURN_AROUND")); + }); +}); + +QuickSpecEnd + + diff --git a/SmartDeviceLinkTests/RPCSpecs/EnumSpecs/SDLServiceUpdateReasonSpec.m b/SmartDeviceLinkTests/RPCSpecs/EnumSpecs/SDLServiceUpdateReasonSpec.m new file mode 100644 index 000000000..a66d2df97 --- /dev/null +++ b/SmartDeviceLinkTests/RPCSpecs/EnumSpecs/SDLServiceUpdateReasonSpec.m @@ -0,0 +1,26 @@ +// +// SDLServiceUpdateReasonSpec.m +// SmartDeviceLinkTests +// +// Created by Nicole on 1/30/19. +// Copyright © 2019 smartdevicelink. All rights reserved. +// + +#import <Quick/Quick.h> +#import <Nimble/Nimble.h> + +#import "SDLServiceUpdateReason.h" + +QuickSpecBegin(SDLServiceUpdateReasonSpec) + +describe(@"Individual Enum Value Tests", ^{ + it(@"Should match internal values", ^{ + expect(SDLServiceUpdatePublished).to(equal(@"PUBLISHED")); + expect(SDLServiceUpdateRemoved).to(equal(@"REMOVED")); + expect(SDLServiceUpdateActivated).to(equal(@"ACTIVATED")); + expect(SDLServiceUpdateDeactivated).to(equal(@"DEACTIVATED")); + expect(SDLServiceUpdateManifestUpdate).to(equal(@"MANIFEST_UPDATE")); + }); +}); + +QuickSpecEnd diff --git a/SmartDeviceLinkTests/RPCSpecs/EnumSpecs/SDLSystemCapabilityTypeSpec.m b/SmartDeviceLinkTests/RPCSpecs/EnumSpecs/SDLSystemCapabilityTypeSpec.m index 0acaa4b6e..58bb889dc 100755 --- a/SmartDeviceLinkTests/RPCSpecs/EnumSpecs/SDLSystemCapabilityTypeSpec.m +++ b/SmartDeviceLinkTests/RPCSpecs/EnumSpecs/SDLSystemCapabilityTypeSpec.m @@ -10,6 +10,7 @@ QuickSpecBegin(SDLSystemCapabilityTypeSpec) describe(@"Individual Enum Value Tests", ^ { it(@"Should match internal values", ^ { + expect(SDLSystemCapabilityTypeAppServices).to(equal(@"APP_SERVICES")); expect(SDLSystemCapabilityTypeNavigation).to(equal(@"NAVIGATION")); expect(SDLSystemCapabilityTypePhoneCall).to(equal(@"PHONE_CALL")); expect(SDLSystemCapabilityTypeVideoStreaming).to(equal(@"VIDEO_STREAMING")); diff --git a/SmartDeviceLinkTests/RPCSpecs/NotificationSpecs/SDLOnAppInterfaceUnregisteredSpec.m b/SmartDeviceLinkTests/RPCSpecs/NotificationSpecs/SDLOnAppInterfaceUnregisteredSpec.m index b35d34d9c..fd5980b58 100644 --- a/SmartDeviceLinkTests/RPCSpecs/NotificationSpecs/SDLOnAppInterfaceUnregisteredSpec.m +++ b/SmartDeviceLinkTests/RPCSpecs/NotificationSpecs/SDLOnAppInterfaceUnregisteredSpec.m @@ -10,7 +10,8 @@ #import "SDLAppInterfaceUnregisteredReason.h" #import "SDLOnAppInterfaceUnregistered.h" -#import "SDLNames.h" +#import "SDLRPCParameterNames.h" +#import "SDLRPCFunctionNames.h" QuickSpecBegin(SDLOnAppInterfaceUnregisteredSpec) @@ -24,10 +25,10 @@ describe(@"Getter/Setter Tests", ^ { }); it(@"Should get correctly when initialized", ^ { - NSMutableDictionary* dict = [@{SDLNameNotification: - @{SDLNameParameters: - @{SDLNameReason:SDLAppInterfaceUnregisteredReasonAppUnauthorized}, - SDLNameOperationName:SDLNameOnAppInterfaceUnregistered}} mutableCopy]; + NSMutableDictionary* dict = [@{SDLRPCParameterNameNotification: + @{SDLRPCParameterNameParameters: + @{SDLRPCParameterNameReason:SDLAppInterfaceUnregisteredReasonAppUnauthorized}, + SDLRPCParameterNameOperationName:SDLRPCFunctionNameOnAppInterfaceUnregistered}} mutableCopy]; SDLOnAppInterfaceUnregistered* testNotification = [[SDLOnAppInterfaceUnregistered alloc] initWithDictionary:dict]; expect(testNotification.reason).to(equal(SDLAppInterfaceUnregisteredReasonAppUnauthorized)); diff --git a/SmartDeviceLinkTests/RPCSpecs/NotificationSpecs/SDLOnAppServiceDataSpec.m b/SmartDeviceLinkTests/RPCSpecs/NotificationSpecs/SDLOnAppServiceDataSpec.m new file mode 100644 index 000000000..b5fe3fff0 --- /dev/null +++ b/SmartDeviceLinkTests/RPCSpecs/NotificationSpecs/SDLOnAppServiceDataSpec.m @@ -0,0 +1,60 @@ +// +// SDLOnAppServiceDataSpec.m +// SmartDeviceLinkTests +// +// Created by Nicole on 2/7/19. +// Copyright © 2019 smartdevicelink. All rights reserved. +// + +#import <Quick/Quick.h> +#import <Nimble/Nimble.h> + +#import "SDLAppServiceData.h" +#import "SDLOnAppServiceData.h" +#import "SDLRPCParameterNames.h" +#import "SDLRPCFunctionNames.h" + +QuickSpecBegin(SDLOnAppServiceDataSpec) + +describe(@"Getter/Setter Tests", ^{ + __block SDLAppServiceData *testAppServiceData = nil; + + beforeEach(^{ + testAppServiceData = [[SDLAppServiceData alloc] init]; + testAppServiceData.serviceId = @"testServiceId"; + }); + + it(@"Should set and get correctly", ^{ + SDLOnAppServiceData *testNotification = [[SDLOnAppServiceData alloc] init]; + testNotification.serviceData = testAppServiceData; + + expect(testNotification.serviceData).to(equal(testAppServiceData)); + }); + + it(@"Should get correctly when initialized with a dictionary", ^{ + NSDictionary *dict = @{SDLRPCParameterNameNotification:@{ + SDLRPCParameterNameParameters:@{ + SDLRPCParameterNameServiceData:testAppServiceData + }, + SDLRPCParameterNameOperationName:SDLRPCFunctionNameOnAppServiceData}}; + SDLOnAppServiceData *testNotification = [[SDLOnAppServiceData alloc] initWithDictionary:dict]; + + expect(testNotification.serviceData).to(equal(testAppServiceData)); + }); + + it(@"Should get correctly when initialized with initWithServiceData:", ^{ + SDLOnAppServiceData *testNotification = [[SDLOnAppServiceData alloc] initWithServiceData:testAppServiceData]; + + expect(testNotification.serviceData).to(equal(testAppServiceData)); + }); + + it(@"Should return nil if not set", ^{ + SDLOnAppServiceData *testNotification = [[SDLOnAppServiceData alloc] init]; + + expect(testNotification.serviceData).to(beNil()); + }); +}); + +QuickSpecEnd + + diff --git a/SmartDeviceLinkTests/RPCSpecs/NotificationSpecs/SDLOnAudioPassThruSpec.m b/SmartDeviceLinkTests/RPCSpecs/NotificationSpecs/SDLOnAudioPassThruSpec.m index 213246b1c..8c6e16456 100644 --- a/SmartDeviceLinkTests/RPCSpecs/NotificationSpecs/SDLOnAudioPassThruSpec.m +++ b/SmartDeviceLinkTests/RPCSpecs/NotificationSpecs/SDLOnAudioPassThruSpec.m @@ -9,8 +9,9 @@ #import <Nimble/Nimble.h> #import "SDLOnAudioPassThru.h" -#import "SDLNames.h" +#import "SDLRPCParameterNames.h" +#import "SDLRPCFunctionNames.h" QuickSpecBegin(SDLOnAudioPassThruSpec) -QuickSpecEnd
\ No newline at end of file +QuickSpecEnd diff --git a/SmartDeviceLinkTests/RPCSpecs/NotificationSpecs/SDLOnButtonEventSpec.m b/SmartDeviceLinkTests/RPCSpecs/NotificationSpecs/SDLOnButtonEventSpec.m index b303ffd1a..2a298eb5e 100644 --- a/SmartDeviceLinkTests/RPCSpecs/NotificationSpecs/SDLOnButtonEventSpec.m +++ b/SmartDeviceLinkTests/RPCSpecs/NotificationSpecs/SDLOnButtonEventSpec.m @@ -10,7 +10,8 @@ #import "SDLButtonEventMode.h" #import "SDLButtonName.h" -#import "SDLNames.h" +#import "SDLRPCParameterNames.h" +#import "SDLRPCFunctionNames.h" #import "SDLOnButtonEvent.h" @@ -30,12 +31,12 @@ describe(@"Getter/Setter Tests", ^ { }); it(@"Should get correctly when initialized", ^ { - NSMutableDictionary* dict = [@{SDLNameNotification: - @{SDLNameParameters: - @{SDLNameButtonName:SDLButtonNameCustomButton, - SDLNameButtonEventMode:SDLButtonEventModeButtonDown, - SDLNameCustomButtonId:@4252}, - SDLNameOperationName:SDLNameOnButtonEvent}} mutableCopy]; + NSMutableDictionary* dict = [@{SDLRPCParameterNameNotification: + @{SDLRPCParameterNameParameters: + @{SDLRPCParameterNameButtonName:SDLButtonNameCustomButton, + SDLRPCParameterNameButtonEventMode:SDLButtonEventModeButtonDown, + SDLRPCParameterNameCustomButtonId:@4252}, + SDLRPCParameterNameOperationName:SDLRPCFunctionNameOnButtonEvent}} mutableCopy]; SDLOnButtonEvent* testNotification = [[SDLOnButtonEvent alloc] initWithDictionary:dict]; expect(testNotification.buttonName).to(equal(SDLButtonNameCustomButton)); diff --git a/SmartDeviceLinkTests/RPCSpecs/NotificationSpecs/SDLOnButtonPressSpec.m b/SmartDeviceLinkTests/RPCSpecs/NotificationSpecs/SDLOnButtonPressSpec.m index 5737c2f81..1b098318b 100644 --- a/SmartDeviceLinkTests/RPCSpecs/NotificationSpecs/SDLOnButtonPressSpec.m +++ b/SmartDeviceLinkTests/RPCSpecs/NotificationSpecs/SDLOnButtonPressSpec.m @@ -11,7 +11,8 @@ #import "SDLButtonName.h" #import "SDLButtonPressMode.h" #import "SDLOnButtonPress.h" -#import "SDLNames.h" +#import "SDLRPCParameterNames.h" +#import "SDLRPCFunctionNames.h" QuickSpecBegin(SDLOnButtonPressSpec) @@ -30,12 +31,12 @@ describe(@"Getter/Setter Tests", ^ { }); it(@"Should get correctly when initialized", ^ { - NSMutableDictionary* dict = [@{SDLNameNotification: - @{SDLNameParameters: - @{SDLNameButtonName:SDLButtonNameCustomButton, - SDLNameButtonPressMode:SDLButtonPressModeLong, - SDLNameCustomButtonId:@5642}, - SDLNameOperationName:SDLNameOnButtonPress}} mutableCopy]; + NSMutableDictionary* dict = [@{SDLRPCParameterNameNotification: + @{SDLRPCParameterNameParameters: + @{SDLRPCParameterNameButtonName:SDLButtonNameCustomButton, + SDLRPCParameterNameButtonPressMode:SDLButtonPressModeLong, + SDLRPCParameterNameCustomButtonId:@5642}, + SDLRPCParameterNameOperationName:SDLRPCFunctionNameOnButtonPress}} mutableCopy]; SDLOnButtonPress* testNotification = [[SDLOnButtonPress alloc] initWithDictionary:dict]; expect(testNotification.buttonName).to(equal(SDLButtonNameCustomButton)); diff --git a/SmartDeviceLinkTests/RPCSpecs/NotificationSpecs/SDLOnCommandSpec.m b/SmartDeviceLinkTests/RPCSpecs/NotificationSpecs/SDLOnCommandSpec.m index 6257a13cb..aac8b32b1 100644 --- a/SmartDeviceLinkTests/RPCSpecs/NotificationSpecs/SDLOnCommandSpec.m +++ b/SmartDeviceLinkTests/RPCSpecs/NotificationSpecs/SDLOnCommandSpec.m @@ -8,7 +8,8 @@ #import <Quick/Quick.h> #import <Nimble/Nimble.h> -#import "SDLNames.h" +#import "SDLRPCParameterNames.h" +#import "SDLRPCFunctionNames.h" #import "SDLOnCommand.h" #import "SDLTriggerSource.h" @@ -26,11 +27,11 @@ describe(@"Getter/Setter Tests", ^ { }); it(@"Should get correctly when initialized", ^ { - NSMutableDictionary* dict = [@{SDLNameNotification: - @{SDLNameParameters: - @{SDLNameCommandId:@5676544, - SDLNameTriggerSource:SDLTriggerSourceKeyboard}, - SDLNameOperationName:SDLNameOnCommand}} mutableCopy]; + NSMutableDictionary* dict = [@{SDLRPCParameterNameNotification: + @{SDLRPCParameterNameParameters: + @{SDLRPCParameterNameCommandId:@5676544, + SDLRPCParameterNameTriggerSource:SDLTriggerSourceKeyboard}, + SDLRPCParameterNameOperationName:SDLRPCFunctionNameOnCommand}} mutableCopy]; SDLOnCommand* testNotification = [[SDLOnCommand alloc] initWithDictionary:dict]; expect(testNotification.cmdID).to(equal(@5676544)); diff --git a/SmartDeviceLinkTests/RPCSpecs/NotificationSpecs/SDLOnDriverDistractionSpec.m b/SmartDeviceLinkTests/RPCSpecs/NotificationSpecs/SDLOnDriverDistractionSpec.m index b46e31ee6..b03394532 100644 --- a/SmartDeviceLinkTests/RPCSpecs/NotificationSpecs/SDLOnDriverDistractionSpec.m +++ b/SmartDeviceLinkTests/RPCSpecs/NotificationSpecs/SDLOnDriverDistractionSpec.m @@ -10,7 +10,8 @@ #import "SDLDriverDistractionState.h" #import "SDLOnDriverDistraction.h" -#import "SDLNames.h" +#import "SDLRPCParameterNames.h" +#import "SDLRPCFunctionNames.h" QuickSpecBegin(SDLOnDriverDistractionSpec) @@ -24,10 +25,10 @@ describe(@"Getter/Setter Tests", ^ { }); it(@"Should get correctly when initialized", ^ { - NSMutableDictionary* dict = [@{SDLNameNotification: - @{SDLNameParameters: - @{SDLNameState:SDLDriverDistractionStateOn}, - SDLNameOperationName:SDLNameOnDriverDistraction}} mutableCopy]; + NSMutableDictionary* dict = [@{SDLRPCParameterNameNotification: + @{SDLRPCParameterNameParameters: + @{SDLRPCParameterNameState:SDLDriverDistractionStateOn}, + SDLRPCParameterNameOperationName:SDLRPCFunctionNameOnDriverDistraction}} mutableCopy]; SDLOnDriverDistraction* testNotification = [[SDLOnDriverDistraction alloc] initWithDictionary:dict]; expect(testNotification.state).to(equal(SDLDriverDistractionStateOn)); diff --git a/SmartDeviceLinkTests/RPCSpecs/NotificationSpecs/SDLOnEncodedSyncPDataSpec.m b/SmartDeviceLinkTests/RPCSpecs/NotificationSpecs/SDLOnEncodedSyncPDataSpec.m index b3fd3447e..c3cf634b8 100644 --- a/SmartDeviceLinkTests/RPCSpecs/NotificationSpecs/SDLOnEncodedSyncPDataSpec.m +++ b/SmartDeviceLinkTests/RPCSpecs/NotificationSpecs/SDLOnEncodedSyncPDataSpec.m @@ -9,7 +9,8 @@ #import <Nimble/Nimble.h> #import "SDLOnEncodedSyncPData.h" -#import "SDLNames.h" +#import "SDLRPCParameterNames.h" +#import "SDLRPCFunctionNames.h" QuickSpecBegin(SDLOnEncodedSyncPDataSpec) @@ -27,12 +28,12 @@ describe(@"Getter/Setter Tests", ^ { }); it(@"Should get correctly when initialized", ^ { - NSMutableDictionary<NSString *, id> *dict = [@{SDLNameNotification: - @{SDLNameParameters: - @{SDLNameData:[@[@0] mutableCopy], - SDLNameURLUppercase:@"www.zombo.com", - SDLNameTimeoutCapitalized:@564}, - SDLNameOperationName:SDLNameOnEncodedSyncPData}} mutableCopy]; + NSMutableDictionary<NSString *, id> *dict = [@{SDLRPCParameterNameNotification: + @{SDLRPCParameterNameParameters: + @{SDLRPCParameterNameData:[@[@0] mutableCopy], + SDLRPCParameterNameURLUppercase:@"www.zombo.com", + SDLRPCParameterNameTimeoutCapitalized:@564}, + SDLRPCParameterNameOperationName:SDLRPCFunctionNameOnEncodedSyncPData}} mutableCopy]; SDLOnEncodedSyncPData* testNotification = [[SDLOnEncodedSyncPData alloc] initWithDictionary:dict]; expect(testNotification.data).to(equal([@[@0] mutableCopy])); diff --git a/SmartDeviceLinkTests/RPCSpecs/NotificationSpecs/SDLOnHMIStatusSpec.m b/SmartDeviceLinkTests/RPCSpecs/NotificationSpecs/SDLOnHMIStatusSpec.m index 649e7aa74..c3aca6127 100644 --- a/SmartDeviceLinkTests/RPCSpecs/NotificationSpecs/SDLOnHMIStatusSpec.m +++ b/SmartDeviceLinkTests/RPCSpecs/NotificationSpecs/SDLOnHMIStatusSpec.m @@ -11,7 +11,8 @@ #import "SDLAudioStreamingState.h" #import "SDLHMILevel.h" #import "SDLOnHMIStatus.h" -#import "SDLNames.h" +#import "SDLRPCParameterNames.h" +#import "SDLRPCFunctionNames.h" #import "SDLSystemContext.h" @@ -33,13 +34,13 @@ describe(@"Getter/Setter Tests", ^ { }); it(@"Should get correctly when initialized", ^ { - NSMutableDictionary* dict = [@{SDLNameNotification: - @{SDLNameParameters: - @{SDLNameHMILevel: SDLHMILevelLimited, - SDLNameAudioStreamingState: SDLAudioStreamingStateAttenuated, - SDLNameSystemContext: SDLSystemContextHMIObscured, - SDLNameVideoStreamingState: SDLVideoStreamingStateStreamable}, - SDLNameOperationName:SDLNameOnHMIStatus}} mutableCopy]; + NSMutableDictionary* dict = [@{SDLRPCParameterNameNotification: + @{SDLRPCParameterNameParameters: + @{SDLRPCParameterNameHMILevel: SDLHMILevelLimited, + SDLRPCParameterNameAudioStreamingState: SDLAudioStreamingStateAttenuated, + SDLRPCParameterNameSystemContext: SDLSystemContextHMIObscured, + SDLRPCParameterNameVideoStreamingState: SDLVideoStreamingStateStreamable}, + SDLRPCParameterNameOperationName:SDLRPCFunctionNameOnHMIStatus}} mutableCopy]; SDLOnHMIStatus* testNotification = [[SDLOnHMIStatus alloc] initWithDictionary:dict]; expect(testNotification.hmiLevel).to(equal(SDLHMILevelLimited)); diff --git a/SmartDeviceLinkTests/RPCSpecs/NotificationSpecs/SDLOnHashChangeSpec.m b/SmartDeviceLinkTests/RPCSpecs/NotificationSpecs/SDLOnHashChangeSpec.m index 14148d4ad..035afda9d 100644 --- a/SmartDeviceLinkTests/RPCSpecs/NotificationSpecs/SDLOnHashChangeSpec.m +++ b/SmartDeviceLinkTests/RPCSpecs/NotificationSpecs/SDLOnHashChangeSpec.m @@ -9,7 +9,8 @@ #import <Nimble/Nimble.h> #import "SDLOnHashChange.h" -#import "SDLNames.h" +#import "SDLRPCParameterNames.h" +#import "SDLRPCFunctionNames.h" QuickSpecBegin(SDLOnHashChangeSpec) @@ -23,10 +24,10 @@ describe(@"Getter/Setter Tests", ^ { }); it(@"Should get correctly when initialized", ^ { - NSMutableDictionary<NSString *, id> *dict = [@{SDLNameNotification: - @{SDLNameParameters: - @{SDLNameHashId:@"hash"}, - SDLNameOperationName:SDLNameOnHashChange}} mutableCopy]; + NSMutableDictionary<NSString *, id> *dict = [@{SDLRPCParameterNameNotification: + @{SDLRPCParameterNameParameters: + @{SDLRPCParameterNameHashId:@"hash"}, + SDLRPCParameterNameOperationName:SDLRPCFunctionNameOnHashChange}} mutableCopy]; SDLOnHashChange* testNotification = [[SDLOnHashChange alloc] initWithDictionary:dict]; expect(testNotification.hashID).to(equal(@"hash")); diff --git a/SmartDeviceLinkTests/RPCSpecs/NotificationSpecs/SDLOnInteriorVehicleDataSpec.m b/SmartDeviceLinkTests/RPCSpecs/NotificationSpecs/SDLOnInteriorVehicleDataSpec.m index 0a4badfe2..45ae4c993 100644 --- a/SmartDeviceLinkTests/RPCSpecs/NotificationSpecs/SDLOnInteriorVehicleDataSpec.m +++ b/SmartDeviceLinkTests/RPCSpecs/NotificationSpecs/SDLOnInteriorVehicleDataSpec.m @@ -9,7 +9,8 @@ #import <Nimble/Nimble.h> #import "SDLOnInteriorVehicleData.h" -#import "SDLNames.h" +#import "SDLRPCParameterNames.h" +#import "SDLRPCFunctionNames.h" #import "SDLModuleData.h" QuickSpecBegin(SDLOnInteriorVehicleDataSpec) @@ -30,10 +31,10 @@ describe(@"Getter/Setter Tests", ^ { }); it(@"Should get correctly when initialized", ^ { - NSMutableDictionary<NSString *, id> *dict = [@{SDLNameNotification: - @{SDLNameParameters: - @{SDLNameModuleData:someModuleData}, - SDLNameOperationName:SDLNameOnInteriorVehicleData}} mutableCopy]; + NSMutableDictionary<NSString *, id> *dict = [@{SDLRPCParameterNameNotification: + @{SDLRPCParameterNameParameters: + @{SDLRPCParameterNameModuleData:someModuleData}, + SDLRPCParameterNameOperationName:SDLRPCFunctionNameOnInteriorVehicleData}} mutableCopy]; SDLOnInteriorVehicleData* testNotification = [[SDLOnInteriorVehicleData alloc] initWithDictionary:dict]; expect(testNotification.moduleData).to(equal(someModuleData)); diff --git a/SmartDeviceLinkTests/RPCSpecs/NotificationSpecs/SDLOnKeyboardInputSpec.m b/SmartDeviceLinkTests/RPCSpecs/NotificationSpecs/SDLOnKeyboardInputSpec.m index 4f64d8f37..baec5f3c7 100644 --- a/SmartDeviceLinkTests/RPCSpecs/NotificationSpecs/SDLOnKeyboardInputSpec.m +++ b/SmartDeviceLinkTests/RPCSpecs/NotificationSpecs/SDLOnKeyboardInputSpec.m @@ -10,7 +10,8 @@ #import "SDLKeyboardEvent.h" #import "SDLOnKeyboardInput.h" -#import "SDLNames.h" +#import "SDLRPCParameterNames.h" +#import "SDLRPCFunctionNames.h" QuickSpecBegin(SDLOnKeyboardInputSpec) @@ -26,11 +27,11 @@ describe(@"Getter/Setter Tests", ^ { }); it(@"Should get correctly when initialized", ^ { - NSMutableDictionary* dict = [@{SDLNameNotification: - @{SDLNameParameters: - @{SDLNameEvent:SDLKeyboardEventSubmitted, - SDLNameData:@"qwertyg"}, - SDLNameOperationName:SDLNameOnKeyboardInput}} mutableCopy]; + NSMutableDictionary* dict = [@{SDLRPCParameterNameNotification: + @{SDLRPCParameterNameParameters: + @{SDLRPCParameterNameEvent:SDLKeyboardEventSubmitted, + SDLRPCParameterNameData:@"qwertyg"}, + SDLRPCParameterNameOperationName:SDLRPCFunctionNameOnKeyboardInput}} mutableCopy]; SDLOnKeyboardInput* testNotification = [[SDLOnKeyboardInput alloc] initWithDictionary:dict]; expect(testNotification.event).to(equal(SDLKeyboardEventSubmitted)); diff --git a/SmartDeviceLinkTests/RPCSpecs/NotificationSpecs/SDLOnLanguageChangeSpec.m b/SmartDeviceLinkTests/RPCSpecs/NotificationSpecs/SDLOnLanguageChangeSpec.m index 6dfa256f6..c8e589a54 100644 --- a/SmartDeviceLinkTests/RPCSpecs/NotificationSpecs/SDLOnLanguageChangeSpec.m +++ b/SmartDeviceLinkTests/RPCSpecs/NotificationSpecs/SDLOnLanguageChangeSpec.m @@ -10,7 +10,8 @@ #import "SDLLanguage.h" #import "SDLOnLanguageChange.h" -#import "SDLNames.h" +#import "SDLRPCParameterNames.h" +#import "SDLRPCFunctionNames.h" QuickSpecBegin(SDLOnLanguageChangeSpec) @@ -27,11 +28,11 @@ describe(@"Getter/Setter Tests", ^ { }); it(@"Should get correctly when initialized", ^ { - NSMutableDictionary* dict = [@{SDLNameNotification: - @{SDLNameParameters: - @{SDLNameLanguage:SDLLanguageEsEs, - SDLNameHMIDisplayLanguage:SDLLanguageDeDe}, - SDLNameOperationName:SDLNameOnLanguageChange}} mutableCopy]; + NSMutableDictionary* dict = [@{SDLRPCParameterNameNotification: + @{SDLRPCParameterNameParameters: + @{SDLRPCParameterNameLanguage:SDLLanguageEsEs, + SDLRPCParameterNameHMIDisplayLanguage:SDLLanguageDeDe}, + SDLRPCParameterNameOperationName:SDLRPCFunctionNameOnLanguageChange}} mutableCopy]; SDLOnLanguageChange* testNotification = [[SDLOnLanguageChange alloc] initWithDictionary:dict]; expect(testNotification.language).to(equal(SDLLanguageEsEs)); diff --git a/SmartDeviceLinkTests/RPCSpecs/NotificationSpecs/SDLOnLockScreenStatusSpec.m b/SmartDeviceLinkTests/RPCSpecs/NotificationSpecs/SDLOnLockScreenStatusSpec.m index c2e64ef3a..3355797d8 100644 --- a/SmartDeviceLinkTests/RPCSpecs/NotificationSpecs/SDLOnLockScreenStatusSpec.m +++ b/SmartDeviceLinkTests/RPCSpecs/NotificationSpecs/SDLOnLockScreenStatusSpec.m @@ -11,7 +11,8 @@ #import "SDLOnLockScreenStatus.h" #import "SDLHMILevel.h" #import "SDLLockScreenStatus.h" -#import "SDLNames.h" +#import "SDLRPCParameterNames.h" +#import "SDLRPCFunctionNames.h" QuickSpecBegin(SDLOnLockScreenStatusSpec) @@ -31,13 +32,13 @@ describe(@"Getter/Setter Tests", ^ { }); it(@"Should get correctly when initialized", ^ { - NSMutableDictionary* dict = [@{SDLNameNotification: - @{SDLNameParameters: + NSMutableDictionary* dict = [@{SDLRPCParameterNameNotification: + @{SDLRPCParameterNameParameters: @{@"driverDistractionStatus":@NO, @"userSelected":@3, @"OnLockScreenStatus":SDLLockScreenStatusRequired, @"hmiLevel":SDLHMILevelNone}, - SDLNameOperationName:@"OnLockScreenStatus"}} mutableCopy]; + SDLRPCParameterNameOperationName:@"OnLockScreenStatus"}} mutableCopy]; SDLOnLockScreenStatus* testNotification = [[SDLOnLockScreenStatus alloc] initWithDictionary:dict]; expect(testNotification.driverDistractionStatus).to(equal(@NO)); diff --git a/SmartDeviceLinkTests/RPCSpecs/NotificationSpecs/SDLOnPermissionsChangeSpec.m b/SmartDeviceLinkTests/RPCSpecs/NotificationSpecs/SDLOnPermissionsChangeSpec.m index a66e22654..70e5c103a 100644 --- a/SmartDeviceLinkTests/RPCSpecs/NotificationSpecs/SDLOnPermissionsChangeSpec.m +++ b/SmartDeviceLinkTests/RPCSpecs/NotificationSpecs/SDLOnPermissionsChangeSpec.m @@ -10,7 +10,8 @@ #import "SDLOnPermissionsChange.h" #import "SDLPermissionItem.h" -#import "SDLNames.h" +#import "SDLRPCParameterNames.h" +#import "SDLRPCFunctionNames.h" QuickSpecBegin(SDLOnPermissionsChangeSpec) @@ -26,10 +27,10 @@ describe(@"Getter/Setter Tests", ^ { }); it(@"Should get correctly when initialized", ^ { - NSMutableDictionary<NSString *, id> *dict = [@{SDLNameNotification: - @{SDLNameParameters: - @{SDLNamePermissionItem:[@[item] mutableCopy]}, - SDLNameOperationName:SDLNameOnPermissionsChange}} mutableCopy]; + NSMutableDictionary<NSString *, id> *dict = [@{SDLRPCParameterNameNotification: + @{SDLRPCParameterNameParameters: + @{SDLRPCParameterNamePermissionItem:[@[item] mutableCopy]}, + SDLRPCParameterNameOperationName:SDLRPCFunctionNameOnPermissionsChange}} mutableCopy]; SDLOnPermissionsChange* testNotification = [[SDLOnPermissionsChange alloc] initWithDictionary:dict]; expect(testNotification.permissionItem).to(equal([@[item] mutableCopy])); diff --git a/SmartDeviceLinkTests/RPCSpecs/NotificationSpecs/SDLOnRCStatusSpec.m b/SmartDeviceLinkTests/RPCSpecs/NotificationSpecs/SDLOnRCStatusSpec.m index 4f733d7a8..584bcd3ec 100644 --- a/SmartDeviceLinkTests/RPCSpecs/NotificationSpecs/SDLOnRCStatusSpec.m +++ b/SmartDeviceLinkTests/RPCSpecs/NotificationSpecs/SDLOnRCStatusSpec.m @@ -8,7 +8,8 @@ #import "SDLOnRCStatus.h" #import "SDLModuleData.h" -#import "SDLNames.h" +#import "SDLRPCParameterNames.h" +#import "SDLRPCFunctionNames.h" QuickSpecBegin(SDLOnRCStatusSpec) SDLModuleData * allocatedModule = [[SDLModuleData alloc] init]; @@ -28,13 +29,13 @@ describe(@"Getter/Setter Tests", ^ { }); it(@"Should get correctly when initialized", ^ { - NSMutableDictionary<NSString *, id> *dict = [@{SDLNameNotification: - @{SDLNameParameters: - @{SDLNameAllocatedModules:[@[allocatedModule] copy], - SDLNameFreeModules:[@[freeModule] copy], - SDLNameAllowed:@YES + NSMutableDictionary<NSString *, id> *dict = [@{SDLRPCParameterNameNotification: + @{SDLRPCParameterNameParameters: + @{SDLRPCParameterNameAllocatedModules:[@[allocatedModule] copy], + SDLRPCParameterNameFreeModules:[@[freeModule] copy], + SDLRPCParameterNameAllowed:@YES }, - SDLNameOperationName:SDLNameOnRCStatus}} mutableCopy]; + SDLRPCParameterNameOperationName:SDLRPCFunctionNameOnRCStatus}} mutableCopy]; SDLOnRCStatus* testNotification = [[SDLOnRCStatus alloc] initWithDictionary:dict]; expect(testNotification.allowed).to(equal(@YES)); diff --git a/SmartDeviceLinkTests/RPCSpecs/NotificationSpecs/SDLOnSyncPDataSpec.m b/SmartDeviceLinkTests/RPCSpecs/NotificationSpecs/SDLOnSyncPDataSpec.m index c14fe1d52..89f0d5b7e 100644 --- a/SmartDeviceLinkTests/RPCSpecs/NotificationSpecs/SDLOnSyncPDataSpec.m +++ b/SmartDeviceLinkTests/RPCSpecs/NotificationSpecs/SDLOnSyncPDataSpec.m @@ -9,7 +9,8 @@ #import <Nimble/Nimble.h> #import "SDLOnSyncPData.h" -#import "SDLNames.h" +#import "SDLRPCParameterNames.h" +#import "SDLRPCFunctionNames.h" QuickSpecBegin(SDLOnSyncPDataSpec) @@ -25,11 +26,11 @@ describe(@"Getter/Setter Tests", ^ { }); it(@"Should get correctly when initialized", ^ { - NSMutableDictionary<NSString *, id> *dict = [@{SDLNameNotification: - @{SDLNameParameters: - @{SDLNameURLUppercase:@"https://www.youtube.com/watch?v=ygr5AHufBN4", - SDLNameTimeoutCapitalized:@8357}, - SDLNameOperationName:SDLNameOnSyncPData}} mutableCopy]; + NSMutableDictionary<NSString *, id> *dict = [@{SDLRPCParameterNameNotification: + @{SDLRPCParameterNameParameters: + @{SDLRPCParameterNameURLUppercase:@"https://www.youtube.com/watch?v=ygr5AHufBN4", + SDLRPCParameterNameTimeoutCapitalized:@8357}, + SDLRPCParameterNameOperationName:SDLRPCFunctionNameOnSyncPData}} mutableCopy]; SDLOnSyncPData* testNotification = [[SDLOnSyncPData alloc] initWithDictionary:dict]; expect(testNotification.URL).to(equal(@"https://www.youtube.com/watch?v=ygr5AHufBN4")); diff --git a/SmartDeviceLinkTests/RPCSpecs/NotificationSpecs/SDLOnSystemCapabilityUpdatedSpec.m b/SmartDeviceLinkTests/RPCSpecs/NotificationSpecs/SDLOnSystemCapabilityUpdatedSpec.m new file mode 100644 index 000000000..b6102042d --- /dev/null +++ b/SmartDeviceLinkTests/RPCSpecs/NotificationSpecs/SDLOnSystemCapabilityUpdatedSpec.m @@ -0,0 +1,59 @@ +// +// SDLOnSystemCapabilityUpdatedSpec.m +// SmartDeviceLinkTests +// +// Created by Nicole on 2/6/19. +// Copyright © 2019 smartdevicelink. All rights reserved. +// + +#import <Quick/Quick.h> +#import <Nimble/Nimble.h> + +#import "SDLOnSystemCapabilityUpdated.h" +#import "SDLPhoneCapability.h" +#import "SDLRPCParameterNames.h" +#import "SDLRPCFunctionNames.h" +#import "SDLSystemCapability.h" + +QuickSpecBegin(SDLOnSystemCapabilityUpdatedSpec) + +describe(@"Getter/Setter Tests", ^ { + __block SDLSystemCapability *testSystemCapability = nil; + + beforeEach(^{ + SDLPhoneCapability *testPhoneCapability = [[SDLPhoneCapability alloc] initWithDialNumber:true]; + testSystemCapability = [[SDLSystemCapability alloc] initWithPhoneCapability:testPhoneCapability]; + }); + + it(@"Should set and get correctly", ^{ + SDLOnSystemCapabilityUpdated *testNotification = [[SDLOnSystemCapabilityUpdated alloc] init]; + testNotification.systemCapability = testSystemCapability; + + expect(testNotification.systemCapability).to(equal(testSystemCapability)); + }); + + it(@"Should get correctly when initialized with a dictionary", ^{ + NSDictionary *dict = @{SDLRPCParameterNameNotification:@{ + SDLRPCParameterNameParameters:@{ + SDLRPCParameterNameSystemCapability:testSystemCapability + }, + SDLRPCParameterNameOperationName:SDLRPCFunctionNameOnSystemCapabilityUpdated}}; + SDLOnSystemCapabilityUpdated *testNotification = [[SDLOnSystemCapabilityUpdated alloc] initWithDictionary:dict]; + + expect(testNotification.systemCapability).to(equal(testSystemCapability)); + }); + + it(@"Should get correctly when initialized with initWithSystemCapability:", ^{ + SDLOnSystemCapabilityUpdated *testNotification = [[SDLOnSystemCapabilityUpdated alloc] initWithSystemCapability:testSystemCapability]; + + expect(testNotification.systemCapability).to(equal(testSystemCapability)); + }); + + it(@"Should return nil if not set", ^{ + SDLOnSystemCapabilityUpdated *testNotification = [[SDLOnSystemCapabilityUpdated alloc] init]; + + expect(testNotification.systemCapability).to(beNil()); + }); +}); + +QuickSpecEnd diff --git a/SmartDeviceLinkTests/RPCSpecs/NotificationSpecs/SDLOnSystemRequestSpec.m b/SmartDeviceLinkTests/RPCSpecs/NotificationSpecs/SDLOnSystemRequestSpec.m index 6f7545c68..0f2227ff7 100644 --- a/SmartDeviceLinkTests/RPCSpecs/NotificationSpecs/SDLOnSystemRequestSpec.m +++ b/SmartDeviceLinkTests/RPCSpecs/NotificationSpecs/SDLOnSystemRequestSpec.m @@ -9,7 +9,8 @@ #import <Nimble/Nimble.h> #import "SDLFileType.h" -#import "SDLNames.h" +#import "SDLRPCParameterNames.h" +#import "SDLRPCFunctionNames.h" #import "SDLOnSystemRequest.h" #import "SDLRequestType.h" @@ -38,16 +39,16 @@ describe(@"Getter/Setter Tests", ^ { }); it(@"Should get correctly when initialized", ^ { - NSMutableDictionary* dict = [@{SDLNameNotification: - @{SDLNameParameters: - @{SDLNameRequestType:SDLRequestTypeFileResume, - SDLNameRequestSubType: @"subtype", - SDLNameURL:[@[@"www.google.com"] mutableCopy], - SDLNameTimeout:@52345, - SDLNameFileType:SDLFileTypePNG, - SDLNameOffset:@2532678684, - SDLNameLength:@50000000000}, - SDLNameOperationName:SDLNameOnSystemRequest}} mutableCopy]; + NSMutableDictionary* dict = [@{SDLRPCParameterNameNotification: + @{SDLRPCParameterNameParameters: + @{SDLRPCParameterNameRequestType:SDLRequestTypeFileResume, + SDLRPCParameterNameRequestSubType: @"subtype", + SDLRPCParameterNameURL:[@[@"www.google.com"] mutableCopy], + SDLRPCParameterNameTimeout:@52345, + SDLRPCParameterNameFileType:SDLFileTypePNG, + SDLRPCParameterNameOffset:@2532678684, + SDLRPCParameterNameLength:@50000000000}, + SDLRPCParameterNameOperationName:SDLRPCFunctionNameOnSystemRequest}} mutableCopy]; SDLOnSystemRequest* testNotification = [[SDLOnSystemRequest alloc] initWithDictionary:dict]; expect(testNotification.requestType).to(equal(SDLRequestTypeFileResume)); diff --git a/SmartDeviceLinkTests/RPCSpecs/NotificationSpecs/SDLOnTBTClientStateSpec.m b/SmartDeviceLinkTests/RPCSpecs/NotificationSpecs/SDLOnTBTClientStateSpec.m index 70ed4648b..f0a39c387 100644 --- a/SmartDeviceLinkTests/RPCSpecs/NotificationSpecs/SDLOnTBTClientStateSpec.m +++ b/SmartDeviceLinkTests/RPCSpecs/NotificationSpecs/SDLOnTBTClientStateSpec.m @@ -9,7 +9,8 @@ #import <Nimble/Nimble.h> #import "SDLOnTBTClientState.h" -#import "SDLNames.h" +#import "SDLRPCParameterNames.h" +#import "SDLRPCFunctionNames.h" #import "SDLTBTState.h" @@ -25,10 +26,10 @@ describe(@"Getter/Setter Tests", ^ { }); it(@"Should get correctly when initialized", ^ { - NSMutableDictionary* dict = [@{SDLNameNotification: - @{SDLNameParameters: - @{SDLNameState:SDLTBTStateETARequest}, - SDLNameOperationName:SDLNameOnTBTClientState}} mutableCopy]; + NSMutableDictionary* dict = [@{SDLRPCParameterNameNotification: + @{SDLRPCParameterNameParameters: + @{SDLRPCParameterNameState:SDLTBTStateETARequest}, + SDLRPCParameterNameOperationName:SDLRPCFunctionNameOnTBTClientState}} mutableCopy]; SDLOnTBTClientState* testNotification = [[SDLOnTBTClientState alloc] initWithDictionary:dict]; expect(testNotification.state).to(equal(SDLTBTStateETARequest)); diff --git a/SmartDeviceLinkTests/RPCSpecs/NotificationSpecs/SDLOnTouchEventSpec.m b/SmartDeviceLinkTests/RPCSpecs/NotificationSpecs/SDLOnTouchEventSpec.m index 930ed95f8..6445c2e64 100644 --- a/SmartDeviceLinkTests/RPCSpecs/NotificationSpecs/SDLOnTouchEventSpec.m +++ b/SmartDeviceLinkTests/RPCSpecs/NotificationSpecs/SDLOnTouchEventSpec.m @@ -9,7 +9,8 @@ #import <Nimble/Nimble.h> #import "SDLOnTouchEvent.h" -#import "SDLNames.h" +#import "SDLRPCParameterNames.h" +#import "SDLRPCFunctionNames.h" #import "SDLTouchEvent.h" #import "SDLTouchType.h" @@ -30,11 +31,11 @@ describe(@"Getter/Setter Tests", ^ { }); it(@"Should get correctly when initialized", ^ { - NSMutableDictionary* dict = [@{SDLNameNotification: - @{SDLNameParameters: - @{SDLNameType:SDLTouchTypeBegin, - SDLNameEvent:[@[event] mutableCopy]}, - SDLNameOperationName:SDLNameOnTouchEvent}} mutableCopy]; + NSMutableDictionary* dict = [@{SDLRPCParameterNameNotification: + @{SDLRPCParameterNameParameters: + @{SDLRPCParameterNameType:SDLTouchTypeBegin, + SDLRPCParameterNameEvent:[@[event] mutableCopy]}, + SDLRPCParameterNameOperationName:SDLRPCFunctionNameOnTouchEvent}} mutableCopy]; SDLOnTouchEvent* testNotification = [[SDLOnTouchEvent alloc] initWithDictionary:dict]; expect(testNotification.type).to(equal(SDLTouchTypeBegin)); diff --git a/SmartDeviceLinkTests/RPCSpecs/NotificationSpecs/SDLOnVehicleDataSpec.m b/SmartDeviceLinkTests/RPCSpecs/NotificationSpecs/SDLOnVehicleDataSpec.m index a743fc0d9..d28a9c843 100644 --- a/SmartDeviceLinkTests/RPCSpecs/NotificationSpecs/SDLOnVehicleDataSpec.m +++ b/SmartDeviceLinkTests/RPCSpecs/NotificationSpecs/SDLOnVehicleDataSpec.m @@ -9,7 +9,8 @@ #import <Nimble/Nimble.h> #import "SmartDeviceLink.h" -#import "SDLNames.h" +#import "SDLRPCParameterNames.h" +#import "SDLRPCFunctionNames.h" QuickSpecBegin(SDLOnVehicleDataSpec) @@ -112,39 +113,39 @@ describe(@"Getter/Setter Tests", ^ { }); it(@"Should get correctly when initialized", ^ { - NSDictionary* dict = @{SDLNameNotification: - @{SDLNameParameters: - @{SDLNameAccelerationPedalPosition:@99.99999999, - SDLNameAirbagStatus:airbag, - SDLNameBeltStatus:belt, - SDLNameBodyInformation:body, - SDLNameCloudAppVehicleID:cloudAppVehicleID, - SDLNameClusterModeStatus:clusterMode, - SDLNameDeviceStatus:device, - SDLNameDriverBraking:SDLVehicleDataEventStatusYes, - SDLNameECallInfo:eCall, - SDLNameElectronicParkBrakeStatus:SDLElectronicParkBrakeStatusDriveActive, - SDLNameEmergencyEvent:event, - SDLNameEngineOilLife:@45.1, - SDLNameEngineTorque:@-200.124, - SDLNameExternalTemperature:@-10, - SDLNameFuelLevel:@10.3, - SDLNameFuelLevelState:SDLComponentVolumeStatusAlert, - SDLNameFuelRange:@[fuelRange], - SDLNameGPS:gps, - SDLNameHeadLampStatus:headLamp, - SDLNameInstantFuelConsumption:@4000.63, - SDLNameMyKey:myKey, - SDLNameOdometer:@100050, - SDLNamePRNDL:SDLPRNDLDrive, - SDLNameRPM:@4242, - SDLNameSpeed:@70.1, - SDLNameSteeringWheelAngle:@0.000000001, - SDLNameTirePressure:tires, - SDLNameTurnSignal:SDLTurnSignalOff, - SDLNameVIN:@"222222222722", - SDLNameWiperStatus:SDLWiperStatusStalled}, - SDLNameOperationName:SDLNameOnVehicleData}}; + NSDictionary* dict = @{SDLRPCParameterNameNotification: + @{SDLRPCParameterNameParameters: + @{SDLRPCParameterNameAccelerationPedalPosition:@99.99999999, + SDLRPCParameterNameAirbagStatus:airbag, + SDLRPCParameterNameBeltStatus:belt, + SDLRPCParameterNameBodyInformation:body, + SDLRPCParameterNameCloudAppVehicleID:cloudAppVehicleID, + SDLRPCParameterNameClusterModeStatus:clusterMode, + SDLRPCParameterNameDeviceStatus:device, + SDLRPCParameterNameDriverBraking:SDLVehicleDataEventStatusYes, + SDLRPCParameterNameECallInfo:eCall, + SDLRPCParameterNameElectronicParkBrakeStatus:SDLElectronicParkBrakeStatusDriveActive, + SDLRPCParameterNameEmergencyEvent:event, + SDLRPCParameterNameEngineOilLife:@45.1, + SDLRPCParameterNameEngineTorque:@-200.124, + SDLRPCParameterNameExternalTemperature:@-10, + SDLRPCParameterNameFuelLevel:@10.3, + SDLRPCParameterNameFuelLevelState:SDLComponentVolumeStatusAlert, + SDLRPCParameterNameFuelRange:@[fuelRange], + SDLRPCParameterNameGPS:gps, + SDLRPCParameterNameHeadLampStatus:headLamp, + SDLRPCParameterNameInstantFuelConsumption:@4000.63, + SDLRPCParameterNameMyKey:myKey, + SDLRPCParameterNameOdometer:@100050, + SDLRPCParameterNamePRNDL:SDLPRNDLDrive, + SDLRPCParameterNameRPM:@4242, + SDLRPCParameterNameSpeed:@70.1, + SDLRPCParameterNameSteeringWheelAngle:@0.000000001, + SDLRPCParameterNameTirePressure:tires, + SDLRPCParameterNameTurnSignal:SDLTurnSignalOff, + SDLRPCParameterNameVIN:@"222222222722", + SDLRPCParameterNameWiperStatus:SDLWiperStatusStalled}, + SDLRPCParameterNameOperationName:SDLRPCFunctionNameOnVehicleData}}; SDLOnVehicleData* testNotification = [[SDLOnVehicleData alloc] initWithDictionary:dict]; expect(testNotification.accPedalPosition).to(equal(@99.99999999)); diff --git a/SmartDeviceLinkTests/RPCSpecs/NotificationSpecs/SDLOnWaypointChangeSpec.m b/SmartDeviceLinkTests/RPCSpecs/NotificationSpecs/SDLOnWaypointChangeSpec.m index bee2e3cda..94e319360 100644 --- a/SmartDeviceLinkTests/RPCSpecs/NotificationSpecs/SDLOnWaypointChangeSpec.m +++ b/SmartDeviceLinkTests/RPCSpecs/NotificationSpecs/SDLOnWaypointChangeSpec.m @@ -11,7 +11,8 @@ #import "SDLImage.h" #import "SDLLocationCoordinate.h" #import "SDLLocationDetails.h" -#import "SDLNames.h" +#import "SDLRPCParameterNames.h" +#import "SDLRPCFunctionNames.h" #import "SDLOasisAddress.h" QuickSpecBegin(SDLOnWayPointChangeSpec) @@ -63,12 +64,12 @@ describe(@"Getter/Setter Tests", ^ { someWaypoints = @[someLocation]; - NSDictionary *initDict = @{SDLNameNotification : @{ - SDLNameParameters: @{ - SDLNameWayPoints: someWaypoints + NSDictionary *initDict = @{SDLRPCParameterNameNotification : @{ + SDLRPCParameterNameParameters: @{ + SDLRPCParameterNameWayPoints: someWaypoints } }, - SDLNameOperationName:SDLNameOnWayPointChange + SDLRPCParameterNameOperationName:SDLRPCFunctionNameOnWayPointChange }; testNotification = [[SDLOnWayPointChange alloc] initWithDictionary:[NSMutableDictionary dictionaryWithDictionary:initDict]]; @@ -84,8 +85,8 @@ describe(@"Getter/Setter Tests", ^ { context(@"when parameters are not set", ^{ beforeEach(^{ NSDictionary *initDict = @{ - SDLNameNotification: @{ - SDLNameParameters: @{} + SDLRPCParameterNameNotification: @{ + SDLRPCParameterNameParameters: @{} } }; diff --git a/SmartDeviceLinkTests/RPCSpecs/PayloadSpecs/SDLRPCPayloadSpec.m b/SmartDeviceLinkTests/RPCSpecs/PayloadSpecs/SDLRPCPayloadSpec.m index cde24a77a..4139677e3 100644 --- a/SmartDeviceLinkTests/RPCSpecs/PayloadSpecs/SDLRPCPayloadSpec.m +++ b/SmartDeviceLinkTests/RPCSpecs/PayloadSpecs/SDLRPCPayloadSpec.m @@ -8,16 +8,17 @@ #import <Quick/Quick.h> #import <Nimble/Nimble.h> +#import "SDLRPCParameterNames.h" #import "SDLRPCPayload.h" #import "SDLRPCMessageType.h" -#import "SDLNames.h" +#import "SDLRPCFunctionNames.h" QuickSpecBegin(SDLRPCPayloadSpec) __block SDLRPCPayload* testPayload; -__block NSDictionary* dict = @{SDLNameResponse: - @{SDLNameParameters:@{}, - SDLNameOperationName:SDLNameDeleteCommand}}; +__block NSDictionary* dict = @{SDLRPCParameterNameResponse: + @{SDLRPCParameterNameParameters:@{}, + SDLRPCParameterNameOperationName:SDLRPCFunctionNameDeleteCommand}}; NSData* (^testData)(void) = ^NSData* { NSData* jsonData = [NSJSONSerialization dataWithJSONObject:dict options:0 error:0]; diff --git a/SmartDeviceLinkTests/RPCSpecs/RequestSpecs/SDLAddCommandSpec.m b/SmartDeviceLinkTests/RPCSpecs/RequestSpecs/SDLAddCommandSpec.m index 5f7bcf105..7d7d3214c 100644 --- a/SmartDeviceLinkTests/RPCSpecs/RequestSpecs/SDLAddCommandSpec.m +++ b/SmartDeviceLinkTests/RPCSpecs/RequestSpecs/SDLAddCommandSpec.m @@ -11,7 +11,8 @@ #import "SDLAddCommand.h" #import "SDLImage.h" #import "SDLMenuParams.h" -#import "SDLNames.h" +#import "SDLRPCParameterNames.h" +#import "SDLRPCFunctionNames.h" QuickSpecBegin(SDLAddCommandSpec) @@ -34,13 +35,13 @@ describe(@"Getter/Setter Tests", ^ { }); it(@"Should get correctly when initialized", ^ { - NSMutableDictionary<NSString *, id> *dict = [@{SDLNameRequest: - @{SDLNameParameters: - @{SDLNameCommandId:@434577, - SDLNameMenuParams:menu, - SDLNameVRCommands:[@[@"name", @"anotherName"] mutableCopy], - SDLNameCommandIcon:image}, - SDLNameOperationName:SDLNameAddCommand}} mutableCopy]; + NSMutableDictionary<NSString *, id> *dict = [@{SDLRPCParameterNameRequest: + @{SDLRPCParameterNameParameters: + @{SDLRPCParameterNameCommandId:@434577, + SDLRPCParameterNameMenuParams:menu, + SDLRPCParameterNameVRCommands:[@[@"name", @"anotherName"] mutableCopy], + SDLRPCParameterNameCommandIcon:image}, + SDLRPCParameterNameOperationName:SDLRPCFunctionNameAddCommand}} mutableCopy]; SDLAddCommand* testRequest = [[SDLAddCommand alloc] initWithDictionary:dict]; diff --git a/SmartDeviceLinkTests/RPCSpecs/RequestSpecs/SDLAddSubMenuSpec.m b/SmartDeviceLinkTests/RPCSpecs/RequestSpecs/SDLAddSubMenuSpec.m index 18f09da8e..28584c689 100644 --- a/SmartDeviceLinkTests/RPCSpecs/RequestSpecs/SDLAddSubMenuSpec.m +++ b/SmartDeviceLinkTests/RPCSpecs/RequestSpecs/SDLAddSubMenuSpec.m @@ -10,7 +10,8 @@ #import "SDLAddSubMenu.h" #import "SDLImage.h" -#import "SDLNames.h" +#import "SDLRPCParameterNames.h" +#import "SDLRPCFunctionNames.h" QuickSpecBegin(SDLAddSubMenuSpec) @@ -69,16 +70,16 @@ describe(@"Getter/Setter Tests", ^ { }); it(@"Should get correctly when initialized", ^ { - NSMutableDictionary<NSString *, id> *dict = [@{SDLNameRequest: - @{SDLNameParameters: - @{SDLNameMenuId:@4345645, - SDLNamePosition:@27, - SDLNameMenuName:@"Welcome to the menu", - SDLNameMenuIcon: @{ - SDLNameValue: @"Test" + NSMutableDictionary<NSString *, id> *dict = [@{SDLRPCParameterNameRequest: + @{SDLRPCParameterNameParameters: + @{SDLRPCParameterNameMenuId:@4345645, + SDLRPCParameterNamePosition:@27, + SDLRPCParameterNameMenuName:@"Welcome to the menu", + SDLRPCParameterNameMenuIcon: @{ + SDLRPCParameterNameValue: @"Test" } }, - SDLNameOperationName:SDLNameAddSubMenu}} mutableCopy]; + SDLRPCParameterNameOperationName:SDLRPCFunctionNameAddSubMenu}} mutableCopy]; SDLAddSubMenu* testRequest = [[SDLAddSubMenu alloc] initWithDictionary:dict]; expect(testRequest.menuID).to(equal(@(menuId))); diff --git a/SmartDeviceLinkTests/RPCSpecs/RequestSpecs/SDLAlertManeuverSpec.m b/SmartDeviceLinkTests/RPCSpecs/RequestSpecs/SDLAlertManeuverSpec.m index 4d42280db..63ee96868 100644 --- a/SmartDeviceLinkTests/RPCSpecs/RequestSpecs/SDLAlertManeuverSpec.m +++ b/SmartDeviceLinkTests/RPCSpecs/RequestSpecs/SDLAlertManeuverSpec.m @@ -11,7 +11,8 @@ #import "SDLAlertManeuver.h" #import "SDLTTSChunk.h" #import "SDLSoftButton.h" -#import "SDLNames.h" +#import "SDLRPCParameterNames.h" +#import "SDLRPCFunctionNames.h" QuickSpecBegin(SDLAlertManeuverSpec) @@ -30,11 +31,11 @@ describe(@"Getter/Setter Tests", ^ { }); it(@"Should get correctly when initialized", ^ { - NSMutableDictionary<NSString *, id> *dict = [@{SDLNameRequest: - @{SDLNameParameters: - @{SDLNameTTSChunks:[@[tts] mutableCopy], - SDLNameSoftButtons:[@[button] mutableCopy]}, - SDLNameOperationName:SDLNameAlertManeuver}} mutableCopy]; + NSMutableDictionary<NSString *, id> *dict = [@{SDLRPCParameterNameRequest: + @{SDLRPCParameterNameParameters: + @{SDLRPCParameterNameTTSChunks:[@[tts] mutableCopy], + SDLRPCParameterNameSoftButtons:[@[button] mutableCopy]}, + SDLRPCParameterNameOperationName:SDLRPCFunctionNameAlertManeuver}} mutableCopy]; SDLAlertManeuver* testRequest = [[SDLAlertManeuver alloc] initWithDictionary:dict]; expect(testRequest.ttsChunks).to(equal([@[tts] mutableCopy])); diff --git a/SmartDeviceLinkTests/RPCSpecs/RequestSpecs/SDLAlertSpec.m b/SmartDeviceLinkTests/RPCSpecs/RequestSpecs/SDLAlertSpec.m index 521c8b8f3..0460df923 100644 --- a/SmartDeviceLinkTests/RPCSpecs/RequestSpecs/SDLAlertSpec.m +++ b/SmartDeviceLinkTests/RPCSpecs/RequestSpecs/SDLAlertSpec.m @@ -11,7 +11,8 @@ #import "SDLAlert.h" #import "SDLTTSChunk.h" #import "SDLSoftButton.h" -#import "SDLNames.h" +#import "SDLRPCParameterNames.h" +#import "SDLRPCFunctionNames.h" QuickSpecBegin(SDLAlertSpec) @@ -42,17 +43,17 @@ describe(@"Getter/Setter Tests", ^ { }); it(@"Should get correctly when initialized", ^ { - NSMutableDictionary<NSString *, id> *dict = [@{SDLNameRequest: - @{SDLNameParameters: - @{SDLNameAlertText1:@"alert#1", - SDLNameAlertText2:@"alert#2", - SDLNameAlertText3:@"alert#3", - SDLNameTTSChunks:[@[tts] mutableCopy], - SDLNameDuration:@4357, - SDLNamePlayTone:@YES, - SDLNameProgressIndicator:@NO, - SDLNameSoftButtons:[@[button] mutableCopy]}, - SDLNameOperationName:SDLNameAlert}} mutableCopy]; + NSMutableDictionary<NSString *, id> *dict = [@{SDLRPCParameterNameRequest: + @{SDLRPCParameterNameParameters: + @{SDLRPCParameterNameAlertText1:@"alert#1", + SDLRPCParameterNameAlertText2:@"alert#2", + SDLRPCParameterNameAlertText3:@"alert#3", + SDLRPCParameterNameTTSChunks:[@[tts] mutableCopy], + SDLRPCParameterNameDuration:@4357, + SDLRPCParameterNamePlayTone:@YES, + SDLRPCParameterNameProgressIndicator:@NO, + SDLRPCParameterNameSoftButtons:[@[button] mutableCopy]}, + SDLRPCParameterNameOperationName:SDLRPCFunctionNameAlert}} mutableCopy]; SDLAlert* testRequest = [[SDLAlert alloc] initWithDictionary:dict]; expect(testRequest.alertText1).to(equal(@"alert#1")); @@ -66,17 +67,17 @@ describe(@"Getter/Setter Tests", ^ { }); it(@"Should handle NSNull", ^{ - NSMutableDictionary* dict = [@{SDLNameRequest: - @{SDLNameParameters: - @{SDLNameAlertText1:@"alert#1", - SDLNameAlertText2:@"alert#2", - SDLNameAlertText3:@"alert#3", - SDLNameTTSChunks:[@[tts] mutableCopy], - SDLNameDuration:@4357, - SDLNamePlayTone:@YES, - SDLNameProgressIndicator:@NO, - SDLNameSoftButtons:[NSNull null]}, - SDLNameOperationName:SDLNameAlert}} mutableCopy]; + NSMutableDictionary* dict = [@{SDLRPCParameterNameRequest: + @{SDLRPCParameterNameParameters: + @{SDLRPCParameterNameAlertText1:@"alert#1", + SDLRPCParameterNameAlertText2:@"alert#2", + SDLRPCParameterNameAlertText3:@"alert#3", + SDLRPCParameterNameTTSChunks:[@[tts] mutableCopy], + SDLRPCParameterNameDuration:@4357, + SDLRPCParameterNamePlayTone:@YES, + SDLRPCParameterNameProgressIndicator:@NO, + SDLRPCParameterNameSoftButtons:[NSNull null]}, + SDLRPCParameterNameOperationName:SDLRPCFunctionNameAlert}} mutableCopy]; SDLAlert* testRequest = [[SDLAlert alloc] initWithDictionary:dict]; expect(testRequest.softButtons).to(beEmpty()); diff --git a/SmartDeviceLinkTests/RPCSpecs/RequestSpecs/SDLButtonPressSpec.m b/SmartDeviceLinkTests/RPCSpecs/RequestSpecs/SDLButtonPressSpec.m index 011c3782f..fc22e5c54 100644 --- a/SmartDeviceLinkTests/RPCSpecs/RequestSpecs/SDLButtonPressSpec.m +++ b/SmartDeviceLinkTests/RPCSpecs/RequestSpecs/SDLButtonPressSpec.m @@ -8,7 +8,8 @@ #import <Quick/Quick.h> #import <Nimble/Nimble.h> -#import "SDLNames.h" +#import "SDLRPCParameterNames.h" +#import "SDLRPCFunctionNames.h" #import "SDLButtonPress.h" #import "SDLModuleType.h" #import "SDLButtonName.h" @@ -31,12 +32,12 @@ describe(@"Getter/Setter Tests", ^ { }); it(@"Should get correctly when initialized with a dictionary", ^ { - NSMutableDictionary<NSString *, id> *dict = [@{SDLNameRequest: - @{SDLNameParameters: - @{SDLNameModuleType : SDLModuleTypeClimate, - SDLNameButtonName : SDLButtonNameAC, - SDLNameButtonPressMode : SDLButtonPressModeShort}, - SDLNameOperationName:SDLNameButtonPress}} mutableCopy]; + NSMutableDictionary<NSString *, id> *dict = [@{SDLRPCParameterNameRequest: + @{SDLRPCParameterNameParameters: + @{SDLRPCParameterNameModuleType : SDLModuleTypeClimate, + SDLRPCParameterNameButtonName : SDLButtonNameAC, + SDLRPCParameterNameButtonPressMode : SDLButtonPressModeShort}, + SDLRPCParameterNameOperationName:SDLRPCFunctionNameButtonPress}} mutableCopy]; SDLButtonPress* testRequest = [[SDLButtonPress alloc] initWithDictionary:dict]; expect(testRequest.moduleType).to(equal(SDLModuleTypeClimate)); diff --git a/SmartDeviceLinkTests/RPCSpecs/RequestSpecs/SDLChangeRegistrationSpec.m b/SmartDeviceLinkTests/RPCSpecs/RequestSpecs/SDLChangeRegistrationSpec.m index 98f05983d..40ada9d6f 100644 --- a/SmartDeviceLinkTests/RPCSpecs/RequestSpecs/SDLChangeRegistrationSpec.m +++ b/SmartDeviceLinkTests/RPCSpecs/RequestSpecs/SDLChangeRegistrationSpec.m @@ -10,7 +10,8 @@ #import "SDLChangeRegistration.h" #import "SDLLanguage.h" -#import "SDLNames.h" +#import "SDLRPCParameterNames.h" +#import "SDLRPCFunctionNames.h" #import "SDLTTSChunk.h" @@ -112,15 +113,15 @@ describe(@"change registration", ^ { someNGNMediaAppName = @"some media app name"; someVRSynonyms = @[@"some1", @"some2"]; - NSMutableDictionary<NSString *, id> *dict = [@{SDLNameRequest: - @{SDLNameParameters: - @{SDLNameLanguage:someLanguage, - SDLNameHMIDisplayLanguage:someOtherLanguage, - SDLNameAppName:someAppName, - SDLNameTTSName:someTTSChunks, - SDLNameNGNMediaScreenAppName:someNGNMediaAppName, - SDLNameVRSynonyms:someVRSynonyms}, - SDLNameOperationName:SDLNameChangeRegistration}} mutableCopy]; + NSMutableDictionary<NSString *, id> *dict = [@{SDLRPCParameterNameRequest: + @{SDLRPCParameterNameParameters: + @{SDLRPCParameterNameLanguage:someLanguage, + SDLRPCParameterNameHMIDisplayLanguage:someOtherLanguage, + SDLRPCParameterNameAppName:someAppName, + SDLRPCParameterNameTTSName:someTTSChunks, + SDLRPCParameterNameNGNMediaScreenAppName:someNGNMediaAppName, + SDLRPCParameterNameVRSynonyms:someVRSynonyms}, + SDLRPCParameterNameOperationName:SDLRPCFunctionNameChangeRegistration}} mutableCopy]; testRequest = [[SDLChangeRegistration alloc] initWithDictionary:dict]; }); diff --git a/SmartDeviceLinkTests/RPCSpecs/RequestSpecs/SDLCreateInteractionChoiceSetSpec.m b/SmartDeviceLinkTests/RPCSpecs/RequestSpecs/SDLCreateInteractionChoiceSetSpec.m index 52c496f8b..973189701 100644 --- a/SmartDeviceLinkTests/RPCSpecs/RequestSpecs/SDLCreateInteractionChoiceSetSpec.m +++ b/SmartDeviceLinkTests/RPCSpecs/RequestSpecs/SDLCreateInteractionChoiceSetSpec.m @@ -10,7 +10,8 @@ #import "SDLCreateInteractionChoiceSet.h" #import "SDLChoice.h" -#import "SDLNames.h" +#import "SDLRPCParameterNames.h" +#import "SDLRPCFunctionNames.h" QuickSpecBegin(SDLCreateInteractionChoiceSetSpec) @@ -28,11 +29,11 @@ describe(@"Getter/Setter Tests", ^ { }); it(@"Should get correctly when initialized", ^ { - NSMutableDictionary<NSString *, id> *dict = [@{SDLNameRequest: - @{SDLNameParameters: - @{SDLNameInteractionChoiceSetId:@141414, - SDLNameChoiceSet:[@[choice] mutableCopy]}, - SDLNameOperationName:SDLNameCreateInteractionChoiceSet}} mutableCopy]; + NSMutableDictionary<NSString *, id> *dict = [@{SDLRPCParameterNameRequest: + @{SDLRPCParameterNameParameters: + @{SDLRPCParameterNameInteractionChoiceSetId:@141414, + SDLRPCParameterNameChoiceSet:[@[choice] mutableCopy]}, + SDLRPCParameterNameOperationName:SDLRPCFunctionNameCreateInteractionChoiceSet}} mutableCopy]; SDLCreateInteractionChoiceSet* testRequest = [[SDLCreateInteractionChoiceSet alloc] initWithDictionary:dict]; expect(testRequest.interactionChoiceSetID).to(equal(@141414)); diff --git a/SmartDeviceLinkTests/RPCSpecs/RequestSpecs/SDLDeleteCommandSpec.m b/SmartDeviceLinkTests/RPCSpecs/RequestSpecs/SDLDeleteCommandSpec.m index b71e48028..fc275fd96 100644 --- a/SmartDeviceLinkTests/RPCSpecs/RequestSpecs/SDLDeleteCommandSpec.m +++ b/SmartDeviceLinkTests/RPCSpecs/RequestSpecs/SDLDeleteCommandSpec.m @@ -9,7 +9,8 @@ #import <Nimble/Nimble.h> #import "SDLDeleteCommand.h" -#import "SDLNames.h" +#import "SDLRPCParameterNames.h" +#import "SDLRPCFunctionNames.h" QuickSpecBegin(SDLDeleteCommandSpec) @@ -23,10 +24,10 @@ describe(@"Getter/Setter Tests", ^ { }); it(@"Should get correctly when initialized", ^ { - NSMutableDictionary<NSString *, id> *dict = [@{SDLNameRequest: - @{SDLNameParameters: - @{SDLNameCommandId:@11223344}, - SDLNameOperationName:SDLNameDeleteCommand}} mutableCopy]; + NSMutableDictionary<NSString *, id> *dict = [@{SDLRPCParameterNameRequest: + @{SDLRPCParameterNameParameters: + @{SDLRPCParameterNameCommandId:@11223344}, + SDLRPCParameterNameOperationName:SDLRPCFunctionNameDeleteCommand}} mutableCopy]; SDLDeleteCommand* testRequest = [[SDLDeleteCommand alloc] initWithDictionary:dict]; expect(testRequest.cmdID).to(equal(@11223344)); diff --git a/SmartDeviceLinkTests/RPCSpecs/RequestSpecs/SDLDeleteFileSpec.m b/SmartDeviceLinkTests/RPCSpecs/RequestSpecs/SDLDeleteFileSpec.m index 18ce7d1d7..bb07a874d 100755 --- a/SmartDeviceLinkTests/RPCSpecs/RequestSpecs/SDLDeleteFileSpec.m +++ b/SmartDeviceLinkTests/RPCSpecs/RequestSpecs/SDLDeleteFileSpec.m @@ -9,7 +9,8 @@ #import <Nimble/Nimble.h> #import "SDLDeleteFile.h" -#import "SDLNames.h" +#import "SDLRPCParameterNames.h" +#import "SDLRPCFunctionNames.h" QuickSpecBegin(SDLDeleteFileSpec) @@ -23,10 +24,10 @@ describe(@"Getter/Setter Tests", ^ { }); it(@"Should get correctly when initialized", ^ { - NSMutableDictionary<NSString *, id> *dict = [@{SDLNameRequest: - @{SDLNameParameters: - @{SDLNameSyncFileName:@"synchro"}, - SDLNameOperationName:SDLNameDeleteFile}} mutableCopy]; + NSMutableDictionary<NSString *, id> *dict = [@{SDLRPCParameterNameRequest: + @{SDLRPCParameterNameParameters: + @{SDLRPCParameterNameSyncFileName:@"synchro"}, + SDLRPCParameterNameOperationName:SDLRPCFunctionNameDeleteFile}} mutableCopy]; SDLDeleteFile* testRequest = [[SDLDeleteFile alloc] initWithDictionary:dict]; expect(testRequest.syncFileName).to(equal(@"synchro")); diff --git a/SmartDeviceLinkTests/RPCSpecs/RequestSpecs/SDLDeleteInteractionChoiceSetSpec.m b/SmartDeviceLinkTests/RPCSpecs/RequestSpecs/SDLDeleteInteractionChoiceSetSpec.m index bcc2c3756..81e6f9d2c 100755 --- a/SmartDeviceLinkTests/RPCSpecs/RequestSpecs/SDLDeleteInteractionChoiceSetSpec.m +++ b/SmartDeviceLinkTests/RPCSpecs/RequestSpecs/SDLDeleteInteractionChoiceSetSpec.m @@ -9,7 +9,8 @@ #import <Nimble/Nimble.h> #import "SDLDeleteInteractionChoiceSet.h" -#import "SDLNames.h" +#import "SDLRPCParameterNames.h" +#import "SDLRPCFunctionNames.h" QuickSpecBegin(SDLDeleteInteractionChoiceSetSpec) @@ -23,10 +24,10 @@ describe(@"Getter/Setter Tests", ^ { }); it(@"Should get correctly when initialized", ^ { - NSMutableDictionary<NSString *, id> *dict = [@{SDLNameRequest: - @{SDLNameParameters: - @{SDLNameInteractionChoiceSetId:@20314}, - SDLNameOperationName:SDLNameDeleteInteractionChoiceSet}} mutableCopy]; + NSMutableDictionary<NSString *, id> *dict = [@{SDLRPCParameterNameRequest: + @{SDLRPCParameterNameParameters: + @{SDLRPCParameterNameInteractionChoiceSetId:@20314}, + SDLRPCParameterNameOperationName:SDLRPCFunctionNameDeleteInteractionChoiceSet}} mutableCopy]; SDLDeleteInteractionChoiceSet* testRequest = [[SDLDeleteInteractionChoiceSet alloc] initWithDictionary:dict]; expect(testRequest.interactionChoiceSetID).to(equal(@20314)); diff --git a/SmartDeviceLinkTests/RPCSpecs/RequestSpecs/SDLDeleteSubMenuSpec.m b/SmartDeviceLinkTests/RPCSpecs/RequestSpecs/SDLDeleteSubMenuSpec.m index 888d94f59..5f628f745 100755 --- a/SmartDeviceLinkTests/RPCSpecs/RequestSpecs/SDLDeleteSubMenuSpec.m +++ b/SmartDeviceLinkTests/RPCSpecs/RequestSpecs/SDLDeleteSubMenuSpec.m @@ -9,7 +9,8 @@ #import <Nimble/Nimble.h> #import "SDLDeleteSubMenu.h" -#import "SDLNames.h" +#import "SDLRPCParameterNames.h" +#import "SDLRPCFunctionNames.h" QuickSpecBegin(SDLDeleteSubMenuSpec) @@ -23,10 +24,10 @@ describe(@"Getter/Setter Tests", ^ { }); it(@"Should get correctly when initialized", ^ { - NSMutableDictionary<NSString *, id> *dict = [@{SDLNameRequest: - @{SDLNameParameters: - @{SDLNameMenuId:@25614}, - SDLNameOperationName:SDLNameDeleteSubMenu}} mutableCopy]; + NSMutableDictionary<NSString *, id> *dict = [@{SDLRPCParameterNameRequest: + @{SDLRPCParameterNameParameters: + @{SDLRPCParameterNameMenuId:@25614}, + SDLRPCParameterNameOperationName:SDLRPCFunctionNameDeleteSubMenu}} mutableCopy]; SDLDeleteSubMenu* testRequest = [[SDLDeleteSubMenu alloc] initWithDictionary:dict]; expect(testRequest.menuID).to(equal(@25614)); diff --git a/SmartDeviceLinkTests/RPCSpecs/RequestSpecs/SDLDiagnosticMessageSpec.m b/SmartDeviceLinkTests/RPCSpecs/RequestSpecs/SDLDiagnosticMessageSpec.m index c07a8b5fc..bd75d5853 100755 --- a/SmartDeviceLinkTests/RPCSpecs/RequestSpecs/SDLDiagnosticMessageSpec.m +++ b/SmartDeviceLinkTests/RPCSpecs/RequestSpecs/SDLDiagnosticMessageSpec.m @@ -9,7 +9,8 @@ #import <Nimble/Nimble.h> #import "SDLDiagnosticMessage.h" -#import "SDLNames.h" +#import "SDLRPCParameterNames.h" +#import "SDLRPCFunctionNames.h" QuickSpecBegin(SDLDiagnosticMessageSpec) @@ -27,12 +28,12 @@ describe(@"Getter/Setter Tests", ^ { }); it(@"Should get correctly when initialized", ^ { - NSMutableDictionary<NSString *, id> *dict = [@{SDLNameRequest: - @{SDLNameParameters: - @{SDLNameTargetId:@3562, - SDLNameMessageLength:@55555, - SDLNameMessageData:[@[@1, @4, @16, @64] mutableCopy]}, - SDLNameOperationName:SDLNameDiagnosticMessage}} mutableCopy]; + NSMutableDictionary<NSString *, id> *dict = [@{SDLRPCParameterNameRequest: + @{SDLRPCParameterNameParameters: + @{SDLRPCParameterNameTargetId:@3562, + SDLRPCParameterNameMessageLength:@55555, + SDLRPCParameterNameMessageData:[@[@1, @4, @16, @64] mutableCopy]}, + SDLRPCParameterNameOperationName:SDLRPCFunctionNameDiagnosticMessage}} mutableCopy]; SDLDiagnosticMessage* testRequest = [[SDLDiagnosticMessage alloc] initWithDictionary:dict]; expect(testRequest.targetID).to(equal(@3562)); diff --git a/SmartDeviceLinkTests/RPCSpecs/RequestSpecs/SDLDialNumberSpec.m b/SmartDeviceLinkTests/RPCSpecs/RequestSpecs/SDLDialNumberSpec.m index a150144c1..100b6786e 100644 --- a/SmartDeviceLinkTests/RPCSpecs/RequestSpecs/SDLDialNumberSpec.m +++ b/SmartDeviceLinkTests/RPCSpecs/RequestSpecs/SDLDialNumberSpec.m @@ -6,7 +6,7 @@ #import <Nimble/Nimble.h> #import "SDLDialNumber.h" -#import "SDLNames.h" +#import "SDLRPCParameterNames.h" QuickSpecBegin(SDLDialNumberSpec) @@ -43,9 +43,9 @@ describe(@"Dial Number RPC", ^{ beforeEach(^{ somePhoneNumber = @"1234567890"; NSDictionary *initDict = @{ - SDLNameRequest: @{ - SDLNameParameters: @{ - SDLNameNumber: [somePhoneNumber copy] + SDLRPCParameterNameRequest: @{ + SDLRPCParameterNameParameters: @{ + SDLRPCParameterNameNumber: [somePhoneNumber copy] } } }; @@ -62,8 +62,8 @@ describe(@"Dial Number RPC", ^{ __block SDLDialNumber *testRequest = nil; beforeEach(^{ NSDictionary *initDict = @{ - SDLNameRequest: @{ - SDLNameParameters: @{ + SDLRPCParameterNameRequest: @{ + SDLRPCParameterNameParameters: @{ } } }; diff --git a/SmartDeviceLinkTests/RPCSpecs/RequestSpecs/SDLEncodedSyncPDataSpec.m b/SmartDeviceLinkTests/RPCSpecs/RequestSpecs/SDLEncodedSyncPDataSpec.m index 739db2b66..d273002fe 100755 --- a/SmartDeviceLinkTests/RPCSpecs/RequestSpecs/SDLEncodedSyncPDataSpec.m +++ b/SmartDeviceLinkTests/RPCSpecs/RequestSpecs/SDLEncodedSyncPDataSpec.m @@ -9,7 +9,8 @@ #import <Nimble/Nimble.h> #import "SDLEncodedSyncPData.h" -#import "SDLNames.h" +#import "SDLRPCParameterNames.h" +#import "SDLRPCFunctionNames.h" QuickSpecBegin(SDLEncodedSyncPDataSpec) @@ -23,10 +24,10 @@ describe(@"Getter/Setter Tests", ^ { }); it(@"Should get correctly when initialized", ^ { - NSMutableDictionary<NSString *, id> *dict = [@{SDLNameRequest: - @{SDLNameParameters: - @{SDLNameData:[@[@2, @2, @2] mutableCopy]}, - SDLNameOperationName:SDLNameEncodedSyncPData}} mutableCopy]; + NSMutableDictionary<NSString *, id> *dict = [@{SDLRPCParameterNameRequest: + @{SDLRPCParameterNameParameters: + @{SDLRPCParameterNameData:[@[@2, @2, @2] mutableCopy]}, + SDLRPCParameterNameOperationName:SDLRPCFunctionNameEncodedSyncPData}} mutableCopy]; SDLEncodedSyncPData* testRequest = [[SDLEncodedSyncPData alloc] initWithDictionary:dict]; expect(testRequest.data).to(equal([@[@2, @2, @2] mutableCopy])); diff --git a/SmartDeviceLinkTests/RPCSpecs/RequestSpecs/SDLEndAudioPassThruSpec.m b/SmartDeviceLinkTests/RPCSpecs/RequestSpecs/SDLEndAudioPassThruSpec.m index 843d917be..0207f1bc8 100644 --- a/SmartDeviceLinkTests/RPCSpecs/RequestSpecs/SDLEndAudioPassThruSpec.m +++ b/SmartDeviceLinkTests/RPCSpecs/RequestSpecs/SDLEndAudioPassThruSpec.m @@ -9,7 +9,7 @@ #import <Nimble/Nimble.h> #import "SDLEndAudioPassThru.h" -#import "SDLNames.h" +#import "SDLRPCParameterNames.h" QuickSpecBegin(SDLEndAudioPassThruSpec) diff --git a/SmartDeviceLinkTests/RPCSpecs/RequestSpecs/SDLGetAppServiceDataSpec.m b/SmartDeviceLinkTests/RPCSpecs/RequestSpecs/SDLGetAppServiceDataSpec.m new file mode 100644 index 000000000..a094ef46d --- /dev/null +++ b/SmartDeviceLinkTests/RPCSpecs/RequestSpecs/SDLGetAppServiceDataSpec.m @@ -0,0 +1,83 @@ +// +// SDLGetAppServiceDataSpec.m +// SmartDeviceLinkTests +// +// Created by Nicole on 2/6/19. +// Copyright © 2019 smartdevicelink. All rights reserved. +// + +#import <Quick/Quick.h> +#import <Nimble/Nimble.h> + +#import "SDLAppServiceType.h" +#import "SDLGetAppServiceData.h" +#import "SDLRPCParameterNames.h" +#import "SDLRPCFunctionNames.h" + +QuickSpecBegin(SDLGetAppServiceDataSpec) + +describe(@"Getter/Setter Tests", ^{ + __block NSString *testServiceType = nil; + __block SDLAppServiceType testAppServiceType = nil; + __block BOOL testSubscribe = nil; + + beforeEach(^{ + testServiceType = SDLAppServiceTypeWeather; + testAppServiceType = SDLAppServiceTypeMedia; + testSubscribe = YES; + }); + + it(@"Should set and get correctly", ^{ + SDLGetAppServiceData *testRequest = [[SDLGetAppServiceData alloc] init]; + testRequest.serviceType = testServiceType; + testRequest.subscribe = @(testSubscribe); + + expect(testRequest.serviceType).to(equal(testServiceType)); + expect(testRequest.subscribe).to(beTrue()); + }); + + it(@"Should initialize correctly with a dictionary", ^{ + NSDictionary *dict = @{SDLRPCParameterNameRequest:@{ + SDLRPCParameterNameParameters:@{ + SDLRPCParameterNameServiceType:testServiceType, + SDLRPCParameterNameSubscribe:@(testSubscribe) + }, + SDLRPCParameterNameOperationName:SDLRPCFunctionNameGetAppServiceData}}; + SDLGetAppServiceData *testRequest = [[SDLGetAppServiceData alloc] initWithDictionary:dict]; + + expect(testRequest.serviceType).to(equal(testServiceType)); + expect(testRequest.subscribe).to(beTrue()); + }); + + it(@"Should initialize correctly with initWithServiceType:", ^{ + SDLGetAppServiceData *testRequest = [[SDLGetAppServiceData alloc] initWithServiceType:testServiceType]; + + expect(testRequest.serviceType).to(equal(testServiceType)); + expect(testRequest.subscribe).to(beNil()); + }); + + it(@"Should initialize correctly with initWithAppServiceType:", ^{ + SDLGetAppServiceData *testRequest = [[SDLGetAppServiceData alloc] initWithAppServiceType:testAppServiceType]; + + expect(testRequest.serviceType).to(equal(testAppServiceType)); + expect(testRequest.subscribe).to(beNil()); + }); + + it(@"Should initialize correctly with initWithServiceType:subscribe:", ^{ + SDLGetAppServiceData *testRequest = [[SDLGetAppServiceData alloc] initWithServiceType:testServiceType subscribe:testSubscribe]; + + expect(testRequest.serviceType).to(equal(testServiceType)); + expect(testRequest.subscribe).to(beTrue()); + }); + + it(@"Should return nil if not set", ^{ + SDLGetAppServiceData *testRequest = [[SDLGetAppServiceData alloc] init]; + + expect(testRequest.serviceType).to(beNil()); + expect(testRequest.subscribe).to(beNil()); + }); +}); + +QuickSpecEnd + + diff --git a/SmartDeviceLinkTests/RPCSpecs/RequestSpecs/SDLGetDTCsSpec.m b/SmartDeviceLinkTests/RPCSpecs/RequestSpecs/SDLGetDTCsSpec.m index fcdec90f8..25e489c46 100755 --- a/SmartDeviceLinkTests/RPCSpecs/RequestSpecs/SDLGetDTCsSpec.m +++ b/SmartDeviceLinkTests/RPCSpecs/RequestSpecs/SDLGetDTCsSpec.m @@ -9,7 +9,8 @@ #import <Nimble/Nimble.h> #import "SDLGetDTCs.h" -#import "SDLNames.h" +#import "SDLRPCParameterNames.h" +#import "SDLRPCFunctionNames.h" QuickSpecBegin(SDLGetDTCsSpec) @@ -25,11 +26,11 @@ describe(@"Getter/Setter Tests", ^ { }); it(@"Should get correctly when initialized", ^ { - NSMutableDictionary<NSString *, id> *dict = [@{SDLNameRequest: - @{SDLNameParameters: - @{SDLNameECUName:@4321, - SDLNameDTCMask:@22}, - SDLNameOperationName:SDLNameEndAudioPassThru}} mutableCopy]; + NSMutableDictionary<NSString *, id> *dict = [@{SDLRPCParameterNameRequest: + @{SDLRPCParameterNameParameters: + @{SDLRPCParameterNameECUName:@4321, + SDLRPCParameterNameDTCMask:@22}, + SDLRPCParameterNameOperationName:SDLRPCFunctionNameEndAudioPassThru}} mutableCopy]; SDLGetDTCs* testRequest = [[SDLGetDTCs alloc] initWithDictionary:dict]; expect(testRequest.ecuName).to(equal(@4321)); diff --git a/SmartDeviceLinkTests/RPCSpecs/RequestSpecs/SDLGetFileSpec.m b/SmartDeviceLinkTests/RPCSpecs/RequestSpecs/SDLGetFileSpec.m new file mode 100644 index 000000000..f2f25dfbc --- /dev/null +++ b/SmartDeviceLinkTests/RPCSpecs/RequestSpecs/SDLGetFileSpec.m @@ -0,0 +1,109 @@ +// +// SDLGetFileSpec.m +// SmartDeviceLinkTests +// +// Created by Nicole on 2/7/19. +// Copyright © 2019 smartdevicelink. All rights reserved. +// + +#import <Quick/Quick.h> +#import <Nimble/Nimble.h> + +#import "SDLGetFile.h" +#import "SDLFileType.h" +#import "SDLRPCParameterNames.h" +#import "SDLRPCFunctionNames.h" + +QuickSpecBegin(SDLGetFileSpec) + +describe(@"Getter/Setter Tests", ^{ + __block NSString *testFileName = nil; + __block NSString *testAppServiceId = nil; + __block SDLFileType testFileType = nil; + __block int testOffset = 45; + __block int testLength = 67; + + beforeEach(^{ + testFileName = @"testFileName"; + testAppServiceId = @"testAppServiceId"; + testFileType = SDLFileTypePNG; + }); + + it(@"Should set and get correctly", ^{ + SDLGetFile *testRequest = [[SDLGetFile alloc] init]; + testRequest.fileName = testFileName; + testRequest.appServiceId = testAppServiceId; + testRequest.fileType = testFileType; + testRequest.offset = @(testOffset); + testRequest.length = @(testLength); + + expect(testRequest.fileName).to(equal(testFileName)); + expect(testRequest.appServiceId).to(equal(testAppServiceId)); + expect(testRequest.fileType).to(equal(testFileType)); + expect(testRequest.offset).to(equal(testOffset)); + expect(testRequest.length).to(equal(testLength)); + }); + + it(@"Should initialize correctly with a dictionary", ^{ + NSDictionary *dict = @{SDLRPCParameterNameRequest:@{ + SDLRPCParameterNameParameters:@{ + SDLRPCParameterNameFilename:testFileName, + SDLRPCParameterNameAppServiceId:testAppServiceId, + SDLRPCParameterNameFileType:testFileType, + SDLRPCParameterNameOffset:@(testOffset), + SDLRPCParameterNameLength:@(testLength) + }, + SDLRPCParameterNameOperationName:SDLRPCFunctionNameGetFile}}; + SDLGetFile *testRequest = [[SDLGetFile alloc] initWithDictionary:dict]; + + expect(testRequest.fileName).to(equal(testFileName)); + expect(testRequest.appServiceId).to(equal(testAppServiceId)); + expect(testRequest.fileType).to(equal(testFileType)); + expect(testRequest.offset).to(equal(testOffset)); + expect(testRequest.length).to(equal(testLength)); + }); + + it(@"Should initialize correctly with initWithFileName:", ^{ + SDLGetFile *testRequest = [[SDLGetFile alloc] initWithFileName:testFileName]; + + expect(testRequest.fileName).to(equal(testFileName)); + expect(testRequest.appServiceId).to(beNil()); + expect(testRequest.fileType).to(beNil()); + expect(testRequest.offset).to(beNil()); + expect(testRequest.length).to(beNil()); + }); + + it(@"Should initialize correctly with initWithFileName:appServiceId:fileType:", ^{ + SDLGetFile *testRequest = [[SDLGetFile alloc] initWithFileName:testFileName appServiceId:testAppServiceId fileType:testFileType]; + + expect(testRequest.fileName).to(equal(testFileName)); + expect(testRequest.appServiceId).to(equal(testAppServiceId)); + expect(testRequest.fileType).to(equal(testFileType)); + expect(testRequest.offset).to(beNil()); + expect(testRequest.length).to(beNil()); + }); + + it(@"Should initialize correctly with initWithFileName:appServiceId:fileType:offset:length:", ^{ + SDLGetFile *testRequest = [[SDLGetFile alloc] initWithFileName:testFileName appServiceId:testAppServiceId fileType:testFileType offset:testOffset length:testLength]; + + expect(testRequest.fileName).to(equal(testFileName)); + expect(testRequest.appServiceId).to(equal(testAppServiceId)); + expect(testRequest.fileType).to(equal(testFileType)); + expect(testRequest.offset).to(equal(testOffset)); + expect(testRequest.length).to(equal(testLength)); + }); + + it(@"Should return nil if not set", ^{ + SDLGetFile *testRequest = [[SDLGetFile alloc] init]; + + expect(testRequest.fileName).to(beNil()); + expect(testRequest.appServiceId).to(beNil()); + expect(testRequest.fileType).to(beNil()); + expect(testRequest.offset).to(beNil()); + expect(testRequest.length).to(beNil()); + }); +}); + +QuickSpecEnd + + diff --git a/SmartDeviceLinkTests/RPCSpecs/RequestSpecs/SDLGetInteriorVehicleDataSpec.m b/SmartDeviceLinkTests/RPCSpecs/RequestSpecs/SDLGetInteriorVehicleDataSpec.m index 12dfceec7..600c9826b 100755 --- a/SmartDeviceLinkTests/RPCSpecs/RequestSpecs/SDLGetInteriorVehicleDataSpec.m +++ b/SmartDeviceLinkTests/RPCSpecs/RequestSpecs/SDLGetInteriorVehicleDataSpec.m @@ -10,7 +10,8 @@ #import "SDLGetInteriorVehicleData.h" #import "SDLModuleType.h" -#import "SDLNames.h" +#import "SDLRPCParameterNames.h" +#import "SDLRPCFunctionNames.h" QuickSpecBegin(SDLGetInteriorVehicleDataSpec) @@ -25,11 +26,11 @@ describe(@"Getter/Setter Tests", ^ { }); it(@"Should get correctly when initialized with a dictionary", ^ { - NSMutableDictionary<NSString *, id> *dict = [@{SDLNameRequest: - @{SDLNameParameters: - @{SDLNameModuleType : SDLModuleTypeRadio, - SDLNameSubscribe : @YES}, - SDLNameOperationName:SDLNameGetInteriorVehicleData}} mutableCopy]; + NSMutableDictionary<NSString *, id> *dict = [@{SDLRPCParameterNameRequest: + @{SDLRPCParameterNameParameters: + @{SDLRPCParameterNameModuleType : SDLModuleTypeRadio, + SDLRPCParameterNameSubscribe : @YES}, + SDLRPCParameterNameOperationName:SDLRPCFunctionNameGetInteriorVehicleData}} mutableCopy]; SDLGetInteriorVehicleData* testRequest = [[SDLGetInteriorVehicleData alloc] initWithDictionary:dict]; expect(testRequest.moduleType).to(equal(SDLModuleTypeRadio)); diff --git a/SmartDeviceLinkTests/RPCSpecs/RequestSpecs/SDLGetSystemCapabilitiesSpec.m b/SmartDeviceLinkTests/RPCSpecs/RequestSpecs/SDLGetSystemCapabilitiesSpec.m index 99feed6f3..a5cbac428 100644 --- a/SmartDeviceLinkTests/RPCSpecs/RequestSpecs/SDLGetSystemCapabilitiesSpec.m +++ b/SmartDeviceLinkTests/RPCSpecs/RequestSpecs/SDLGetSystemCapabilitiesSpec.m @@ -6,7 +6,7 @@ #import "SDLGetSystemCapability.h" #import "SDLSystemCapabilityType.h" -#import "SDLNames.h" +#import "SDLRPCParameterNames.h" QuickSpecBegin(SDLGetSystemCapabilitiesSpec) @@ -22,9 +22,9 @@ describe(@"Getter/Setter Tests", ^ { describe(@"Initialization tests", ^{ it(@"Should get correctly when initialized with a dictionary", ^ { - NSDictionary *dict = @{SDLNameRequest: @{ - SDLNameParameters: @{ - SDLNameSystemCapabilityType: @"PHONE_CALL" + NSDictionary *dict = @{SDLRPCParameterNameRequest: @{ + SDLRPCParameterNameParameters: @{ + SDLRPCParameterNameSystemCapabilityType: @"PHONE_CALL" } } }; diff --git a/SmartDeviceLinkTests/RPCSpecs/RequestSpecs/SDLGetSystemCapabilitySpec.m b/SmartDeviceLinkTests/RPCSpecs/RequestSpecs/SDLGetSystemCapabilitySpec.m new file mode 100644 index 000000000..77d175818 --- /dev/null +++ b/SmartDeviceLinkTests/RPCSpecs/RequestSpecs/SDLGetSystemCapabilitySpec.m @@ -0,0 +1,76 @@ +// +// SDLGetSystemCapabilitySpec.m +// SmartDeviceLinkTests +// +// Created by Nicole on 2/6/19. +// Copyright © 2019 smartdevicelink. All rights reserved. +// + +#import <Quick/Quick.h> +#import <Nimble/Nimble.h> + +#import "SDLGetSystemCapability.h" +#import "SDLRPCParameterNames.h" +#import "SDLRPCFunctionNames.h" +#import "SDLSystemCapabilityType.h" + +QuickSpecBegin(SDLGetSystemCapabilitySpec) + +describe(@"Getter/Setter Tests", ^ { + __block SDLSystemCapabilityType testSystemCapabilityType = nil; + __block BOOL testSubcribe = nil; + + beforeEach(^{ + testSystemCapabilityType = SDLSystemCapabilityTypeAppServices; + testSubcribe = NO; + }); + + it(@"Should set and get correctly", ^{ + SDLGetSystemCapability *testRequest = [[SDLGetSystemCapability alloc] init]; + testRequest.systemCapabilityType = testSystemCapabilityType; + testRequest.subscribe = @(testSubcribe); + + expect(testRequest.systemCapabilityType).to(equal(testSystemCapabilityType)); + expect(testRequest.subscribe).to(beFalse()); + }); + + it(@"Should return nil if not set", ^{ + SDLGetSystemCapability *testRequest = [[SDLGetSystemCapability alloc] init]; + + expect(testRequest.systemCapabilityType).to(beNil()); + expect(testRequest.subscribe).to(beNil()); + }); + + describe(@"initializing", ^{ + it(@"Should initialize correctly with a dictionary", ^{ + NSDictionary *dict = @{SDLRPCParameterNameRequest:@{ + SDLRPCParameterNameParameters:@{ + SDLRPCParameterNameSystemCapabilityType:testSystemCapabilityType, + SDLRPCParameterNameSubscribe:@(testSubcribe) + }, + SDLRPCParameterNameOperationName:SDLRPCFunctionNameGetSystemCapability}}; + SDLGetSystemCapability *testRequest = [[SDLGetSystemCapability alloc] initWithDictionary:dict]; + + expect(testRequest.systemCapabilityType).to(equal(testSystemCapabilityType)); + expect(testRequest.subscribe).to(beFalse()); + }); + + + it(@"Should initialize correctly with initWithType:", ^{ + SDLGetSystemCapability *testRequest = [[SDLGetSystemCapability alloc] initWithType:testSystemCapabilityType]; + + expect(testRequest.systemCapabilityType).to(equal(testSystemCapabilityType)); + expect(testRequest.subscribe).to(beNil()); + }); + + it(@"Should initialize correctly with initWithType:subscribe:", ^{ + SDLGetSystemCapability *testRequest = [[SDLGetSystemCapability alloc] initWithType:testSystemCapabilityType subscribe:testSubcribe]; + + expect(testRequest.systemCapabilityType).to(equal(testSystemCapabilityType)); + expect(testRequest.subscribe).to(beFalse()); + }); + }); +}); + +QuickSpecEnd + diff --git a/SmartDeviceLinkTests/RPCSpecs/RequestSpecs/SDLGetVehicleDataSpec.m b/SmartDeviceLinkTests/RPCSpecs/RequestSpecs/SDLGetVehicleDataSpec.m index a32ff2567..36c28f921 100644 --- a/SmartDeviceLinkTests/RPCSpecs/RequestSpecs/SDLGetVehicleDataSpec.m +++ b/SmartDeviceLinkTests/RPCSpecs/RequestSpecs/SDLGetVehicleDataSpec.m @@ -9,7 +9,8 @@ #import <Nimble/Nimble.h> #import "SDLGetVehicleData.h" -#import "SDLNames.h" +#import "SDLRPCParameterNames.h" +#import "SDLRPCFunctionNames.h" QuickSpecBegin(SDLGetVehicleDataSpec) @@ -79,38 +80,38 @@ describe(@"Getter/Setter Tests", ^ { }); it(@"Should get correctly when initialized", ^ { - NSDictionary<NSString *, id> *dict = @{SDLNameRequest: - @{SDLNameParameters: - @{SDLNameAccelerationPedalPosition:@YES, - SDLNameAirbagStatus:@YES, - SDLNameBeltStatus:@YES, - SDLNameBodyInformation:@YES, - SDLNameCloudAppVehicleID:@YES, - SDLNameClusterModeStatus:@YES, - SDLNameDeviceStatus:@YES, - SDLNameDriverBraking:@YES, - SDLNameECallInfo:@YES, - SDLNameElectronicParkBrakeStatus:@YES, - SDLNameEmergencyEvent:@NO, - SDLNameEngineOilLife:@YES, - SDLNameEngineTorque:@YES, - SDLNameExternalTemperature:@NO, - SDLNameFuelLevel:@YES, - SDLNameFuelLevelState:@YES, - SDLNameFuelRange:@YES, - SDLNameGPS:@YES, - SDLNameHeadLampStatus:@YES, - SDLNameInstantFuelConsumption:@YES, - SDLNameMyKey:@YES, - SDLNameOdometer:@YES, - SDLNamePRNDL:@YES, - SDLNameRPM:@YES, - SDLNameSpeed:@YES, - SDLNameSteeringWheelAngle:@NO, - SDLNameTirePressure:@YES, - SDLNameTurnSignal:@NO, - SDLNameWiperStatus:@YES}, - SDLNameOperationName:SDLNameGetVehicleData}}; + NSDictionary<NSString *, id> *dict = @{SDLRPCParameterNameRequest: + @{SDLRPCParameterNameParameters: + @{SDLRPCParameterNameAccelerationPedalPosition:@YES, + SDLRPCParameterNameAirbagStatus:@YES, + SDLRPCParameterNameBeltStatus:@YES, + SDLRPCParameterNameBodyInformation:@YES, + SDLRPCParameterCloudAppVehicleID:@YES, + SDLRPCParameterNameClusterModeStatus:@YES, + SDLRPCParameterNameDeviceStatus:@YES, + SDLRPCParameterNameDriverBraking:@YES, + SDLRPCParameterNameECallInfo:@YES, + SDLRPCParameterNameElectronicParkBrakeStatus:@YES, + SDLRPCParameterNameEmergencyEvent:@NO, + SDLRPCParameterNameEngineOilLife:@YES, + SDLRPCParameterNameEngineTorque:@YES, + SDLRPCParameterNameExternalTemperature:@NO, + SDLRPCParameterNameFuelLevel:@YES, + SDLRPCParameterNameFuelLevelState:@YES, + SDLRPCParameterNameFuelRange:@YES, + SDLRPCParameterNameGPS:@YES, + SDLRPCParameterNameHeadLampStatus:@YES, + SDLRPCParameterNameInstantFuelConsumption:@YES, + SDLRPCParameterNameMyKey:@YES, + SDLRPCParameterNameOdometer:@YES, + SDLRPCParameterNamePRNDL:@YES, + SDLRPCParameterNameRPM:@YES, + SDLRPCParameterNameSpeed:@YES, + SDLRPCParameterNameSteeringWheelAngle:@NO, + SDLRPCParameterNameTirePressure:@YES, + SDLRPCParameterNameTurnSignal:@NO, + SDLRPCParameterNameWiperStatus:@YES}, + SDLRPCParameterNameOperationName:SDLRPCFunctionNameGetVehicleData}}; SDLGetVehicleData* testRequest = [[SDLGetVehicleData alloc] initWithDictionary:dict]; expect(testRequest.accPedalPosition).to(equal(@YES)); diff --git a/SmartDeviceLinkTests/RPCSpecs/RequestSpecs/SDLGetWaypointsSpec.m b/SmartDeviceLinkTests/RPCSpecs/RequestSpecs/SDLGetWaypointsSpec.m index 45946f405..3b0c706c3 100644 --- a/SmartDeviceLinkTests/RPCSpecs/RequestSpecs/SDLGetWaypointsSpec.m +++ b/SmartDeviceLinkTests/RPCSpecs/RequestSpecs/SDLGetWaypointsSpec.m @@ -8,7 +8,8 @@ #import "SDLGetWaypoints.h" -#import "SDLNames.h" +#import "SDLRPCParameterNames.h" +#import "SDLRPCFunctionNames.h" #import "SDLWayPointType.h" QuickSpecBegin(SDLGetWaypointsSpec) @@ -23,10 +24,10 @@ describe(@"Getter/Setter Tests", ^ { }); it(@"Should get correctly when initialized", ^ { - NSMutableDictionary* dict = [@{SDLNameRequest: - @{SDLNameParameters: - @{SDLNameWayPointType:SDLWayPointTypeAll}, - SDLNameOperationName:SDLNameGetWayPoints}} mutableCopy]; + NSMutableDictionary* dict = [@{SDLRPCParameterNameRequest: + @{SDLRPCParameterNameParameters: + @{SDLRPCParameterNameWayPointType:SDLWayPointTypeAll}, + SDLRPCParameterNameOperationName:SDLRPCFunctionNameGetWayPoints}} mutableCopy]; SDLGetWayPoints* testRequest = [[SDLGetWayPoints alloc] initWithDictionary:dict]; expect(testRequest.waypointType).to(equal(SDLWayPointTypeAll)); diff --git a/SmartDeviceLinkTests/RPCSpecs/RequestSpecs/SDLListFilesSpec.m b/SmartDeviceLinkTests/RPCSpecs/RequestSpecs/SDLListFilesSpec.m index 0f0084f41..7039ace5a 100644 --- a/SmartDeviceLinkTests/RPCSpecs/RequestSpecs/SDLListFilesSpec.m +++ b/SmartDeviceLinkTests/RPCSpecs/RequestSpecs/SDLListFilesSpec.m @@ -9,8 +9,8 @@ #import <Nimble/Nimble.h> #import "SDLListFiles.h" -#import "SDLNames.h" +#import "SDLRPCParameterNames.h" QuickSpecBegin(SDLListFilesSpec) -QuickSpecEnd
\ No newline at end of file +QuickSpecEnd diff --git a/SmartDeviceLinkTests/RPCSpecs/RequestSpecs/SDLPerformAppServiceInteractionSpec.m b/SmartDeviceLinkTests/RPCSpecs/RequestSpecs/SDLPerformAppServiceInteractionSpec.m new file mode 100644 index 000000000..7d5cde77a --- /dev/null +++ b/SmartDeviceLinkTests/RPCSpecs/RequestSpecs/SDLPerformAppServiceInteractionSpec.m @@ -0,0 +1,90 @@ +// +// SDLPerformAppServiceInteractionSpec.m +// SmartDeviceLinkTests +// +// Created by Nicole on 2/6/19. +// Copyright © 2019 smartdevicelink. All rights reserved. +// + +#import <Quick/Quick.h> +#import <Nimble/Nimble.h> + +#import "SDLPerformAppServiceInteraction.h" +#import "SDLRPCParameterNames.h" +#import "SDLRPCFunctionNames.h" + +QuickSpecBegin(SDLPerformAppServiceInteractionSpec) + +describe(@"Getter/Setter Tests", ^{ + __block NSString *testServiceUri = nil; + __block NSString *testServiceID = nil; + __block NSString *testOriginApp = nil; + __block BOOL testRequestServiceActive = nil; + + beforeEach(^{ + testServiceUri = @"testServiceUri"; + testServiceID = @"testServiceID"; + testOriginApp = @"testOriginApp"; + testRequestServiceActive = true; + }); + + it(@"Should set and get correctly", ^{ + SDLPerformAppServiceInteraction *testRequest = [[SDLPerformAppServiceInteraction alloc] init]; + testRequest.serviceUri = testServiceUri; + testRequest.serviceID = testServiceID; + testRequest.originApp = testOriginApp; + testRequest.requestServiceActive = @(testRequestServiceActive); + + expect(testRequest.serviceUri).to(equal(testServiceUri)); + expect(testRequest.serviceID).to(equal(testServiceID)); + expect(testRequest.originApp).to(equal(testOriginApp)); + expect(testRequest.requestServiceActive).to(beTrue()); + }); + + it(@"Should initialize correctly with a dictionary", ^{ + NSDictionary *dict = @{SDLRPCParameterNameRequest:@{ + SDLRPCParameterNameParameters:@{ + SDLRPCParameterNameServiceUri:testServiceUri, + SDLRPCParameterNameServiceID:testServiceID, + SDLRPCParameterNameOriginApp:testOriginApp, + SDLRPCParameterNameRequestServiceActive:@(testRequestServiceActive) + }, + SDLRPCParameterNameOperationName:SDLRPCFunctionNamePerformAppServiceInteraction}}; + SDLPerformAppServiceInteraction *testRequest = [[SDLPerformAppServiceInteraction alloc] initWithDictionary:dict]; + + expect(testRequest.serviceUri).to(equal(testServiceUri)); + expect(testRequest.serviceID).to(equal(testServiceID)); + expect(testRequest.originApp).to(equal(testOriginApp)); + expect(testRequest.requestServiceActive).to(beTrue()); + }); + + it(@"Should initialize correctly with initWithServiceUri:appServiceId:originApp:", ^{ + SDLPerformAppServiceInteraction *testRequest = [[SDLPerformAppServiceInteraction alloc] initWithServiceUri:testServiceUri serviceID:testServiceID originApp:testOriginApp]; + + expect(testRequest.serviceUri).to(equal(testServiceUri)); + expect(testRequest.serviceID).to(equal(testServiceID)); + expect(testRequest.originApp).to(equal(testOriginApp)); + expect(testRequest.requestServiceActive).to(beNil()); + }); + + it(@"Should initialize correctly with initWithServiceUri:appServiceId:originApp:requestServiceActive:", ^{ + SDLPerformAppServiceInteraction *testRequest = [[SDLPerformAppServiceInteraction alloc] initWithServiceUri:testServiceUri serviceID:testServiceID originApp:testOriginApp requestServiceActive:testRequestServiceActive]; + + expect(testRequest.serviceUri).to(equal(testServiceUri)); + expect(testRequest.serviceID).to(equal(testServiceID)); + expect(testRequest.originApp).to(equal(testOriginApp)); + expect(testRequest.requestServiceActive).to(beTrue()); + }); + + it(@"Should return nil if not set", ^{ + SDLPerformAppServiceInteraction *testRequest = [[SDLPerformAppServiceInteraction alloc] init]; + + expect(testRequest.serviceUri).to(beNil()); + expect(testRequest.serviceID).to(beNil()); + expect(testRequest.originApp).to(beNil()); + expect(testRequest.requestServiceActive).to(beNil()); + }); +}); + +QuickSpecEnd + diff --git a/SmartDeviceLinkTests/RPCSpecs/RequestSpecs/SDLPerformAudioPassThruSpec.m b/SmartDeviceLinkTests/RPCSpecs/RequestSpecs/SDLPerformAudioPassThruSpec.m index e55cf86be..ec8799689 100644 --- a/SmartDeviceLinkTests/RPCSpecs/RequestSpecs/SDLPerformAudioPassThruSpec.m +++ b/SmartDeviceLinkTests/RPCSpecs/RequestSpecs/SDLPerformAudioPassThruSpec.m @@ -10,7 +10,8 @@ #import "SDLAudioType.h" #import "SDLBitsPerSample.h" -#import "SDLNames.h" +#import "SDLRPCParameterNames.h" +#import "SDLRPCFunctionNames.h" #import "SDLPerformAudioPassThru.h" #import "SDLSamplingRate.h" @@ -39,16 +40,16 @@ describe(@"Getter/Setter Tests", ^ { }); it(@"Should get correctly when initialized", ^ { - NSMutableDictionary* dict = [@{SDLNameRequest: - @{SDLNameParameters: - @{SDLNameAudioPassThruDisplayText1:@"passthru#1", - SDLNameAudioPassThruDisplayText2:@"passthru#2", - SDLNameSamplingRate:SDLSamplingRate22KHZ, - SDLNameMaxDuration:@34563, - SDLNameBitsPerSample:SDLBitsPerSample16Bit, - SDLNameAudioType:SDLAudioTypePCM, - SDLNameMuteAudio:@NO}, - SDLNameOperationName:SDLNamePerformAudioPassThru}} mutableCopy]; + NSMutableDictionary* dict = [@{SDLRPCParameterNameRequest: + @{SDLRPCParameterNameParameters: + @{SDLRPCParameterNameAudioPassThruDisplayText1:@"passthru#1", + SDLRPCParameterNameAudioPassThruDisplayText2:@"passthru#2", + SDLRPCParameterNameSamplingRate:SDLSamplingRate22KHZ, + SDLRPCParameterNameMaxDuration:@34563, + SDLRPCParameterNameBitsPerSample:SDLBitsPerSample16Bit, + SDLRPCParameterNameAudioType:SDLAudioTypePCM, + SDLRPCParameterNameMuteAudio:@NO}, + SDLRPCParameterNameOperationName:SDLRPCFunctionNamePerformAudioPassThru}} mutableCopy]; SDLPerformAudioPassThru* testRequest = [[SDLPerformAudioPassThru alloc] initWithDictionary:dict]; expect(testRequest.audioPassThruDisplayText1).to(equal(@"passthru#1")); diff --git a/SmartDeviceLinkTests/RPCSpecs/RequestSpecs/SDLPerformInteractionSpec.m b/SmartDeviceLinkTests/RPCSpecs/RequestSpecs/SDLPerformInteractionSpec.m index 337008aee..6c905afbe 100644 --- a/SmartDeviceLinkTests/RPCSpecs/RequestSpecs/SDLPerformInteractionSpec.m +++ b/SmartDeviceLinkTests/RPCSpecs/RequestSpecs/SDLPerformInteractionSpec.m @@ -13,7 +13,8 @@ #import "SDLPerformInteraction.h" #import "SDLTTSChunk.h" #import "SDLVrHelpItem.h" -#import "SDLNames.h" +#import "SDLRPCParameterNames.h" +#import "SDLRPCFunctionNames.h" QuickSpecBegin(SDLPerformInteractionSpec) @@ -48,18 +49,18 @@ describe(@"Getter/Setter Tests", ^ { }); it(@"Should get correctly when initialized", ^ { - NSMutableDictionary* dict = [@{SDLNameRequest: - @{SDLNameParameters: - @{SDLNameInitialText:@"a", - SDLNameInitialPrompt:[@[chunk1] mutableCopy], - SDLNameInteractionMode:SDLInteractionModeVoiceRecognitionOnly, - SDLNameInteractionChoiceSetIdList:[@[@1, @2, @3] mutableCopy], - SDLNameHelpPrompt:[@[chunk2] mutableCopy], - SDLNameTimeoutPrompt:[@[chunk3] mutableCopy], - SDLNameTimeout:@42000, - SDLNameVRHelp:[@[helpItem] mutableCopy], - SDLNameInteractionLayout:SDLLayoutModeIconWithSearch}, - SDLNameOperationName:SDLNamePerformInteraction}} mutableCopy]; + NSMutableDictionary* dict = [@{SDLRPCParameterNameRequest: + @{SDLRPCParameterNameParameters: + @{SDLRPCParameterNameInitialText:@"a", + SDLRPCParameterNameInitialPrompt:[@[chunk1] mutableCopy], + SDLRPCParameterNameInteractionMode:SDLInteractionModeVoiceRecognitionOnly, + SDLRPCParameterNameInteractionChoiceSetIdList:[@[@1, @2, @3] mutableCopy], + SDLRPCParameterNameHelpPrompt:[@[chunk2] mutableCopy], + SDLRPCParameterNameTimeoutPrompt:[@[chunk3] mutableCopy], + SDLRPCParameterNameTimeout:@42000, + SDLRPCParameterNameVRHelp:[@[helpItem] mutableCopy], + SDLRPCParameterNameInteractionLayout:SDLLayoutModeIconWithSearch}, + SDLRPCParameterNameOperationName:SDLRPCFunctionNamePerformInteraction}} mutableCopy]; SDLPerformInteraction* testRequest = [[SDLPerformInteraction alloc] initWithDictionary:dict]; expect(testRequest.initialText).to(equal(@"a")); diff --git a/SmartDeviceLinkTests/RPCSpecs/RequestSpecs/SDLPublishAppServiceSpec.m b/SmartDeviceLinkTests/RPCSpecs/RequestSpecs/SDLPublishAppServiceSpec.m new file mode 100644 index 000000000..a11ec3fb0 --- /dev/null +++ b/SmartDeviceLinkTests/RPCSpecs/RequestSpecs/SDLPublishAppServiceSpec.m @@ -0,0 +1,59 @@ +// +// SDLPublishAppServiceSpec.m +// SmartDeviceLinkTests +// +// Created by Nicole on 2/5/19. +// Copyright © 2019 smartdevicelink. All rights reserved. +// + +#import <Quick/Quick.h> +#import <Nimble/Nimble.h> + +#import "SDLAppServiceManifest.h" +#import "SDLPublishAppService.h" +#import "SDLRPCParameterNames.h" +#import "SDLRPCFunctionNames.h" + +QuickSpecBegin(SDLPublishAppServiceSpec) + +describe(@"Getter/Setter Tests", ^{ + __block SDLAppServiceManifest *testAppServiceManifest = nil; + + beforeEach(^{ + testAppServiceManifest = [[SDLAppServiceManifest alloc] init]; + }); + + it(@"Should set and get correctly", ^{ + SDLPublishAppService *testRequest = [[SDLPublishAppService alloc] init]; + testRequest.appServiceManifest = testAppServiceManifest; + + expect(testRequest.appServiceManifest).to(equal(testAppServiceManifest)); + }); + + it(@"Should return nil if not set", ^{ + SDLPublishAppService *testRequest = [[SDLPublishAppService alloc] init]; + + expect(testRequest.appServiceManifest).to(beNil()); + }); + + describe(@"initializing", ^{ + it(@"Should initialize correctly with a dictionary", ^{ + NSDictionary *dict = @{SDLRPCParameterNameRequest:@{ + SDLRPCParameterNameParameters:@{ + SDLRPCParameterNameAppServiceManifest:testAppServiceManifest + }, + SDLRPCParameterNameOperationName:SDLRPCFunctionNamePublishAppService}}; + SDLPublishAppService *testRequest = [[SDLPublishAppService alloc] initWithDictionary:dict]; + + expect(testRequest.appServiceManifest).to(equal(testAppServiceManifest)); + }); + + it(@"Should initialize correctly with initWithAppServiceManifest:", ^{ + SDLPublishAppService *testRequest = [[SDLPublishAppService alloc] initWithAppServiceManifest:testAppServiceManifest]; + + expect(testRequest.appServiceManifest).to(equal(testAppServiceManifest)); + }); + }); +}); + +QuickSpecEnd diff --git a/SmartDeviceLinkTests/RPCSpecs/RequestSpecs/SDLPutFileSpec.m b/SmartDeviceLinkTests/RPCSpecs/RequestSpecs/SDLPutFileSpec.m index 88b7310f5..b8c8f4f6b 100644 --- a/SmartDeviceLinkTests/RPCSpecs/RequestSpecs/SDLPutFileSpec.m +++ b/SmartDeviceLinkTests/RPCSpecs/RequestSpecs/SDLPutFileSpec.m @@ -9,7 +9,8 @@ #import <Nimble/Nimble.h> #import "SDLFileType.h" -#import "SDLNames.h" +#import "SDLRPCParameterNames.h" +#import "SDLRPCFunctionNames.h" #import "SDLPutFile.h" #import <zlib.h> @@ -43,16 +44,16 @@ describe(@"Getter/Setter Tests", ^ { }); it(@"Should get and set correctly when initialized", ^ { - NSMutableDictionary* dict = [@{SDLNameRequest: - @{SDLNameParameters: - @{ SDLNameSyncFileName:@"fileName", - SDLNameFileType:SDLFileTypeJPEG, - SDLNamePersistentFile:@YES, - SDLNameSystemFile:@NO, - SDLNameOffset:@987654321, - SDLNameLength:@123456789, - SDLNameCRC:@0xffffffff}, - SDLNameOperationName:SDLNamePutFile}} mutableCopy]; + NSMutableDictionary* dict = [@{SDLRPCParameterNameRequest: + @{SDLRPCParameterNameParameters: + @{ SDLRPCParameterNameSyncFileName:@"fileName", + SDLRPCParameterNameFileType:SDLFileTypeJPEG, + SDLRPCParameterNamePersistentFile:@YES, + SDLRPCParameterNameSystemFile:@NO, + SDLRPCParameterNameOffset:@987654321, + SDLRPCParameterNameLength:@123456789, + SDLRPCParameterNameCRC:@0xffffffff}, + SDLRPCParameterNameOperationName:SDLRPCFunctionNamePutFile}} mutableCopy]; SDLPutFile* testRequest = [[SDLPutFile alloc] initWithDictionary:dict]; expect(testRequest.syncFileName).to(equal(@"fileName")); diff --git a/SmartDeviceLinkTests/RPCSpecs/RequestSpecs/SDLReadDIDSpec.m b/SmartDeviceLinkTests/RPCSpecs/RequestSpecs/SDLReadDIDSpec.m index f0290c3b6..a5ee105d1 100644 --- a/SmartDeviceLinkTests/RPCSpecs/RequestSpecs/SDLReadDIDSpec.m +++ b/SmartDeviceLinkTests/RPCSpecs/RequestSpecs/SDLReadDIDSpec.m @@ -9,7 +9,8 @@ #import <Nimble/Nimble.h> #import "SDLReadDID.h" -#import "SDLNames.h" +#import "SDLRPCParameterNames.h" +#import "SDLRPCFunctionNames.h" QuickSpecBegin(SDLReadDIDSpec) @@ -25,11 +26,11 @@ describe(@"Getter/Setter Tests", ^ { }); it(@"Should get correctly when initialized", ^ { - NSMutableDictionary<NSString *, id> *dict = [@{SDLNameRequest: - @{SDLNameParameters: - @{SDLNameECUName:@33112, - SDLNameDIDLocation:[@[@200, @201, @205] mutableCopy]}, - SDLNameOperationName:SDLNameEndAudioPassThru}} mutableCopy]; + NSMutableDictionary<NSString *, id> *dict = [@{SDLRPCParameterNameRequest: + @{SDLRPCParameterNameParameters: + @{SDLRPCParameterNameECUName:@33112, + SDLRPCParameterNameDIDLocation:[@[@200, @201, @205] mutableCopy]}, + SDLRPCParameterNameOperationName:SDLRPCFunctionNameEndAudioPassThru}} mutableCopy]; SDLReadDID* testRequest = [[SDLReadDID alloc] initWithDictionary:dict]; expect(testRequest.ecuName).to(equal(@33112)); diff --git a/SmartDeviceLinkTests/RPCSpecs/RequestSpecs/SDLRegisterAppInterfaceSpec.m b/SmartDeviceLinkTests/RPCSpecs/RequestSpecs/SDLRegisterAppInterfaceSpec.m index 6a157725f..d559adaa2 100644 --- a/SmartDeviceLinkTests/RPCSpecs/RequestSpecs/SDLRegisterAppInterfaceSpec.m +++ b/SmartDeviceLinkTests/RPCSpecs/RequestSpecs/SDLRegisterAppInterfaceSpec.m @@ -14,7 +14,8 @@ #import "SDLDeviceInfo.h" #import "SDLLanguage.h" #import "SDLLifecycleConfiguration.h" -#import "SDLNames.h" +#import "SDLRPCParameterNames.h" +#import "SDLRPCFunctionNames.h" #import "SDLRegisterAppInterface.h" #import "SDLSyncMsgVersion.h" #import "SDLTemplateColorScheme.h" @@ -92,26 +93,26 @@ describe(@"RegisterAppInterface Tests", ^{ }); it(@"Should get correctly when initialized with a dictionary", ^ { - NSDictionary* dict = @{SDLNameRequest: - @{SDLNameParameters: - @{SDLNameSyncMessageVersion:version, - SDLNameAppName:appName, - SDLNameTTSName:[@[chunk] mutableCopy], - SDLNameNGNMediaScreenAppName:shortAppName, - SDLNameVRSynonyms:@[vrSynonyms], - SDLNameIsMediaApplication:isMediaApp, - SDLNameLanguageDesired:SDLLanguageNoNo, - SDLNameHMIDisplayLanguageDesired:SDLLanguagePtPt, - SDLNameAppHMIType:appTypes, - SDLNameHashId:resumeHash, - SDLNameDeviceInfo:info, - SDLNameFullAppID:fullAppId, - SDLNameAppId:appId, - SDLNameAppInfo:appInfo, - SDLNameDayColorScheme: colorScheme, - SDLNameNightColorScheme: colorScheme, + NSDictionary* dict = @{SDLRPCParameterNameRequest: + @{SDLRPCParameterNameParameters: + @{SDLRPCParameterNameSyncMessageVersion:version, + SDLRPCParameterNameAppName:appName, + SDLRPCParameterNameTTSName:[@[chunk] mutableCopy], + SDLRPCParameterNameNGNMediaScreenAppName:shortAppName, + SDLRPCParameterNameVRSynonyms:@[vrSynonyms], + SDLRPCParameterNameIsMediaApplication:isMediaApp, + SDLRPCParameterNameLanguageDesired:SDLLanguageNoNo, + SDLRPCParameterNameHMIDisplayLanguageDesired:SDLLanguagePtPt, + SDLRPCParameterNameAppHMIType:appTypes, + SDLRPCParameterNameHashId:resumeHash, + SDLRPCParameterNameDeviceInfo:info, + SDLRPCParameterNameFullAppID:fullAppId, + SDLRPCParameterNameAppId:appId, + SDLRPCParameterNameAppInfo:appInfo, + SDLRPCParameterNameDayColorScheme: colorScheme, + SDLRPCParameterNameNightColorScheme: colorScheme, }, - SDLNameOperationName:SDLNameRegisterAppInterface}}; + SDLRPCParameterNameOperationName:SDLRPCFunctionNameRegisterAppInterface}}; SDLRegisterAppInterface* testRegisterAppInterface = [[SDLRegisterAppInterface alloc] initWithDictionary:dict]; expect(testRegisterAppInterface.syncMsgVersion).to(equal(version)); diff --git a/SmartDeviceLinkTests/RPCSpecs/RequestSpecs/SDLResetGlobalPropertiesSpec.m b/SmartDeviceLinkTests/RPCSpecs/RequestSpecs/SDLResetGlobalPropertiesSpec.m index 1d45f37a4..67ffbbec9 100644 --- a/SmartDeviceLinkTests/RPCSpecs/RequestSpecs/SDLResetGlobalPropertiesSpec.m +++ b/SmartDeviceLinkTests/RPCSpecs/RequestSpecs/SDLResetGlobalPropertiesSpec.m @@ -10,7 +10,8 @@ #import "SDLResetGlobalProperties.h" #import "SDLGlobalProperty.h" -#import "SDLNames.h" +#import "SDLRPCParameterNames.h" +#import "SDLRPCFunctionNames.h" QuickSpecBegin(SDLResetGlobalPropertiesSpec) @@ -24,10 +25,10 @@ describe(@"Getter/Setter Tests", ^ { }); it(@"Should get correctly when initialized", ^ { - NSMutableDictionary* dict = [@{SDLNameRequest: - @{SDLNameParameters: - @{SDLNameProperties:[@[SDLGlobalPropertyMenuName, SDLGlobalPropertyVoiceRecognitionHelpTitle] copy]}, - SDLNameOperationName:SDLNameResetGlobalProperties}} mutableCopy]; + NSMutableDictionary* dict = [@{SDLRPCParameterNameRequest: + @{SDLRPCParameterNameParameters: + @{SDLRPCParameterNameProperties:[@[SDLGlobalPropertyMenuName, SDLGlobalPropertyVoiceRecognitionHelpTitle] copy]}, + SDLRPCParameterNameOperationName:SDLRPCFunctionNameResetGlobalProperties}} mutableCopy]; SDLResetGlobalProperties* testRequest = [[SDLResetGlobalProperties alloc] initWithDictionary:dict]; expect(testRequest.properties).to(equal([@[SDLGlobalPropertyMenuName, SDLGlobalPropertyVoiceRecognitionHelpTitle] copy])); diff --git a/SmartDeviceLinkTests/RPCSpecs/RequestSpecs/SDLScrollableMessageSpec.m b/SmartDeviceLinkTests/RPCSpecs/RequestSpecs/SDLScrollableMessageSpec.m index f4b50c3f9..d8074b2eb 100644 --- a/SmartDeviceLinkTests/RPCSpecs/RequestSpecs/SDLScrollableMessageSpec.m +++ b/SmartDeviceLinkTests/RPCSpecs/RequestSpecs/SDLScrollableMessageSpec.m @@ -10,7 +10,8 @@ #import "SDLScrollableMessage.h" #import "SDLSoftButton.h" -#import "SDLNames.h" +#import "SDLRPCParameterNames.h" +#import "SDLRPCFunctionNames.h" QuickSpecBegin(SDLScrollableMessageSpec) @@ -30,12 +31,12 @@ describe(@"Getter/Setter Tests", ^ { }); it(@"Should get correctly when initialized", ^ { - NSMutableDictionary<NSString *, id> *dict = [@{SDLNameRequest: - @{SDLNameParameters: - @{SDLNameScrollableMessageBody:@"thatmessagebody", - SDLNameTimeout:@9182, - SDLNameSoftButtons:[@[button] mutableCopy]}, - SDLNameOperationName:SDLNameScrollableMessage}} mutableCopy]; + NSMutableDictionary<NSString *, id> *dict = [@{SDLRPCParameterNameRequest: + @{SDLRPCParameterNameParameters: + @{SDLRPCParameterNameScrollableMessageBody:@"thatmessagebody", + SDLRPCParameterNameTimeout:@9182, + SDLRPCParameterNameSoftButtons:[@[button] mutableCopy]}, + SDLRPCParameterNameOperationName:SDLRPCFunctionNameScrollableMessage}} mutableCopy]; SDLScrollableMessage* testRequest = [[SDLScrollableMessage alloc] initWithDictionary:dict]; expect(testRequest.scrollableMessageBody).to(equal(@"thatmessagebody")); diff --git a/SmartDeviceLinkTests/RPCSpecs/RequestSpecs/SDLSendHapticDataSpec.m b/SmartDeviceLinkTests/RPCSpecs/RequestSpecs/SDLSendHapticDataSpec.m index 24bf7ddb2..d02e8f9bb 100644 --- a/SmartDeviceLinkTests/RPCSpecs/RequestSpecs/SDLSendHapticDataSpec.m +++ b/SmartDeviceLinkTests/RPCSpecs/RequestSpecs/SDLSendHapticDataSpec.m @@ -11,7 +11,8 @@ #import <Quick/Quick.h> #import <Nimble/Nimble.h> -#import "SDLNames.h" +#import "SDLRPCParameterNames.h" +#import "SDLRPCFunctionNames.h" #import "SDLHapticRect.h" #import "SDLRectangle.h" #import "SDLSendHapticData.h" @@ -36,10 +37,10 @@ describe(@"Initialization Tests", ^ { context(@"Init tests", ^{ it(@"Should get correctly when initialized with a dictionary", ^ { - NSMutableDictionary* dict = [@{SDLNameRequest: - @{SDLNameParameters: - @{SDLNameHapticRectData:@[testStruct]}, - SDLNameOperationName:SDLNameSendHapticData}} mutableCopy]; + NSMutableDictionary* dict = [@{SDLRPCParameterNameRequest: + @{SDLRPCParameterNameParameters: + @{SDLRPCParameterNameHapticRectData:@[testStruct]}, + SDLRPCParameterNameOperationName:SDLRPCFunctionNameSendHapticData}} mutableCopy]; SDLSendHapticData *testRequest = [[SDLSendHapticData alloc] initWithDictionary:dict]; expect(testRequest.hapticRectData).to(equal(@[testStruct])); diff --git a/SmartDeviceLinkTests/RPCSpecs/RequestSpecs/SDLSendLocationSpec.m b/SmartDeviceLinkTests/RPCSpecs/RequestSpecs/SDLSendLocationSpec.m index c0539943a..43c02d4c4 100644 --- a/SmartDeviceLinkTests/RPCSpecs/RequestSpecs/SDLSendLocationSpec.m +++ b/SmartDeviceLinkTests/RPCSpecs/RequestSpecs/SDLSendLocationSpec.m @@ -5,7 +5,8 @@ #import <Quick/Quick.h> #import <Nimble/Nimble.h> -#import "SDLNames.h" +#import "SDLRPCParameterNames.h" +#import "SDLRPCFunctionNames.h" #import "SDLSendLocation.h" @@ -163,19 +164,20 @@ describe(@"Send Location RPC", ^{ someTime = [[SDLDateTime alloc] init]; someAddress = [[SDLOasisAddress alloc] init]; NSDictionary *initDict = @{ - SDLNameRequest: @{ - SDLNameParameters: @{ - SDLNameLongitudeDegrees: someLongitude, - SDLNameLatitudeDegrees: someLatitude, - SDLNameLocationName: someLocation, - SDLNameLocationDescription: someLocationDescription, - SDLNameAddressLines: someAddressLines, - SDLNamePhoneNumber: somePhoneNumber, - SDLNameLocationImage: someImage, - SDLNameDeliveryMode: someDeliveryMode, - SDLNameLocationTimeStamp: someTime, - SDLNameAddress: someAddress - } + SDLRPCParameterNameRequest: @{ + SDLRPCParameterNameParameters: @{ + SDLRPCParameterNameLongitudeDegrees: someLongitude, + SDLRPCParameterNameLatitudeDegrees: someLatitude, + SDLRPCParameterNameLocationName: someLocation, + SDLRPCParameterNameLocationDescription: someLocationDescription, + SDLRPCParameterNameAddressLines: someAddressLines, + SDLRPCParameterNamePhoneNumber: somePhoneNumber, + SDLRPCParameterNameLocationImage: someImage, + SDLRPCParameterNameDeliveryMode: someDeliveryMode, + SDLRPCParameterNameTimeStamp: someTime, + SDLRPCParameterNameAddress: someAddress + }, + SDLRPCParameterNameOperationName:SDLRPCFunctionNameSendLocation } }; @@ -237,8 +239,8 @@ describe(@"Send Location RPC", ^{ context(@"when parameters are not set", ^{ beforeEach(^{ NSDictionary<NSString *, id> *initDict = @{ - SDLNameRequest: @{ - SDLNameParameters: @{} + SDLRPCParameterNameRequest: @{ + SDLRPCParameterNameParameters: @{} } }; diff --git a/SmartDeviceLinkTests/RPCSpecs/RequestSpecs/SDLSetAppIconSpec.m b/SmartDeviceLinkTests/RPCSpecs/RequestSpecs/SDLSetAppIconSpec.m index 29c0f14f5..983d79eeb 100644 --- a/SmartDeviceLinkTests/RPCSpecs/RequestSpecs/SDLSetAppIconSpec.m +++ b/SmartDeviceLinkTests/RPCSpecs/RequestSpecs/SDLSetAppIconSpec.m @@ -9,7 +9,8 @@ #import <Nimble/Nimble.h> #import "SDLSetAppIcon.h" -#import "SDLNames.h" +#import "SDLRPCParameterNames.h" +#import "SDLRPCFunctionNames.h" QuickSpecBegin(SDLSetAppIconSpec) @@ -23,10 +24,10 @@ describe(@"Getter/Setter Tests", ^ { }); it(@"Should get correctly when initialized", ^ { - NSMutableDictionary<NSString *, id> *dict = [@{SDLNameRequest: - @{SDLNameParameters: - @{SDLNameSyncFileName:@"A/File/Name"}, - SDLNameOperationName:SDLNameSetAppIcon}} mutableCopy]; + NSMutableDictionary<NSString *, id> *dict = [@{SDLRPCParameterNameRequest: + @{SDLRPCParameterNameParameters: + @{SDLRPCParameterNameSyncFileName:@"A/File/Name"}, + SDLRPCParameterNameOperationName:SDLRPCFunctionNameSetAppIcon}} mutableCopy]; SDLSetAppIcon* testRequest = [[SDLSetAppIcon alloc] initWithDictionary:dict]; expect(testRequest.syncFileName).to(equal(@"A/File/Name")); diff --git a/SmartDeviceLinkTests/RPCSpecs/RequestSpecs/SDLSetDisplayLayoutSpec.m b/SmartDeviceLinkTests/RPCSpecs/RequestSpecs/SDLSetDisplayLayoutSpec.m index 60880f283..397b2e88b 100644 --- a/SmartDeviceLinkTests/RPCSpecs/RequestSpecs/SDLSetDisplayLayoutSpec.m +++ b/SmartDeviceLinkTests/RPCSpecs/RequestSpecs/SDLSetDisplayLayoutSpec.m @@ -5,7 +5,8 @@ #import <Quick/Quick.h> #import <Nimble/Nimble.h> -#import "SDLNames.h" +#import "SDLRPCParameterNames.h" +#import "SDLRPCFunctionNames.h" #import "SDLSetDisplayLayout.h" #import "SDLTemplateColorScheme.h" @@ -43,10 +44,10 @@ describe(@"SetDisplayLayout Tests", ^ { }); it(@"Should get correctly when initialized", ^ { - NSMutableDictionary<NSString *, id> *dict = [@{SDLNameRequest: - @{SDLNameParameters: - @{SDLNameDisplayLayout:@"wat"}, - SDLNameOperationName:SDLNameSetDisplayLayout}} mutableCopy]; + NSMutableDictionary<NSString *, id> *dict = [@{SDLRPCParameterNameRequest: + @{SDLRPCParameterNameParameters: + @{SDLRPCParameterNameDisplayLayout:@"wat"}, + SDLRPCParameterNameOperationName:SDLRPCFunctionNameSetDisplayLayout}} mutableCopy]; SDLSetDisplayLayout* testRequest = [[SDLSetDisplayLayout alloc] initWithDictionary:dict]; expect(testRequest.displayLayout).to(equal(@"wat")); diff --git a/SmartDeviceLinkTests/RPCSpecs/RequestSpecs/SDLSetGlobalPropertiesSpec.m b/SmartDeviceLinkTests/RPCSpecs/RequestSpecs/SDLSetGlobalPropertiesSpec.m index 15062d29b..f983a1da9 100644 --- a/SmartDeviceLinkTests/RPCSpecs/RequestSpecs/SDLSetGlobalPropertiesSpec.m +++ b/SmartDeviceLinkTests/RPCSpecs/RequestSpecs/SDLSetGlobalPropertiesSpec.m @@ -10,7 +10,8 @@ #import "SDLImage.h" #import "SDLKeyboardProperties.h" -#import "SDLNames.h" +#import "SDLRPCParameterNames.h" +#import "SDLRPCFunctionNames.h" #import "SDLSetGlobalProperties.h" #import "SDLTTSChunk.h" #import "SDLVrHelpItem.h" @@ -46,16 +47,16 @@ describe(@"Getter/Setter Tests", ^ { }); it(@"Should get correctly when initialized", ^ { - NSMutableDictionary<NSString *, id> *dict = [@{SDLNameRequest: - @{SDLNameParameters: - @{SDLNameHelpPrompt:[@[chunk1] mutableCopy], - SDLNameTimeoutPrompt:[@[chunk2] mutableCopy], - SDLNameVRHelpTitle:@"vr", - SDLNameVRHelp:[@[help] mutableCopy], - SDLNameMenuTitle:@"TheNewMenu", - SDLNameMenuIcon:image, - SDLNameKeyboardProperties:keyboard}, - SDLNameOperationName:SDLNameSetGlobalProperties}} mutableCopy]; + NSMutableDictionary<NSString *, id> *dict = [@{SDLRPCParameterNameRequest: + @{SDLRPCParameterNameParameters: + @{SDLRPCParameterNameHelpPrompt:[@[chunk1] mutableCopy], + SDLRPCParameterNameTimeoutPrompt:[@[chunk2] mutableCopy], + SDLRPCParameterNameVRHelpTitle:@"vr", + SDLRPCParameterNameVRHelp:[@[help] mutableCopy], + SDLRPCParameterNameMenuTitle:@"TheNewMenu", + SDLRPCParameterNameMenuIcon:image, + SDLRPCParameterNameKeyboardProperties:keyboard}, + SDLRPCParameterNameOperationName:SDLRPCFunctionNameSetGlobalProperties}} mutableCopy]; SDLSetGlobalProperties* testRequest = [[SDLSetGlobalProperties alloc] initWithDictionary:dict]; expect(testRequest.helpPrompt).to(equal([@[chunk1] mutableCopy])); diff --git a/SmartDeviceLinkTests/RPCSpecs/RequestSpecs/SDLSetInteriorVehicleDataSpec.m b/SmartDeviceLinkTests/RPCSpecs/RequestSpecs/SDLSetInteriorVehicleDataSpec.m index 5eb39c8f2..d77ce6a89 100644 --- a/SmartDeviceLinkTests/RPCSpecs/RequestSpecs/SDLSetInteriorVehicleDataSpec.m +++ b/SmartDeviceLinkTests/RPCSpecs/RequestSpecs/SDLSetInteriorVehicleDataSpec.m @@ -9,7 +9,8 @@ #import <Nimble/Nimble.h> #import "SDLSetInteriorVehicleData.h" -#import "SDLNames.h" +#import "SDLRPCParameterNames.h" +#import "SDLRPCFunctionNames.h" #import "SDLModuleData.h" @@ -26,10 +27,10 @@ describe(@"Getter/Setter Tests", ^ { }); it(@"Should get correctly when initialized", ^ { - NSMutableDictionary<NSString *, id> *dict = [@{SDLNameRequest: - @{SDLNameParameters: - @{SDLNameModuleData : someModuleData}, - SDLNameOperationName:SDLNameSetInteriorVehicleData}} mutableCopy]; + NSMutableDictionary<NSString *, id> *dict = [@{SDLRPCParameterNameRequest: + @{SDLRPCParameterNameParameters: + @{SDLRPCParameterNameModuleData : someModuleData}, + SDLRPCParameterNameOperationName:SDLRPCFunctionNameSetInteriorVehicleData}} mutableCopy]; SDLSetInteriorVehicleData* testRequest = [[SDLSetInteriorVehicleData alloc] initWithDictionary:dict]; expect(testRequest.moduleData).to(equal(someModuleData)); diff --git a/SmartDeviceLinkTests/RPCSpecs/RequestSpecs/SDLSetMediaClockTimerSpec.m b/SmartDeviceLinkTests/RPCSpecs/RequestSpecs/SDLSetMediaClockTimerSpec.m index f2d4fb312..bd806af6b 100644 --- a/SmartDeviceLinkTests/RPCSpecs/RequestSpecs/SDLSetMediaClockTimerSpec.m +++ b/SmartDeviceLinkTests/RPCSpecs/RequestSpecs/SDLSetMediaClockTimerSpec.m @@ -8,7 +8,8 @@ #import <Quick/Quick.h> #import <Nimble/Nimble.h> -#import "SDLNames.h" +#import "SDLRPCParameterNames.h" +#import "SDLRPCFunctionNames.h" #import "SDLSetMediaClockTimer.h" #import "SDLStartTime.h" #import "SDLUpdateMode.h" @@ -26,14 +27,14 @@ describe(@"SetMediaClocktimer Spec", ^ { describe(@"when initialized", ^{ it(@"should properly initialize with initWithDictionary:", ^{ - NSMutableDictionary* dict = [@{SDLNameRequest: - @{SDLNameParameters: - @{SDLNameStartTime:time1, - SDLNameEndTime:time2, - SDLNameUpdateMode:testUpdateMode, - SDLNameAudioStreamingIndicator:testIndicator + NSMutableDictionary* dict = [@{SDLRPCParameterNameRequest: + @{SDLRPCParameterNameParameters: + @{SDLRPCParameterNameStartTime:time1, + SDLRPCParameterNameEndTime:time2, + SDLRPCParameterNameUpdateMode:testUpdateMode, + SDLRPCParameterNameAudioStreamingIndicator:testIndicator }, - SDLNameOperationName:SDLNameSetMediaClockTimer}} mutableCopy]; + SDLRPCParameterNameOperationName:SDLRPCFunctionNameSetMediaClockTimer}} mutableCopy]; SDLSetMediaClockTimer* testRequest = [[SDLSetMediaClockTimer alloc] initWithDictionary:dict]; expect(testRequest.startTime).to(equal(time1)); diff --git a/SmartDeviceLinkTests/RPCSpecs/RequestSpecs/SDLShowConstantTBTSpec.m b/SmartDeviceLinkTests/RPCSpecs/RequestSpecs/SDLShowConstantTBTSpec.m index 491096b84..451dece6d 100644 --- a/SmartDeviceLinkTests/RPCSpecs/RequestSpecs/SDLShowConstantTBTSpec.m +++ b/SmartDeviceLinkTests/RPCSpecs/RequestSpecs/SDLShowConstantTBTSpec.m @@ -9,7 +9,8 @@ #import <Nimble/Nimble.h> #import "SDLImage.h" -#import "SDLNames.h" +#import "SDLRPCParameterNames.h" +#import "SDLRPCFunctionNames.h" #import "SDLShowConstantTBT.h" #import "SDLSoftButton.h" @@ -50,20 +51,20 @@ describe(@"Getter/Setter Tests", ^ { }); it(@"Should get correctly when initialized", ^ { - NSMutableDictionary<NSString *, id> *dict = [@{SDLNameRequest: - @{SDLNameParameters: - @{SDLNameNavigationText1:@"nav1", - SDLNameNavigationText2:@"nav2", - SDLNameETA:@"4/1/7015", - SDLNameTimeToDestination:@"5000 Years", - SDLNameTotalDistance:@"1 parsec", - SDLNameTurnIcon:image1, - SDLNameNextTurnIcon:image2, - SDLNameDistanceToManeuver:@2, - SDLNameDistanceToManeuverScale:@4, - SDLNameManeuverComplete:@NO, - SDLNameSoftButtons:[@[button] mutableCopy]}, - SDLNameOperationName:SDLNameShowConstantTBT}} mutableCopy]; + NSMutableDictionary<NSString *, id> *dict = [@{SDLRPCParameterNameRequest: + @{SDLRPCParameterNameParameters: + @{SDLRPCParameterNameNavigationText1:@"nav1", + SDLRPCParameterNameNavigationText2:@"nav2", + SDLRPCParameterNameETA:@"4/1/7015", + SDLRPCParameterNameTimeToDestination:@"5000 Years", + SDLRPCParameterNameTotalDistance:@"1 parsec", + SDLRPCParameterNameTurnIcon:image1, + SDLRPCParameterNameNextTurnIcon:image2, + SDLRPCParameterNameDistanceToManeuver:@2, + SDLRPCParameterNameDistanceToManeuverScale:@4, + SDLRPCParameterNameManeuverComplete:@NO, + SDLRPCParameterNameSoftButtons:[@[button] mutableCopy]}, + SDLRPCParameterNameOperationName:SDLRPCFunctionNameShowConstantTBT}} mutableCopy]; SDLShowConstantTBT* testRequest = [[SDLShowConstantTBT alloc] initWithDictionary:dict]; expect(testRequest.navigationText1).to(equal(@"nav1")); diff --git a/SmartDeviceLinkTests/RPCSpecs/RequestSpecs/SDLShowSpec.m b/SmartDeviceLinkTests/RPCSpecs/RequestSpecs/SDLShowSpec.m index cab6d5867..341500b20 100644 --- a/SmartDeviceLinkTests/RPCSpecs/RequestSpecs/SDLShowSpec.m +++ b/SmartDeviceLinkTests/RPCSpecs/RequestSpecs/SDLShowSpec.m @@ -11,7 +11,8 @@ #import "SDLImage.h" #import "SDLMetadataTags.h" #import "SDLMetadataType.h" -#import "SDLNames.h" +#import "SDLRPCParameterNames.h" +#import "SDLRPCFunctionNames.h" #import "SDLShow.h" #import "SDLSoftButton.h" #import "SDLTextAlignment.h" @@ -312,22 +313,22 @@ describe(@"Getter/Setter Tests", ^ { }); it(@"Should get correctly when initialized with a dictionary", ^ { - NSMutableDictionary* dict = [@{SDLNameRequest: - @{SDLNameParameters: - @{SDLNameMainField1:@"field1", - SDLNameMainField2:@"field2", - SDLNameMainField3:@"field3", - SDLNameMainField4:@"field4", - SDLNameAlignment:SDLTextAlignmentLeft, - SDLNameStatusBar:@"status", - SDLNameMediaClock:@"TheTime", - SDLNameMediaTrack:@"In The Clear", - SDLNameGraphic:image1, - SDLNameSecondaryGraphic:image2, - SDLNameSoftButtons:[@[button] mutableCopy], - SDLNameCustomPresets:[@[@"preset1", @"preset2"] mutableCopy], - SDLNameMetadataTags:testMetadata}, - SDLNameOperationName:SDLNameShow}} mutableCopy]; + NSMutableDictionary* dict = [@{SDLRPCParameterNameRequest: + @{SDLRPCParameterNameParameters: + @{SDLRPCParameterNameMainField1:@"field1", + SDLRPCParameterNameMainField2:@"field2", + SDLRPCParameterNameMainField3:@"field3", + SDLRPCParameterNameMainField4:@"field4", + SDLRPCParameterNameAlignment:SDLTextAlignmentLeft, + SDLRPCParameterNameStatusBar:@"status", + SDLRPCParameterNameMediaClock:@"TheTime", + SDLRPCParameterNameMediaTrack:@"In The Clear", + SDLRPCParameterNameGraphic:image1, + SDLRPCParameterNameSecondaryGraphic:image2, + SDLRPCParameterNameSoftButtons:[@[button] mutableCopy], + SDLRPCParameterNameCustomPresets:[@[@"preset1", @"preset2"] mutableCopy], + SDLRPCParameterNameMetadataTags:testMetadata}, + SDLRPCParameterNameOperationName:SDLRPCFunctionNameShow}} mutableCopy]; SDLShow* testRequest = [[SDLShow alloc] initWithDictionary:dict]; expect(testRequest.mainField1).to(equal(@"field1")); diff --git a/SmartDeviceLinkTests/RPCSpecs/RequestSpecs/SDLSliderSpec.m b/SmartDeviceLinkTests/RPCSpecs/RequestSpecs/SDLSliderSpec.m index e1fb58dc1..e5b3ba339 100644 --- a/SmartDeviceLinkTests/RPCSpecs/RequestSpecs/SDLSliderSpec.m +++ b/SmartDeviceLinkTests/RPCSpecs/RequestSpecs/SDLSliderSpec.m @@ -9,7 +9,8 @@ #import <Nimble/Nimble.h> #import "SDLSlider.h" -#import "SDLNames.h" +#import "SDLRPCParameterNames.h" +#import "SDLRPCFunctionNames.h" QuickSpecBegin(SDLSliderSpec) @@ -49,14 +50,14 @@ describe(@"Getter/Setter Tests", ^ { }); it(@"Should get correctly when initialized with a dictionary", ^ { - NSDictionary<NSString *, id> *dict = @{SDLNameRequest: - @{SDLNameParameters: - @{SDLNameNumberTicks:@(testNumTicks), - SDLNamePosition:@(testPosition), - SDLNameSliderHeader:testHeader, - SDLNameSliderFooter:testFooters, - SDLNameTimeout:@(testTimeout)}, - SDLNameOperationName:SDLNameSlider}}; + NSDictionary<NSString *, id> *dict = @{SDLRPCParameterNameRequest: + @{SDLRPCParameterNameParameters: + @{SDLRPCParameterNameNumberTicks:@(testNumTicks), + SDLRPCParameterNamePosition:@(testPosition), + SDLRPCParameterNameSliderHeader:testHeader, + SDLRPCParameterNameSliderFooter:testFooters, + SDLRPCParameterNameTimeout:@(testTimeout)}, + SDLRPCParameterNameOperationName:SDLRPCFunctionNameSlider}}; testRequest = [[SDLSlider alloc] initWithDictionary:dict]; expect(testRequest.numTicks).to(equal(testNumTicks)); diff --git a/SmartDeviceLinkTests/RPCSpecs/RequestSpecs/SDLSpeakSpec.m b/SmartDeviceLinkTests/RPCSpecs/RequestSpecs/SDLSpeakSpec.m index e336b0067..761c10505 100644 --- a/SmartDeviceLinkTests/RPCSpecs/RequestSpecs/SDLSpeakSpec.m +++ b/SmartDeviceLinkTests/RPCSpecs/RequestSpecs/SDLSpeakSpec.m @@ -10,7 +10,8 @@ #import "SDLSpeak.h" #import "SDLTTSChunk.h" -#import "SDLNames.h" +#import "SDLRPCParameterNames.h" +#import "SDLRPCFunctionNames.h" QuickSpecBegin(SDLSpeakSpec) @@ -26,10 +27,10 @@ describe(@"Getter/Setter Tests", ^ { }); it(@"Should get correctly when initialized", ^ { - NSMutableDictionary<NSString *, id> *dict = [@{SDLNameRequest: - @{SDLNameParameters: - @{SDLNameTTSChunks:[@[chunk] mutableCopy]}, - SDLNameOperationName:SDLNameSpeak}} mutableCopy]; + NSMutableDictionary<NSString *, id> *dict = [@{SDLRPCParameterNameRequest: + @{SDLRPCParameterNameParameters: + @{SDLRPCParameterNameTTSChunks:[@[chunk] mutableCopy]}, + SDLRPCParameterNameOperationName:SDLRPCFunctionNameSpeak}} mutableCopy]; SDLSpeak* testRequest = [[SDLSpeak alloc] initWithDictionary:dict]; expect(testRequest.ttsChunks).to(equal([@[chunk] mutableCopy])); diff --git a/SmartDeviceLinkTests/RPCSpecs/RequestSpecs/SDLSubscribeButtonSpec.m b/SmartDeviceLinkTests/RPCSpecs/RequestSpecs/SDLSubscribeButtonSpec.m index c541ccc40..d748e24bd 100644 --- a/SmartDeviceLinkTests/RPCSpecs/RequestSpecs/SDLSubscribeButtonSpec.m +++ b/SmartDeviceLinkTests/RPCSpecs/RequestSpecs/SDLSubscribeButtonSpec.m @@ -9,7 +9,8 @@ #import <Nimble/Nimble.h> #import "SDLButtonName.h" -#import "SDLNames.h" +#import "SDLRPCParameterNames.h" +#import "SDLRPCFunctionNames.h" #import "SDLSubscribeButton.h" @@ -25,10 +26,10 @@ describe(@"Getter/Setter Tests", ^ { }); it(@"Should get correctly when initialized", ^ { - NSMutableDictionary* dict = [@{SDLNameRequest: - @{SDLNameParameters: - @{SDLNameButtonName:SDLButtonNamePreset5}, - SDLNameOperationName:SDLNameSubscribeButton}} mutableCopy]; + NSMutableDictionary* dict = [@{SDLRPCParameterNameRequest: + @{SDLRPCParameterNameParameters: + @{SDLRPCParameterNameButtonName:SDLButtonNamePreset5}, + SDLRPCParameterNameOperationName:SDLRPCFunctionNameSubscribeButton}} mutableCopy]; SDLSubscribeButton* testRequest = [[SDLSubscribeButton alloc] initWithDictionary:dict]; expect(testRequest.buttonName).to(equal(SDLButtonNamePreset5)); diff --git a/SmartDeviceLinkTests/RPCSpecs/RequestSpecs/SDLSubscribeVehicleDataSpec.m b/SmartDeviceLinkTests/RPCSpecs/RequestSpecs/SDLSubscribeVehicleDataSpec.m index ba0671043..c90c8a45e 100644 --- a/SmartDeviceLinkTests/RPCSpecs/RequestSpecs/SDLSubscribeVehicleDataSpec.m +++ b/SmartDeviceLinkTests/RPCSpecs/RequestSpecs/SDLSubscribeVehicleDataSpec.m @@ -9,7 +9,8 @@ #import <Nimble/Nimble.h> #import "SDLSubscribeVehicleData.h" -#import "SDLNames.h" +#import "SDLRPCParameterNames.h" +#import "SDLRPCFunctionNames.h" QuickSpecBegin(SDLSubscribeVehicleDataSpec) @@ -78,39 +79,39 @@ describe(@"Getter/Setter Tests", ^ { expect(testRequest.wiperStatus).to(equal(@NO)); }); - it(@"Should get correctly when initialized", ^ { - NSDictionary<NSString *, id> *dict = @{SDLNameRequest: - @{SDLNameParameters: - @{SDLNameAccelerationPedalPosition:@YES, - SDLNameAirbagStatus:@YES, - SDLNameBeltStatus:@YES, - SDLNameBodyInformation:@YES, - SDLNameCloudAppVehicleID:@YES, - SDLNameClusterModeStatus:@YES, - SDLNameDeviceStatus:@YES, - SDLNameDriverBraking:@YES, - SDLNameECallInfo:@YES, - SDLNameElectronicParkBrakeStatus: @YES, - SDLNameEmergencyEvent:@NO, - SDLNameEngineOilLife:@YES, - SDLNameEngineTorque:@YES, - SDLNameExternalTemperature:@NO, - SDLNameFuelLevel:@YES, - SDLNameFuelLevelState:@YES, - SDLNameFuelRange:@YES, - SDLNameGPS:@YES, - SDLNameHeadLampStatus:@YES, - SDLNameInstantFuelConsumption:@YES, - SDLNameMyKey:@YES, - SDLNameOdometer:@YES, - SDLNamePRNDL:@YES, - SDLNameRPM:@YES, - SDLNameSpeed:@YES, - SDLNameSteeringWheelAngle:@NO, - SDLNameTirePressure:@YES, - SDLNameTurnSignal:@NO, - SDLNameWiperStatus:@NO}, - SDLNameOperationName:SDLNameSubscribeVehicleData}}; + it(@"Should get correctly when initialized with a dictionary", ^ { + NSDictionary<NSString *, id> *dict = @{SDLRPCParameterNameRequest: + @{SDLRPCParameterNameParameters: + @{SDLRPCParameterNameAccelerationPedalPosition:@YES, + SDLRPCParameterNameAirbagStatus:@YES, + SDLRPCParameterNameBeltStatus:@YES, + SDLRPCParameterNameBodyInformation:@YES, + SDLRPCParameterNameCloudAppVehicleID:@YES, + SDLRPCParameterNameClusterModeStatus:@YES, + SDLRPCParameterNameDeviceStatus:@YES, + SDLRPCParameterNameDriverBraking:@YES, + SDLRPCParameterNameECallInfo:@YES, + SDLRPCParameterNameElectronicParkBrakeStatus: @YES, + SDLRPCParameterNameEmergencyEvent:@NO, + SDLRPCParameterNameEngineOilLife:@YES, + SDLRPCParameterNameEngineTorque:@YES, + SDLRPCParameterNameExternalTemperature:@NO, + SDLRPCParameterNameFuelLevel:@YES, + SDLRPCParameterNameFuelLevelState:@YES, + SDLRPCParameterNameFuelRange:@YES, + SDLRPCParameterNameGPS:@YES, + SDLRPCParameterNameHeadLampStatus:@YES, + SDLRPCParameterNameInstantFuelConsumption:@YES, + SDLRPCParameterNameMyKey:@YES, + SDLRPCParameterNameOdometer:@YES, + SDLRPCParameterNamePRNDL:@YES, + SDLRPCParameterNameRPM:@YES, + SDLRPCParameterNameSpeed:@YES, + SDLRPCParameterNameSteeringWheelAngle:@NO, + SDLRPCParameterNameTirePressure:@YES, + SDLRPCParameterNameTurnSignal:@NO, + SDLRPCParameterNameWiperStatus:@NO}, + SDLRPCParameterNameOperationName:SDLRPCFunctionNameSubscribeVehicleData}}; SDLSubscribeVehicleData* testRequest = [[SDLSubscribeVehicleData alloc] initWithDictionary:dict]; expect(testRequest.accPedalPosition).to(equal(@YES)); diff --git a/SmartDeviceLinkTests/RPCSpecs/RequestSpecs/SDLSyncPDataSpec.m b/SmartDeviceLinkTests/RPCSpecs/RequestSpecs/SDLSyncPDataSpec.m index 300583447..5ab7f0171 100644 --- a/SmartDeviceLinkTests/RPCSpecs/RequestSpecs/SDLSyncPDataSpec.m +++ b/SmartDeviceLinkTests/RPCSpecs/RequestSpecs/SDLSyncPDataSpec.m @@ -9,7 +9,7 @@ #import <Nimble/Nimble.h> #import "SDLSyncPData.h" -#import "SDLNames.h" +#import "SDLRPCParameterNames.h" QuickSpecBegin(SDLSyncPDataSpec) diff --git a/SmartDeviceLinkTests/RPCSpecs/RequestSpecs/SDLSystemRequestSpec.m b/SmartDeviceLinkTests/RPCSpecs/RequestSpecs/SDLSystemRequestSpec.m index 80b1543e8..1b27f45a8 100644 --- a/SmartDeviceLinkTests/RPCSpecs/RequestSpecs/SDLSystemRequestSpec.m +++ b/SmartDeviceLinkTests/RPCSpecs/RequestSpecs/SDLSystemRequestSpec.m @@ -10,7 +10,8 @@ #import "SDLSystemRequest.h" #import "SDLRequestType.h" -#import "SDLNames.h" +#import "SDLRPCParameterNames.h" +#import "SDLRPCFunctionNames.h" QuickSpecBegin(SDLSystemRequestSpec) @@ -21,12 +22,12 @@ describe(@"Getter/Setter Tests", ^ { describe(@"initializers", ^{ it(@"should get correctly when initialized with dictionary", ^ { - NSMutableDictionary* dict = [@{SDLNameRequest: - @{SDLNameParameters: - @{SDLNameRequestType:SDLRequestTypeAuthenticationRequest, - SDLNameRequestSubType: testSubType, - SDLNameFilename:testFileName}, - SDLNameOperationName:SDLNameSystemRequest}} mutableCopy]; + NSMutableDictionary* dict = [@{SDLRPCParameterNameRequest: + @{SDLRPCParameterNameParameters: + @{SDLRPCParameterNameRequestType:SDLRequestTypeAuthenticationRequest, + SDLRPCParameterNameRequestSubType: testSubType, + SDLRPCParameterNameFilename:testFileName}, + SDLRPCParameterNameOperationName:SDLRPCFunctionNameSystemRequest}} mutableCopy]; SDLSystemRequest* testRequest = [[SDLSystemRequest alloc] initWithDictionary:dict]; expect(testRequest.requestType).to(equal(testRequestType)); diff --git a/SmartDeviceLinkTests/RPCSpecs/RequestSpecs/SDLUnregisterAppInterfaceSpec.m b/SmartDeviceLinkTests/RPCSpecs/RequestSpecs/SDLUnregisterAppInterfaceSpec.m index 746c07d2b..e610e7aa2 100644 --- a/SmartDeviceLinkTests/RPCSpecs/RequestSpecs/SDLUnregisterAppInterfaceSpec.m +++ b/SmartDeviceLinkTests/RPCSpecs/RequestSpecs/SDLUnregisterAppInterfaceSpec.m @@ -9,7 +9,7 @@ #import <Nimble/Nimble.h> #import "SDLUnregisterAppInterface.h" -#import "SDLNames.h" +#import "SDLRPCParameterNames.h" QuickSpecBegin(SDLUnregisterAppInterfaceSpec) diff --git a/SmartDeviceLinkTests/RPCSpecs/RequestSpecs/SDLUnsubscribeButtonSpec.m b/SmartDeviceLinkTests/RPCSpecs/RequestSpecs/SDLUnsubscribeButtonSpec.m index e4d693685..dd7f72d28 100644 --- a/SmartDeviceLinkTests/RPCSpecs/RequestSpecs/SDLUnsubscribeButtonSpec.m +++ b/SmartDeviceLinkTests/RPCSpecs/RequestSpecs/SDLUnsubscribeButtonSpec.m @@ -9,7 +9,8 @@ #import <Nimble/Nimble.h> #import "SDLButtonName.h" -#import "SDLNames.h" +#import "SDLRPCParameterNames.h" +#import "SDLRPCFunctionNames.h" #import "SDLUnsubscribeButton.h" @@ -25,10 +26,10 @@ describe(@"Getter/Setter Tests", ^ { }); it(@"Should get correctly when initialized", ^ { - NSMutableDictionary* dict = [@{SDLNameRequest: - @{SDLNameParameters: - @{SDLNameButtonName:SDLButtonNamePreset0}, - SDLNameOperationName:SDLNameUnsubscribeButton}} mutableCopy]; + NSMutableDictionary* dict = [@{SDLRPCParameterNameRequest: + @{SDLRPCParameterNameParameters: + @{SDLRPCParameterNameButtonName:SDLButtonNamePreset0}, + SDLRPCParameterNameOperationName:SDLRPCFunctionNameUnsubscribeButton}} mutableCopy]; SDLUnsubscribeButton* testRequest = [[SDLUnsubscribeButton alloc] initWithDictionary:dict]; expect(testRequest.buttonName).to(equal(SDLButtonNamePreset0)); diff --git a/SmartDeviceLinkTests/RPCSpecs/RequestSpecs/SDLUnsubscribeVehicleDataSpec.m b/SmartDeviceLinkTests/RPCSpecs/RequestSpecs/SDLUnsubscribeVehicleDataSpec.m index 6dd9da0a2..f538f412e 100644 --- a/SmartDeviceLinkTests/RPCSpecs/RequestSpecs/SDLUnsubscribeVehicleDataSpec.m +++ b/SmartDeviceLinkTests/RPCSpecs/RequestSpecs/SDLUnsubscribeVehicleDataSpec.m @@ -9,7 +9,8 @@ #import <Nimble/Nimble.h> #import "SDLUnsubscribeVehicleData.h" -#import "SDLNames.h" +#import "SDLRPCParameterNames.h" +#import "SDLRPCFunctionNames.h" QuickSpecBegin(SDLUnsubscribeVehicleDataSpec) @@ -78,39 +79,39 @@ describe(@"Getter/Setter Tests", ^ { expect(testRequest.wiperStatus).to(equal(@YES)); }); - it(@"Should get correctly when initialized", ^ { - NSDictionary<NSString *, id> *dict = @{SDLNameRequest: - @{SDLNameParameters: - @{SDLNameAccelerationPedalPosition:@YES, - SDLNameAirbagStatus:@YES, - SDLNameBeltStatus:@YES, - SDLNameBodyInformation:@YES, - SDLNameCloudAppVehicleID:@YES, - SDLNameClusterModeStatus:@YES, - SDLNameDeviceStatus:@YES, - SDLNameDriverBraking:@YES, - SDLNameECallInfo:@YES, - SDLNameElectronicParkBrakeStatus: @YES, - SDLNameEmergencyEvent:@YES, - SDLNameEngineOilLife:@YES, - SDLNameEngineTorque:@YES, - SDLNameExternalTemperature:@YES, - SDLNameFuelLevel:@YES, - SDLNameFuelLevelState:@YES, - SDLNameFuelRange:@YES, - SDLNameGPS:@YES, - SDLNameHeadLampStatus:@YES, - SDLNameInstantFuelConsumption:@YES, - SDLNameMyKey:@YES, - SDLNameOdometer:@YES, - SDLNamePRNDL:@YES, - SDLNameRPM:@YES, - SDLNameSpeed:@YES, - SDLNameSteeringWheelAngle:@YES, - SDLNameTirePressure:@YES, - SDLNameTurnSignal:@YES, - SDLNameWiperStatus:@YES}, - SDLNameOperationName:SDLNameUnsubscribeVehicleData}}; + it(@"Should get correctly when initialized with a dictionary", ^ { + NSDictionary<NSString *, id> *dict = @{SDLRPCParameterNameRequest: + @{SDLRPCParameterNameParameters: + @{SDLRPCParameterNameAccelerationPedalPosition:@YES, + SDLRPCParameterNameAirbagStatus:@YES, + SDLRPCParameterNameBeltStatus:@YES, + SDLRPCParameterNameBodyInformation:@YES, + SDLRPCParameterNameCloudAppVehicleID:@YES, + SDLRPCParameterNameClusterModeStatus:@YES, + SDLRPCParameterNameDeviceStatus:@YES, + SDLRPCParameterNameDriverBraking:@YES, + SDLRPCParameterNameECallInfo:@YES, + SDLRPCParameterNameElectronicParkBrakeStatus: @YES, + SDLRPCParameterNameEmergencyEvent:@YES, + SDLRPCParameterNameEngineOilLife:@YES, + SDLRPCParameterNameEngineTorque:@YES, + SDLRPCParameterNameExternalTemperature:@YES, + SDLRPCParameterNameFuelLevel:@YES, + SDLRPCParameterNameFuelLevelState:@YES, + SDLRPCParameterNameFuelRange:@YES, + SDLRPCParameterNameGPS:@YES, + SDLRPCParameterNameHeadLampStatus:@YES, + SDLRPCParameterNameInstantFuelConsumption:@YES, + SDLRPCParameterNameMyKey:@YES, + SDLRPCParameterNameOdometer:@YES, + SDLRPCParameterNamePRNDL:@YES, + SDLRPCParameterNameRPM:@YES, + SDLRPCParameterNameSpeed:@YES, + SDLRPCParameterNameSteeringWheelAngle:@YES, + SDLRPCParameterNameTirePressure:@YES, + SDLRPCParameterNameTurnSignal:@YES, + SDLRPCParameterNameWiperStatus:@YES}, + SDLRPCParameterNameOperationName:SDLRPCFunctionNameUnsubscribeVehicleData}}; SDLUnsubscribeVehicleData* testRequest = [[SDLUnsubscribeVehicleData alloc] initWithDictionary:dict]; expect(testRequest.accPedalPosition).to(equal(@YES)); diff --git a/SmartDeviceLinkTests/RPCSpecs/RequestSpecs/SDLUpdateTurnListSpec.m b/SmartDeviceLinkTests/RPCSpecs/RequestSpecs/SDLUpdateTurnListSpec.m index 24bd699d2..1fe93731f 100644 --- a/SmartDeviceLinkTests/RPCSpecs/RequestSpecs/SDLUpdateTurnListSpec.m +++ b/SmartDeviceLinkTests/RPCSpecs/RequestSpecs/SDLUpdateTurnListSpec.m @@ -11,7 +11,8 @@ #import "SDLUpdateTurnList.h" #import "SDLTurn.h" #import "SDLSoftButton.h" -#import "SDLNames.h" +#import "SDLRPCParameterNames.h" +#import "SDLRPCFunctionNames.h" QuickSpecBegin(SDLUpdateTurnListSpec) @@ -30,11 +31,11 @@ describe(@"Getter/Setter Tests", ^ { }); it(@"Should get correctly when initialized", ^ { - NSMutableDictionary<NSString *, id> *dict = [@{SDLNameRequest: - @{SDLNameParameters: - @{SDLNameTurnList:[@[turn] mutableCopy], - SDLNameSoftButtons:[@[button] mutableCopy]}, - SDLNameOperationName:SDLNameUpdateTurnList}} mutableCopy]; + NSMutableDictionary<NSString *, id> *dict = [@{SDLRPCParameterNameRequest: + @{SDLRPCParameterNameParameters: + @{SDLRPCParameterNameTurnList:[@[turn] mutableCopy], + SDLRPCParameterNameSoftButtons:[@[button] mutableCopy]}, + SDLRPCParameterNameOperationName:SDLRPCFunctionNameUpdateTurnList}} mutableCopy]; SDLUpdateTurnList* testRequest = [[SDLUpdateTurnList alloc] initWithDictionary:dict]; expect(testRequest.turnList).to(equal([@[turn] mutableCopy])); diff --git a/SmartDeviceLinkTests/RPCSpecs/ResponseSpecs/SDLAddCommandResponseSpec.m b/SmartDeviceLinkTests/RPCSpecs/ResponseSpecs/SDLAddCommandResponseSpec.m index ff1f36682..cdce0363a 100644 --- a/SmartDeviceLinkTests/RPCSpecs/ResponseSpecs/SDLAddCommandResponseSpec.m +++ b/SmartDeviceLinkTests/RPCSpecs/ResponseSpecs/SDLAddCommandResponseSpec.m @@ -9,7 +9,7 @@ #import <Nimble/Nimble.h> #import "SDLAddCommandResponse.h" -#import "SDLNames.h" +#import "SDLRPCParameterNames.h" QuickSpecBegin(SDLAddCommandResponseSpec) diff --git a/SmartDeviceLinkTests/RPCSpecs/ResponseSpecs/SDLAddSubMenuResponseSpec.m b/SmartDeviceLinkTests/RPCSpecs/ResponseSpecs/SDLAddSubMenuResponseSpec.m index a351d0ee2..bc34dbec0 100644 --- a/SmartDeviceLinkTests/RPCSpecs/ResponseSpecs/SDLAddSubMenuResponseSpec.m +++ b/SmartDeviceLinkTests/RPCSpecs/ResponseSpecs/SDLAddSubMenuResponseSpec.m @@ -9,8 +9,8 @@ #import <Nimble/Nimble.h> #import "SDLAddSubMenuResponse.h" -#import "SDLNames.h" +#import "SDLRPCParameterNames.h" QuickSpecBegin(SDLAddSubMenuResponseSpec) -QuickSpecEnd
\ No newline at end of file +QuickSpecEnd diff --git a/SmartDeviceLinkTests/RPCSpecs/ResponseSpecs/SDLAlertManeuverResponseSpec.m b/SmartDeviceLinkTests/RPCSpecs/ResponseSpecs/SDLAlertManeuverResponseSpec.m index 5b4860134..ab4bdc999 100644 --- a/SmartDeviceLinkTests/RPCSpecs/ResponseSpecs/SDLAlertManeuverResponseSpec.m +++ b/SmartDeviceLinkTests/RPCSpecs/ResponseSpecs/SDLAlertManeuverResponseSpec.m @@ -9,8 +9,8 @@ #import <Nimble/Nimble.h> #import "SDLAlertManeuverResponse.h" -#import "SDLNames.h" +#import "SDLRPCParameterNames.h" QuickSpecBegin(SDLAlertManeuverResponseSpec) -QuickSpecEnd
\ No newline at end of file +QuickSpecEnd diff --git a/SmartDeviceLinkTests/RPCSpecs/ResponseSpecs/SDLAlertResponseSpec.m b/SmartDeviceLinkTests/RPCSpecs/ResponseSpecs/SDLAlertResponseSpec.m index 73cb0023c..99541d772 100644 --- a/SmartDeviceLinkTests/RPCSpecs/ResponseSpecs/SDLAlertResponseSpec.m +++ b/SmartDeviceLinkTests/RPCSpecs/ResponseSpecs/SDLAlertResponseSpec.m @@ -9,7 +9,7 @@ #import <Nimble/Nimble.h> #import "SDLAlertResponse.h" -#import "SDLNames.h" +#import "SDLRPCParameterNames.h" QuickSpecBegin(SDLAlertResponseSpec) diff --git a/SmartDeviceLinkTests/RPCSpecs/ResponseSpecs/SDLButtonPressResponseSpec.m b/SmartDeviceLinkTests/RPCSpecs/ResponseSpecs/SDLButtonPressResponseSpec.m index d9fc72fc8..824355600 100644 --- a/SmartDeviceLinkTests/RPCSpecs/ResponseSpecs/SDLButtonPressResponseSpec.m +++ b/SmartDeviceLinkTests/RPCSpecs/ResponseSpecs/SDLButtonPressResponseSpec.m @@ -9,7 +9,7 @@ #import <Nimble/Nimble.h> #import "SDLButtonPressResponse.h" -#import "SDLNames.h" +#import "SDLRPCParameterNames.h" QuickSpecBegin(SDLButtonPressResponseSpec) diff --git a/SmartDeviceLinkTests/RPCSpecs/ResponseSpecs/SDLChangeRegistrationResponseSpec.m b/SmartDeviceLinkTests/RPCSpecs/ResponseSpecs/SDLChangeRegistrationResponseSpec.m index c6e0b27d9..e130579e3 100644 --- a/SmartDeviceLinkTests/RPCSpecs/ResponseSpecs/SDLChangeRegistrationResponseSpec.m +++ b/SmartDeviceLinkTests/RPCSpecs/ResponseSpecs/SDLChangeRegistrationResponseSpec.m @@ -9,8 +9,8 @@ #import <Nimble/Nimble.h> #import "SDLChangeRegistrationResponse.h" -#import "SDLNames.h" +#import "SDLRPCParameterNames.h" QuickSpecBegin(SDLChangeRegistrationResponseSpec) -QuickSpecEnd
\ No newline at end of file +QuickSpecEnd diff --git a/SmartDeviceLinkTests/RPCSpecs/ResponseSpecs/SDLCreateInteractionChoiceSetResponseSpec.m b/SmartDeviceLinkTests/RPCSpecs/ResponseSpecs/SDLCreateInteractionChoiceSetResponseSpec.m index 3b3d27e90..06a66ab68 100644 --- a/SmartDeviceLinkTests/RPCSpecs/ResponseSpecs/SDLCreateInteractionChoiceSetResponseSpec.m +++ b/SmartDeviceLinkTests/RPCSpecs/ResponseSpecs/SDLCreateInteractionChoiceSetResponseSpec.m @@ -9,8 +9,8 @@ #import <Nimble/Nimble.h> #import "SDLCreateInteractionChoiceSetResponse.h" -#import "SDLNames.h" +#import "SDLRPCParameterNames.h" QuickSpecBegin(SDLCreateInteractionChoiceSetResponseSpec) -QuickSpecEnd
\ No newline at end of file +QuickSpecEnd diff --git a/SmartDeviceLinkTests/RPCSpecs/ResponseSpecs/SDLDeleteCommandResponseSpec.m b/SmartDeviceLinkTests/RPCSpecs/ResponseSpecs/SDLDeleteCommandResponseSpec.m index 013702513..00687d419 100644 --- a/SmartDeviceLinkTests/RPCSpecs/ResponseSpecs/SDLDeleteCommandResponseSpec.m +++ b/SmartDeviceLinkTests/RPCSpecs/ResponseSpecs/SDLDeleteCommandResponseSpec.m @@ -9,8 +9,8 @@ #import <Nimble/Nimble.h> #import "SDLDeleteCommandResponse.h" -#import "SDLNames.h" +#import "SDLRPCParameterNames.h" QuickSpecBegin(SDLDeleteCommandResponseSpec) -QuickSpecEnd
\ No newline at end of file +QuickSpecEnd diff --git a/SmartDeviceLinkTests/RPCSpecs/ResponseSpecs/SDLDeleteFileResponseSpec.m b/SmartDeviceLinkTests/RPCSpecs/ResponseSpecs/SDLDeleteFileResponseSpec.m index 13f68a2ea..6eb54798e 100644 --- a/SmartDeviceLinkTests/RPCSpecs/ResponseSpecs/SDLDeleteFileResponseSpec.m +++ b/SmartDeviceLinkTests/RPCSpecs/ResponseSpecs/SDLDeleteFileResponseSpec.m @@ -9,7 +9,8 @@ #import <Nimble/Nimble.h> #import "SDLDeleteFileResponse.h" -#import "SDLNames.h" +#import "SDLRPCParameterNames.h" +#import "SDLRPCFunctionNames.h" QuickSpecBegin(SDLDeleteFileResponseSpec) @@ -23,10 +24,10 @@ describe(@"Getter/Setter Tests", ^ { }); it(@"Should get correctly when initialized", ^ { - NSMutableDictionary<NSString *, id> *dict = [@{SDLNameResponse: - @{SDLNameParameters: - @{SDLNameSpaceAvailable:@0}, - SDLNameOperationName:SDLNameDeleteFile}} mutableCopy]; + NSMutableDictionary<NSString *, id> *dict = [@{SDLRPCParameterNameResponse: + @{SDLRPCParameterNameParameters: + @{SDLRPCParameterNameSpaceAvailable:@0}, + SDLRPCParameterNameOperationName:SDLRPCFunctionNameDeleteFile}} mutableCopy]; SDLDeleteFileResponse* testResponse = [[SDLDeleteFileResponse alloc] initWithDictionary:dict]; expect(testResponse.spaceAvailable).to(equal(@0)); diff --git a/SmartDeviceLinkTests/RPCSpecs/ResponseSpecs/SDLDeleteInteractionChoiceSetResponseSpec.m b/SmartDeviceLinkTests/RPCSpecs/ResponseSpecs/SDLDeleteInteractionChoiceSetResponseSpec.m index 4f3f0c4c1..8ba0d0a0e 100644 --- a/SmartDeviceLinkTests/RPCSpecs/ResponseSpecs/SDLDeleteInteractionChoiceSetResponseSpec.m +++ b/SmartDeviceLinkTests/RPCSpecs/ResponseSpecs/SDLDeleteInteractionChoiceSetResponseSpec.m @@ -9,8 +9,8 @@ #import <Nimble/Nimble.h> #import "SDLDeleteInteractionChoiceSetResponse.h" -#import "SDLNames.h" +#import "SDLRPCParameterNames.h" QuickSpecBegin(SDLDeleteInteractionChoiceSetResponseSpec) -QuickSpecEnd
\ No newline at end of file +QuickSpecEnd diff --git a/SmartDeviceLinkTests/RPCSpecs/ResponseSpecs/SDLDeleteSubMenuResponseSpec.m b/SmartDeviceLinkTests/RPCSpecs/ResponseSpecs/SDLDeleteSubMenuResponseSpec.m index c17b91d1c..934bbd0ff 100644 --- a/SmartDeviceLinkTests/RPCSpecs/ResponseSpecs/SDLDeleteSubMenuResponseSpec.m +++ b/SmartDeviceLinkTests/RPCSpecs/ResponseSpecs/SDLDeleteSubMenuResponseSpec.m @@ -9,8 +9,8 @@ #import <Nimble/Nimble.h> #import "SDLDeleteSubMenuResponse.h" -#import "SDLNames.h" +#import "SDLRPCParameterNames.h" QuickSpecBegin(SDLDeleteSubMenuResponseSpec) -QuickSpecEnd
\ No newline at end of file +QuickSpecEnd diff --git a/SmartDeviceLinkTests/RPCSpecs/ResponseSpecs/SDLDiagnosticMessageResponseSpec.m b/SmartDeviceLinkTests/RPCSpecs/ResponseSpecs/SDLDiagnosticMessageResponseSpec.m index eac33a7da..b8efd9c97 100644 --- a/SmartDeviceLinkTests/RPCSpecs/ResponseSpecs/SDLDiagnosticMessageResponseSpec.m +++ b/SmartDeviceLinkTests/RPCSpecs/ResponseSpecs/SDLDiagnosticMessageResponseSpec.m @@ -9,7 +9,8 @@ #import <Nimble/Nimble.h> #import "SDLDiagnosticMessageResponse.h" -#import "SDLNames.h" +#import "SDLRPCParameterNames.h" +#import "SDLRPCFunctionNames.h" QuickSpecBegin(SDLDiagnosticMessageResponseSpec) @@ -23,10 +24,10 @@ describe(@"Getter/Setter Tests", ^ { }); it(@"Should get correctly when initialized", ^ { - NSMutableDictionary<NSString *, id> *dict = [@{SDLNameResponse: - @{SDLNameParameters: - @{SDLNameMessageDataResult:@[@3, @9, @27, @81]}, - SDLNameOperationName:SDLNameDiagnosticMessage}} mutableCopy]; + NSMutableDictionary<NSString *, id> *dict = [@{SDLRPCParameterNameResponse: + @{SDLRPCParameterNameParameters: + @{SDLRPCParameterNameMessageDataResult:@[@3, @9, @27, @81]}, + SDLRPCParameterNameOperationName:SDLRPCFunctionNameDiagnosticMessage}} mutableCopy]; SDLDiagnosticMessageResponse* testResponse = [[SDLDiagnosticMessageResponse alloc] initWithDictionary:dict]; expect(testResponse.messageDataResult).to(equal(@[@3, @9, @27, @81])); diff --git a/SmartDeviceLinkTests/RPCSpecs/ResponseSpecs/SDLEncodedSyncPDataResponseSpec.m b/SmartDeviceLinkTests/RPCSpecs/ResponseSpecs/SDLEncodedSyncPDataResponseSpec.m index 4324f0bb8..f7005bc62 100644 --- a/SmartDeviceLinkTests/RPCSpecs/ResponseSpecs/SDLEncodedSyncPDataResponseSpec.m +++ b/SmartDeviceLinkTests/RPCSpecs/ResponseSpecs/SDLEncodedSyncPDataResponseSpec.m @@ -9,8 +9,8 @@ #import <Nimble/Nimble.h> #import "SDLEncodedSyncPDataResponse.h" -#import "SDLNames.h" +#import "SDLRPCParameterNames.h" QuickSpecBegin(SDLEncodedSyncPDataResponseSpec) -QuickSpecEnd
\ No newline at end of file +QuickSpecEnd diff --git a/SmartDeviceLinkTests/RPCSpecs/ResponseSpecs/SDLEndAudioPassThruResponseSpec.m b/SmartDeviceLinkTests/RPCSpecs/ResponseSpecs/SDLEndAudioPassThruResponseSpec.m index 5fcc7d6d8..d9afc109b 100644 --- a/SmartDeviceLinkTests/RPCSpecs/ResponseSpecs/SDLEndAudioPassThruResponseSpec.m +++ b/SmartDeviceLinkTests/RPCSpecs/ResponseSpecs/SDLEndAudioPassThruResponseSpec.m @@ -9,8 +9,8 @@ #import <Nimble/Nimble.h> #import "SDLEndAudioPassThruResponse.h" -#import "SDLNames.h" +#import "SDLRPCParameterNames.h" QuickSpecBegin(SDLEndAudioPassThruResponseSpec) -QuickSpecEnd
\ No newline at end of file +QuickSpecEnd diff --git a/SmartDeviceLinkTests/RPCSpecs/ResponseSpecs/SDLGenericResponseSpec.m b/SmartDeviceLinkTests/RPCSpecs/ResponseSpecs/SDLGenericResponseSpec.m index 227aea92d..8198bb65e 100644 --- a/SmartDeviceLinkTests/RPCSpecs/ResponseSpecs/SDLGenericResponseSpec.m +++ b/SmartDeviceLinkTests/RPCSpecs/ResponseSpecs/SDLGenericResponseSpec.m @@ -9,8 +9,8 @@ #import <Nimble/Nimble.h> #import "SDLGenericResponse.h" -#import "SDLNames.h" +#import "SDLRPCParameterNames.h" QuickSpecBegin(SDLGenericResponseSpec) -QuickSpecEnd
\ No newline at end of file +QuickSpecEnd diff --git a/SmartDeviceLinkTests/RPCSpecs/ResponseSpecs/SDLGetAppServiceDataResponseSpec.m b/SmartDeviceLinkTests/RPCSpecs/ResponseSpecs/SDLGetAppServiceDataResponseSpec.m new file mode 100644 index 000000000..53b04382b --- /dev/null +++ b/SmartDeviceLinkTests/RPCSpecs/ResponseSpecs/SDLGetAppServiceDataResponseSpec.m @@ -0,0 +1,60 @@ +// +// SDLGetAppServiceDataResponseSpec.m +// SmartDeviceLinkTests +// +// Created by Nicole on 2/6/19. +// Copyright © 2019 smartdevicelink. All rights reserved. +// + +#import <Quick/Quick.h> +#import <Nimble/Nimble.h> + +#import "SDLAppServiceData.h" +#import "SDLAppServiceType.h" +#import "SDLGetAppServiceDataResponse.h" +#import "SDLRPCParameterNames.h" +#import "SDLRPCFunctionNames.h" + +QuickSpecBegin(SDLGetAppServiceDataResponseSpec) + +describe(@"Getter/Setter Tests", ^{ + __block SDLAppServiceData *testAppServiceData = nil; + + beforeEach(^{ + testAppServiceData = [[SDLAppServiceData alloc] init]; + testAppServiceData.serviceType = SDLAppServiceTypeMedia; + }); + + it(@"Should set and get correctly", ^{ + SDLGetAppServiceDataResponse *testResponse = [[SDLGetAppServiceDataResponse alloc] init]; + testResponse.serviceData = testAppServiceData; + + expect(testResponse.serviceData).to(equal(testAppServiceData)); + }); + + it(@"Should get correctly when initialized with a dictionary", ^{ + NSDictionary *dict = @{SDLRPCParameterNameResponse:@{ + SDLRPCParameterNameParameters:@{ + SDLRPCParameterNameServiceData:testAppServiceData + }, + SDLRPCParameterNameOperationName:SDLRPCFunctionNameGetAppServiceData}}; + SDLGetAppServiceDataResponse *testResponse = [[SDLGetAppServiceDataResponse alloc] initWithDictionary:dict]; + + expect(testResponse.serviceData).to(equal(testAppServiceData)); + }); + + it(@"Should get correctly when initialized with initWithAppServiceData:", ^{ + SDLGetAppServiceDataResponse *testResponse = [[SDLGetAppServiceDataResponse alloc] initWithAppServiceData:testAppServiceData]; + + expect(testResponse.serviceData).to(equal(testAppServiceData)); + }); + + it(@"Should return nil if not set", ^{ + SDLGetAppServiceDataResponse *testResponse = [[SDLGetAppServiceDataResponse alloc] init]; + + expect(testResponse.serviceData).to(beNil()) + ; + }); +}); + +QuickSpecEnd diff --git a/SmartDeviceLinkTests/RPCSpecs/ResponseSpecs/SDLGetDTCsResponseSpec.m b/SmartDeviceLinkTests/RPCSpecs/ResponseSpecs/SDLGetDTCsResponseSpec.m index d22e8fd1b..5c6ea8658 100644 --- a/SmartDeviceLinkTests/RPCSpecs/ResponseSpecs/SDLGetDTCsResponseSpec.m +++ b/SmartDeviceLinkTests/RPCSpecs/ResponseSpecs/SDLGetDTCsResponseSpec.m @@ -9,7 +9,8 @@ #import <Nimble/Nimble.h> #import "SDLGetDTCsResponse.h" -#import "SDLNames.h" +#import "SDLRPCParameterNames.h" +#import "SDLRPCFunctionNames.h" QuickSpecBegin(SDLGetDTCsResponseSpec) @@ -25,11 +26,11 @@ describe(@"Getter/Setter Tests", ^ { }); it(@"Should get correctly when initialized", ^ { - NSMutableDictionary<NSString *, id> *dict = [@{SDLNameResponse: - @{SDLNameParameters: - @{SDLNameECUHeader:@404, - SDLNameDTC:[@[@"FFFF", @"FFFE", @"FFFD"] mutableCopy]}, - SDLNameOperationName:SDLNameGetDTCs}} mutableCopy]; + NSMutableDictionary<NSString *, id> *dict = [@{SDLRPCParameterNameResponse: + @{SDLRPCParameterNameParameters: + @{SDLRPCParameterNameECUHeader:@404, + SDLRPCParameterNameDTC:[@[@"FFFF", @"FFFE", @"FFFD"] mutableCopy]}, + SDLRPCParameterNameOperationName:SDLRPCFunctionNameGetDTCs}} mutableCopy]; SDLGetDTCsResponse* testResponse = [[SDLGetDTCsResponse alloc] initWithDictionary:dict]; expect(testResponse.ecuHeader).to(equal(@404)); diff --git a/SmartDeviceLinkTests/RPCSpecs/ResponseSpecs/SDLGetFileResponseSpec.m b/SmartDeviceLinkTests/RPCSpecs/ResponseSpecs/SDLGetFileResponseSpec.m new file mode 100644 index 000000000..04bc119be --- /dev/null +++ b/SmartDeviceLinkTests/RPCSpecs/ResponseSpecs/SDLGetFileResponseSpec.m @@ -0,0 +1,81 @@ +// +// SDLGetFileResponseSpec.m +// SmartDeviceLinkTests +// +// Created by Nicole on 2/7/19. +// Copyright © 2019 smartdevicelink. All rights reserved. +// + +#import <Quick/Quick.h> +#import <Nimble/Nimble.h> + +#import "SDLFileType.h" +#import "SDLGetFileResponse.h" +#import "SDLRPCParameterNames.h" +#import "SDLRPCFunctionNames.h" + +QuickSpecBegin(SDLGetFileResponseSpec) + +describe(@"Getter/Setter Tests", ^{ + __block int testOffset = 34; + __block int testLength = 2; + __block SDLFileType testFileType = nil; + __block int testCrc = 2267295; + + beforeEach(^{ + testFileType = SDLFileTypeJPEG; + }); + + it(@"Should set and get correctly", ^{ + SDLGetFileResponse *testResponse = [[SDLGetFileResponse alloc] init]; + testResponse.offset = @(testOffset); + testResponse.length = @(testLength); + testResponse.fileType = testFileType; + testResponse.crc = @(testCrc); + + expect(testResponse.offset).to(equal(testOffset)); + expect(testResponse.length).to(equal(testLength)); + expect(testResponse.fileType).to(equal(testFileType)); + expect(testResponse.crc).to(equal(testCrc)); + }); + + it(@"Should get correctly when initialized with a dictionary", ^{ + NSDictionary *dict = @{SDLRPCParameterNameResponse:@{ + SDLRPCParameterNameParameters:@{ + SDLRPCParameterNameOffset:@(testOffset), + SDLRPCParameterNameLength:@(testLength), + SDLRPCParameterNameFileType:testFileType, + SDLRPCParameterNameCRC:@(testCrc) + }, + SDLRPCParameterNameOperationName:SDLRPCFunctionNameGetFile}}; + SDLGetFileResponse *testResponse = [[SDLGetFileResponse alloc] initWithDictionary:dict]; + + expect(testResponse.offset).to(equal(testOffset)); + expect(testResponse.length).to(equal(testLength)); + expect(testResponse.fileType).to(equal(testFileType)); + expect(testResponse.crc).to(equal(testCrc)); + }); + + it(@"Should get correctly when initialized with initWithOffset:length:fileType:crc:", ^{ + SDLGetFileResponse *testResponse = [[SDLGetFileResponse alloc] initWithOffset:testOffset length:testLength fileType:testFileType crc:testCrc]; + + expect(testResponse.offset).to(equal(testOffset)); + expect(testResponse.length).to(equal(testLength)); + expect(testResponse.fileType).to(equal(testFileType)); + expect(testResponse.crc).to(equal(testCrc)); + }); + + it(@"Should return nil if not set", ^{ + SDLGetFileResponse *testResponse = [[SDLGetFileResponse alloc] init]; + + expect(testResponse.offset).to(beNil()); + expect(testResponse.length).to(beNil()); + expect(testResponse.fileType).to(beNil()); + expect(testResponse.crc).to(beNil()); + }); +}); + +QuickSpecEnd + + + diff --git a/SmartDeviceLinkTests/RPCSpecs/ResponseSpecs/SDLGetInteriorVehicleDataResponseSpec.m b/SmartDeviceLinkTests/RPCSpecs/ResponseSpecs/SDLGetInteriorVehicleDataResponseSpec.m index 7878eedce..7541d2625 100644 --- a/SmartDeviceLinkTests/RPCSpecs/ResponseSpecs/SDLGetInteriorVehicleDataResponseSpec.m +++ b/SmartDeviceLinkTests/RPCSpecs/ResponseSpecs/SDLGetInteriorVehicleDataResponseSpec.m @@ -10,7 +10,8 @@ #import "SDLGetInteriorVehicleDataResponse.h" #import "SDLModuleData.h" -#import "SDLNames.h" +#import "SDLRPCParameterNames.h" +#import "SDLRPCFunctionNames.h" QuickSpecBegin(SDLGetInteriorVehicleDataResponseSpec) @@ -34,11 +35,11 @@ describe(@"Getter/Setter Tests", ^ { it(@"Should get correctly when initialized", ^ { - NSMutableDictionary<NSString *, id> *dict = [@{SDLNameResponse: - @{SDLNameParameters: - @{SDLNameModuleData:someModuleData, - SDLNameIsSubscribed:@NO}, - SDLNameOperationName:SDLNameGetInteriorVehicleData}} mutableCopy]; + NSMutableDictionary<NSString *, id> *dict = [@{SDLRPCParameterNameResponse: + @{SDLRPCParameterNameParameters: + @{SDLRPCParameterNameModuleData:someModuleData, + SDLRPCParameterNameIsSubscribed:@NO}, + SDLRPCParameterNameOperationName:SDLRPCFunctionNameGetInteriorVehicleData}} mutableCopy]; SDLGetInteriorVehicleDataResponse* testResponse = [[SDLGetInteriorVehicleDataResponse alloc] initWithDictionary:dict]; expect(testResponse.moduleData).to(equal(someModuleData)); diff --git a/SmartDeviceLinkTests/RPCSpecs/ResponseSpecs/SDLGetSystemCapabilityResponseSpec.m b/SmartDeviceLinkTests/RPCSpecs/ResponseSpecs/SDLGetSystemCapabilityResponseSpec.m index a7f6ed74f..54d9c561e 100644 --- a/SmartDeviceLinkTests/RPCSpecs/ResponseSpecs/SDLGetSystemCapabilityResponseSpec.m +++ b/SmartDeviceLinkTests/RPCSpecs/ResponseSpecs/SDLGetSystemCapabilityResponseSpec.m @@ -5,7 +5,8 @@ #import "SDLGetSystemCapabilityResponse.h" -#import "SDLNames.h" +#import "SDLRPCParameterNames.h" +#import "SDLRPCFunctionNames.h" #import "SDLNavigationCapability.h" #import "SDLSystemCapability.h" #import "SDLSystemCapabilityType.h" @@ -27,12 +28,17 @@ describe(@"Getter/Setter Tests", ^ { describe(@"Initialization tests", ^{ it(@"Should get correctly when initialized with a dictionary", ^ { - NSDictionary *dict = @{SDLNameResponse: @{ - SDLNameParameters: @{ - SDLNameSystemCapability: @{SDLNameSystemCapabilityType: @"NAVIGATION", - SDLNameNavigationCapability: @{SDLNameGetWayPointsEnabled: @(NO), - SDLNameSendLocationEnabled: @(YES)}} - } + NSDictionary *dict = @{ + SDLRPCParameterNameResponse: @{ + SDLRPCParameterNameParameters: @{ + SDLRPCParameterNameSystemCapability: @{ + SDLRPCParameterNameSystemCapabilityType: @"NAVIGATION", + SDLRPCParameterNameNavigationCapability: @{ + SDLRPCParameterNameGetWayPointsEnabled: @(NO), + SDLRPCParameterNameSendLocationEnabled: @(YES)} + } + }, + SDLRPCParameterNameOperationName:SDLRPCFunctionNameGetSystemCapability } }; SDLGetSystemCapabilityResponse *testResponse = [[SDLGetSystemCapabilityResponse alloc] initWithDictionary:dict]; @@ -41,6 +47,7 @@ describe(@"Initialization tests", ^{ expect(testResponse.systemCapability.navigationCapability.sendLocationEnabled).to(equal(YES)); expect(testResponse.systemCapability.navigationCapability.getWayPointsEnabled).to(equal(NO)); expect(testResponse.systemCapability.phoneCapability).to(beNil()); + expect(testResponse.name).to(equal(SDLRPCFunctionNameGetSystemCapability)); }); it(@"Should return nil if not set", ^ { diff --git a/SmartDeviceLinkTests/RPCSpecs/ResponseSpecs/SDLGetVehicleDataResponseSpec.m b/SmartDeviceLinkTests/RPCSpecs/ResponseSpecs/SDLGetVehicleDataResponseSpec.m index e844bc02f..02ac2ab85 100644 --- a/SmartDeviceLinkTests/RPCSpecs/ResponseSpecs/SDLGetVehicleDataResponseSpec.m +++ b/SmartDeviceLinkTests/RPCSpecs/ResponseSpecs/SDLGetVehicleDataResponseSpec.m @@ -9,7 +9,8 @@ #import <Nimble/Nimble.h> #import "SmartDeviceLink.h" -#import "SDLNames.h" +#import "SDLRPCParameterNames.h" +#import "SDLRPCFunctionNames.h" QuickSpecBegin(SDLGetVehicleDataResponseSpec) @@ -114,40 +115,40 @@ describe(@"Getter/Setter Tests", ^ { }); it(@"Should get correctly when initialized", ^ { - NSMutableDictionary* dict = [@{SDLNameNotification: - @{SDLNameParameters: + NSMutableDictionary* dict = [@{SDLRPCParameterNameNotification: + @{SDLRPCParameterNameParameters: @{ - SDLNameAccelerationPedalPosition:@0, - SDLNameAirbagStatus:airbag, - SDLNameBeltStatus:belt, - SDLNameBodyInformation:body, - SDLNameCloudAppVehicleID:cloudAppVehicleID, - SDLNameClusterModeStatus:clusterMode, - SDLNameDeviceStatus:device, - SDLNameDriverBraking:SDLVehicleDataEventStatusNoEvent, - SDLNameECallInfo:eCall, - SDLNameElectronicParkBrakeStatus:SDLElectronicParkBrakeStatusDriveActive, - SDLNameEmergencyEvent:event, - SDLNameEngineOilLife:@23.22, - SDLNameEngineTorque:@630.4, - SDLNameExternalTemperature:@0, - SDLNameFuelLevel:@99.9999, - SDLNameFuelLevelState:SDLComponentVolumeStatusFault, - SDLNameFuelRange:@[fuelRange], - SDLNameGPS:gps, - SDLNameHeadLampStatus:headLamp, - SDLNameInstantFuelConsumption:@40.7, - SDLNameMyKey:myKey, - SDLNameOdometer:@70000, - SDLNamePRNDL:SDLPRNDLPark, - SDLNameRPM:@3, - SDLNameSpeed:@100, - SDLNameSteeringWheelAngle:@-1500, - SDLNameTirePressure:tires, - SDLNameTurnSignal:SDLTurnSignalOff, - SDLNameVIN:vin, - SDLNameWiperStatus:SDLWiperStatusAutomaticHigh}, - SDLNameOperationName:SDLNameGetVehicleData}} mutableCopy]; + SDLRPCParameterNameAccelerationPedalPosition:@0, + SDLRPCParameterNameAirbagStatus:airbag, + SDLRPCParameterNameBeltStatus:belt, + SDLRPCParameterNameBodyInformation:body, + SDLRPCParameterNameCloudAppVehicleID:cloudAppVehicleID, + SDLRPCParameterNameClusterModeStatus:clusterMode, + SDLRPCParameterNameDeviceStatus:device, + SDLRPCParameterNameDriverBraking:SDLVehicleDataEventStatusNoEvent, + SDLRPCParameterNameECallInfo:eCall, + SDLRPCParameterNameElectronicParkBrakeStatus:SDLElectronicParkBrakeStatusDriveActive, + SDLRPCParameterNameEmergencyEvent:event, + SDLRPCParameterNameEngineOilLife:@23.22, + SDLRPCParameterNameEngineTorque:@630.4, + SDLRPCParameterNameExternalTemperature:@0, + SDLRPCParameterNameFuelLevel:@99.9999, + SDLRPCParameterNameFuelLevelState:SDLComponentVolumeStatusFault, + SDLRPCParameterNameFuelRange:@[fuelRange], + SDLRPCParameterNameGPS:gps, + SDLRPCParameterNameHeadLampStatus:headLamp, + SDLRPCParameterNameInstantFuelConsumption:@40.7, + SDLRPCParameterNameMyKey:myKey, + SDLRPCParameterNameOdometer:@70000, + SDLRPCParameterNamePRNDL:SDLPRNDLPark, + SDLRPCParameterNameRPM:@3, + SDLRPCParameterNameSpeed:@100, + SDLRPCParameterNameSteeringWheelAngle:@-1500, + SDLRPCParameterNameTirePressure:tires, + SDLRPCParameterNameTurnSignal:SDLTurnSignalOff, + SDLRPCParameterNameVIN:@"6574839201", + SDLRPCParameterNameWiperStatus:SDLWiperStatusAutomaticHigh}, + SDLRPCParameterNameOperationName:SDLRPCFunctionNameGetVehicleData}} mutableCopy]; SDLGetVehicleDataResponse* testResponse = [[SDLGetVehicleDataResponse alloc] initWithDictionary:dict]; expect(testResponse.accPedalPosition).to(equal(@0)); diff --git a/SmartDeviceLinkTests/RPCSpecs/ResponseSpecs/SDLGetWaypointsResponseSpec.m b/SmartDeviceLinkTests/RPCSpecs/ResponseSpecs/SDLGetWaypointsResponseSpec.m index 9b5f0b873..c54acf9fa 100644 --- a/SmartDeviceLinkTests/RPCSpecs/ResponseSpecs/SDLGetWaypointsResponseSpec.m +++ b/SmartDeviceLinkTests/RPCSpecs/ResponseSpecs/SDLGetWaypointsResponseSpec.m @@ -11,7 +11,7 @@ #import "SDLImage.h" #import "SDLLocationCoordinate.h" #import "SDLLocationDetails.h" -#import "SDLNames.h" +#import "SDLRPCParameterNames.h" #import "SDLOasisAddress.h" QuickSpecBegin(SDLGetWaypointsResponseSpec) @@ -63,9 +63,9 @@ describe(@"Getter/Setter Tests", ^ { someWaypoints = @[someLocation]; - NSDictionary *initDict = @{SDLNameResponse : @{ - SDLNameParameters: @{ - SDLNameWayPoints: someWaypoints + NSDictionary *initDict = @{SDLRPCParameterNameResponse : @{ + SDLRPCParameterNameParameters: @{ + SDLRPCParameterNameWayPoints: someWaypoints } } }; @@ -83,8 +83,8 @@ describe(@"Getter/Setter Tests", ^ { context(@"when parameters are not set", ^{ beforeEach(^{ NSDictionary *initDict = @{ - SDLNameRequest: @{ - SDLNameParameters: @{} + SDLRPCParameterNameRequest: @{ + SDLRPCParameterNameParameters: @{} } }; diff --git a/SmartDeviceLinkTests/RPCSpecs/ResponseSpecs/SDLListFilesResponseSpec.m b/SmartDeviceLinkTests/RPCSpecs/ResponseSpecs/SDLListFilesResponseSpec.m index 9cc6571a5..02ab663c8 100644 --- a/SmartDeviceLinkTests/RPCSpecs/ResponseSpecs/SDLListFilesResponseSpec.m +++ b/SmartDeviceLinkTests/RPCSpecs/ResponseSpecs/SDLListFilesResponseSpec.m @@ -9,7 +9,8 @@ #import <Nimble/Nimble.h> #import "SDLListFilesResponse.h" -#import "SDLNames.h" +#import "SDLRPCParameterNames.h" +#import "SDLRPCFunctionNames.h" QuickSpecBegin(SDLListFilesResponseSpec) @@ -25,11 +26,11 @@ describe(@"Getter/Setter Tests", ^ { }); it(@"Should get correctly when initialized", ^ { - NSMutableDictionary<NSString *, id> *dict = [@{SDLNameResponse: - @{SDLNameParameters: - @{SDLNameFilenames:[@[@"Music/music.mp3", @"Documents/document.txt", @"Downloads/format.exe"] mutableCopy], - SDLNameSpaceAvailable:@500000000}, - SDLNameOperationName:SDLNameListFiles}} mutableCopy]; + NSMutableDictionary<NSString *, id> *dict = [@{SDLRPCParameterNameResponse: + @{SDLRPCParameterNameParameters: + @{SDLRPCParameterNameFilenames:[@[@"Music/music.mp3", @"Documents/document.txt", @"Downloads/format.exe"] mutableCopy], + SDLRPCParameterNameSpaceAvailable:@500000000}, + SDLRPCParameterNameOperationName:SDLRPCFunctionNameListFiles}} mutableCopy]; SDLListFilesResponse* testResponse = [[SDLListFilesResponse alloc] initWithDictionary:dict]; expect(testResponse.filenames).to(equal([@[@"Music/music.mp3", @"Documents/document.txt", @"Downloads/format.exe"] mutableCopy])); diff --git a/SmartDeviceLinkTests/RPCSpecs/ResponseSpecs/SDLPerformAppServiceInteractionResponseSpec.m b/SmartDeviceLinkTests/RPCSpecs/ResponseSpecs/SDLPerformAppServiceInteractionResponseSpec.m new file mode 100644 index 000000000..9ac23a78f --- /dev/null +++ b/SmartDeviceLinkTests/RPCSpecs/ResponseSpecs/SDLPerformAppServiceInteractionResponseSpec.m @@ -0,0 +1,56 @@ +// +// SDLPerformAppServiceInteractionResponseSpec.m +// SmartDeviceLinkTests +// +// Created by Nicole on 2/6/19. +// Copyright © 2019 smartdevicelink. All rights reserved. +// + +#import <Quick/Quick.h> +#import <Nimble/Nimble.h> + +#import "SDLPerformAppServiceInteractionResponse.h" +#import "SDLRPCParameterNames.h" +#import "SDLRPCFunctionNames.h" + +QuickSpecBegin(SDLPerformAppServiceInteractionResponseSpec) + +describe(@"Getter/Setter Tests", ^{ + __block NSString *testServiceSpecificResult = nil; + + beforeEach(^{ + testServiceSpecificResult = @"testServiceSpecificResult"; + }); + + it(@"Should set and get correctly", ^{ + SDLPerformAppServiceInteractionResponse *testResponse = [[SDLPerformAppServiceInteractionResponse alloc] init]; + testResponse.serviceSpecificResult = testServiceSpecificResult; + + expect(testResponse.serviceSpecificResult).to(equal(testServiceSpecificResult)); + }); + + it(@"Should get correctly when initialized with a dictionary", ^{ + NSDictionary *dict = @{SDLRPCParameterNameResponse:@{ + SDLRPCParameterNameParameters:@{ + SDLRPCParameterNameServiceSpecificResult:testServiceSpecificResult + }, + SDLRPCParameterNameOperationName:SDLRPCFunctionNamePublishAppService}}; + SDLPerformAppServiceInteractionResponse *testResponse = [[SDLPerformAppServiceInteractionResponse alloc] initWithDictionary:dict]; + + expect(testResponse.serviceSpecificResult).to(equal(testServiceSpecificResult)); + }); + + it(@"Should get correctly when initialized with initWithServiceSpecificResult:", ^{ + SDLPerformAppServiceInteractionResponse *testResponse = [[SDLPerformAppServiceInteractionResponse alloc] initWithServiceSpecificResult:testServiceSpecificResult]; + + expect(testResponse.serviceSpecificResult).to(equal(testServiceSpecificResult)); + }); + + it(@"Should return nil if not set", ^{ + SDLPerformAppServiceInteractionResponse *testResponse = [[SDLPerformAppServiceInteractionResponse alloc] init]; + + expect(testResponse.serviceSpecificResult).to(beNil()); + }); +}); + +QuickSpecEnd diff --git a/SmartDeviceLinkTests/RPCSpecs/ResponseSpecs/SDLPerformAudioPassThruResponseSpec.m b/SmartDeviceLinkTests/RPCSpecs/ResponseSpecs/SDLPerformAudioPassThruResponseSpec.m index eb661c3f2..9101fc39e 100644 --- a/SmartDeviceLinkTests/RPCSpecs/ResponseSpecs/SDLPerformAudioPassThruResponseSpec.m +++ b/SmartDeviceLinkTests/RPCSpecs/ResponseSpecs/SDLPerformAudioPassThruResponseSpec.m @@ -9,8 +9,8 @@ #import <Nimble/Nimble.h> #import "SDLPerformAudioPassThruResponse.h" -#import "SDLNames.h" +#import "SDLRPCParameterNames.h" QuickSpecBegin(SDLPerformAudioPassThruResponseSpec) -QuickSpecEnd
\ No newline at end of file +QuickSpecEnd diff --git a/SmartDeviceLinkTests/RPCSpecs/ResponseSpecs/SDLPerformInteractionResponseSpec.m b/SmartDeviceLinkTests/RPCSpecs/ResponseSpecs/SDLPerformInteractionResponseSpec.m index fc2219356..832ed3e44 100644 --- a/SmartDeviceLinkTests/RPCSpecs/ResponseSpecs/SDLPerformInteractionResponseSpec.m +++ b/SmartDeviceLinkTests/RPCSpecs/ResponseSpecs/SDLPerformInteractionResponseSpec.m @@ -9,7 +9,8 @@ #import <Nimble/Nimble.h> #import "SDLPerformInteractionResponse.h" -#import "SDLNames.h" +#import "SDLRPCParameterNames.h" +#import "SDLRPCFunctionNames.h" #import "SDLTriggerSource.h" @@ -29,12 +30,12 @@ describe(@"Getter/Setter Tests", ^ { }); it(@"Should get correctly when initialized", ^ { - NSMutableDictionary* dict = [@{SDLNameResponse: - @{SDLNameParameters: - @{SDLNameChoiceId:@25, - SDLNameManualTextEntry:@"entry", - SDLNameTriggerSource:SDLTriggerSourceKeyboard}, - SDLNameOperationName:SDLNamePerformInteraction}} mutableCopy]; + NSMutableDictionary* dict = [@{SDLRPCParameterNameResponse: + @{SDLRPCParameterNameParameters: + @{SDLRPCParameterNameChoiceId:@25, + SDLRPCParameterNameManualTextEntry:@"entry", + SDLRPCParameterNameTriggerSource:SDLTriggerSourceKeyboard}, + SDLRPCParameterNameOperationName:SDLRPCFunctionNamePerformInteraction}} mutableCopy]; SDLPerformInteractionResponse* testResponse = [[SDLPerformInteractionResponse alloc] initWithDictionary:dict]; expect(testResponse.choiceID).to(equal(@25)); diff --git a/SmartDeviceLinkTests/RPCSpecs/ResponseSpecs/SDLPublishAppServiceResponseSpec.m b/SmartDeviceLinkTests/RPCSpecs/ResponseSpecs/SDLPublishAppServiceResponseSpec.m new file mode 100644 index 000000000..7c3e84317 --- /dev/null +++ b/SmartDeviceLinkTests/RPCSpecs/ResponseSpecs/SDLPublishAppServiceResponseSpec.m @@ -0,0 +1,60 @@ +// +// SDLPublishAppServiceResponseSpec.m +// SmartDeviceLinkTests +// +// Created by Nicole on 2/5/19. +// Copyright © 2019 smartdevicelink. All rights reserved. +// + +#import <Quick/Quick.h> +#import <Nimble/Nimble.h> + +#import "SDLPublishAppServiceResponse.h" +#import "SDLAppServiceRecord.h" +#import "SDLRPCParameterNames.h" +#import "SDLRPCFunctionNames.h" + +QuickSpecBegin(SDLPublishAppServiceResponseSpec) + +describe(@"Getter/Setter Tests", ^{ + __block SDLAppServiceRecord *testAppServiceRecord = nil; + + beforeEach(^{ + testAppServiceRecord = [[SDLAppServiceRecord alloc] init]; + testAppServiceRecord.serviceID = @"testServiceId"; + }); + + it(@"Should set and get correctly", ^{ + SDLPublishAppServiceResponse *testResponse = [[SDLPublishAppServiceResponse alloc] init]; + testResponse.appServiceRecord = testAppServiceRecord; + + expect(testResponse.appServiceRecord).to(equal(testAppServiceRecord)); + }); + + it(@"Should get correctly when initialized with a dictionary", ^{ + NSDictionary *dict = @{SDLRPCParameterNameResponse:@{ + SDLRPCParameterNameParameters:@{ + SDLRPCParameterNameAppServiceRecord:testAppServiceRecord + }, + SDLRPCParameterNameOperationName:SDLRPCFunctionNamePublishAppService}}; + SDLPublishAppServiceResponse *testResponse = [[SDLPublishAppServiceResponse alloc] initWithDictionary:dict]; + + expect(testResponse.appServiceRecord).to(equal(testAppServiceRecord)); + }); + + it(@"Should get correctly when initialized with initWithAppServiceRecord:", ^{ + SDLPublishAppServiceResponse *testResponse = [[SDLPublishAppServiceResponse alloc] initWithAppServiceRecord:testAppServiceRecord]; + + expect(testResponse.appServiceRecord).to(equal(testAppServiceRecord)); + }); + + it(@"Should return nil if not set", ^{ + SDLPublishAppServiceResponse *testResponse = [[SDLPublishAppServiceResponse alloc] init]; + + expect(testResponse.appServiceRecord).to(beNil()); + }); +}); + +QuickSpecEnd + + diff --git a/SmartDeviceLinkTests/RPCSpecs/ResponseSpecs/SDLPutFileResponseSpec.m b/SmartDeviceLinkTests/RPCSpecs/ResponseSpecs/SDLPutFileResponseSpec.m index 9fb2f42ad..347be0314 100644 --- a/SmartDeviceLinkTests/RPCSpecs/ResponseSpecs/SDLPutFileResponseSpec.m +++ b/SmartDeviceLinkTests/RPCSpecs/ResponseSpecs/SDLPutFileResponseSpec.m @@ -9,7 +9,8 @@ #import <Nimble/Nimble.h> #import "SDLPutFileResponse.h" -#import "SDLNames.h" +#import "SDLRPCParameterNames.h" +#import "SDLRPCFunctionNames.h" QuickSpecBegin(SDLPutFileResponseSpec) @@ -23,11 +24,11 @@ describe(@"Getter/Setter Tests", ^ { }); it(@"Should get correctly when initialized", ^ { - NSDictionary<NSString *, id> *dict = @{SDLNameResponse: - @{SDLNameParameters: - @{SDLNameSpaceAvailable:@1248, + NSDictionary<NSString *, id> *dict = @{SDLRPCParameterNameResponse: + @{SDLRPCParameterNameParameters: + @{SDLRPCParameterNameSpaceAvailable:@1248, }, - SDLNameOperationName:SDLNamePutFile}}; + SDLRPCParameterNameOperationName:SDLRPCFunctionNamePutFile}}; SDLPutFileResponse* testResponse = [[SDLPutFileResponse alloc] initWithDictionary:dict]; expect(testResponse.spaceAvailable).to(equal(@1248)); diff --git a/SmartDeviceLinkTests/RPCSpecs/ResponseSpecs/SDLReadDIDResponseSpec.m b/SmartDeviceLinkTests/RPCSpecs/ResponseSpecs/SDLReadDIDResponseSpec.m index e8432243a..1ecc59fc9 100644 --- a/SmartDeviceLinkTests/RPCSpecs/ResponseSpecs/SDLReadDIDResponseSpec.m +++ b/SmartDeviceLinkTests/RPCSpecs/ResponseSpecs/SDLReadDIDResponseSpec.m @@ -10,7 +10,8 @@ #import "SDLReadDIDResponse.h" #import "SDLDIDResult.h" -#import "SDLNames.h" +#import "SDLRPCParameterNames.h" +#import "SDLRPCFunctionNames.h" QuickSpecBegin(SDLReadDIDResponseSpec) @@ -26,10 +27,10 @@ describe(@"Getter/Setter Tests", ^ { }); it(@"Should get correctly when initialized", ^ { - NSMutableDictionary<NSString *, id> *dict = [@{SDLNameResponse: - @{SDLNameParameters: - @{SDLNameDIDResult:[@[result] mutableCopy]}, - SDLNameOperationName:SDLNameReadDID}} mutableCopy]; + NSMutableDictionary<NSString *, id> *dict = [@{SDLRPCParameterNameResponse: + @{SDLRPCParameterNameParameters: + @{SDLRPCParameterNameDIDResult:[@[result] mutableCopy]}, + SDLRPCParameterNameOperationName:SDLRPCFunctionNameReadDID}} mutableCopy]; SDLReadDIDResponse* testResponse = [[SDLReadDIDResponse alloc] initWithDictionary:dict]; expect(testResponse.didResult).to(equal([@[result] mutableCopy])); diff --git a/SmartDeviceLinkTests/RPCSpecs/ResponseSpecs/SDLRegisterAppInterfaceResponseSpec.m b/SmartDeviceLinkTests/RPCSpecs/ResponseSpecs/SDLRegisterAppInterfaceResponseSpec.m index 9a4854fcc..5610dea06 100644 --- a/SmartDeviceLinkTests/RPCSpecs/ResponseSpecs/SDLRegisterAppInterfaceResponseSpec.m +++ b/SmartDeviceLinkTests/RPCSpecs/ResponseSpecs/SDLRegisterAppInterfaceResponseSpec.m @@ -9,7 +9,8 @@ #import <Nimble/Nimble.h> #import "SmartDeviceLink.h" -#import "SDLNames.h" +#import "SDLRPCParameterNames.h" +#import "SDLRPCFunctionNames.h" QuickSpecBegin(SDLRegisterAppInterfaceResponseSpec) @@ -69,29 +70,29 @@ describe(@"Getter/Setter Tests", ^ { }); it(@"Should get correctly when initialized", ^ { - NSDictionary *dict = @{SDLNameRequest: - @{SDLNameParameters: - @{SDLNameSyncMessageVersion:version, - SDLNameLanguage:SDLLanguageEsMx, - SDLNameHMIDisplayLanguage:SDLLanguageRuRu, - SDLNameDisplayCapabilities:info, - SDLNameButtonCapabilities:@[button], - SDLNameSoftButtonCapabilities:@[softButton], - SDLNamePresetBankCapabilities:presetBank, - SDLNameHMIZoneCapabilities:@[SDLHMIZoneCapabilitiesBack, SDLHMIZoneCapabilitiesFront], - SDLNameSpeechCapabilities:@[SDLSpeechCapabilitiesSAPIPhonemes, SDLSpeechCapabilitiesSilence], - SDLNameVRCapabilities:@[SDLVRCapabilitiesText], - SDLNameAudioPassThruCapabilities:@[audioPassThru], - SDLNamePCMStreamCapabilities: audioPassThru, - SDLNameVehicleType:vehicle, - SDLNamePrerecordedSpeech:@[SDLPrerecordedSpeechListen, SDLPrerecordedSpeechHelp], - SDLNameSupportedDiagnosticModes:@[@67, @99, @111], - SDLNameHMICapabilities: hmiCapabilities, - SDLNameSDLVersion: @"sdlVersion", - SDLNameSystemSoftwareVersion: @"systemSoftwareVersion", - SDLNameIconResumed: @YES, + NSDictionary *dict = @{SDLRPCParameterNameRequest: + @{SDLRPCParameterNameParameters: + @{SDLRPCParameterNameSyncMessageVersion:version, + SDLRPCParameterNameLanguage:SDLLanguageEsMx, + SDLRPCParameterNameHMIDisplayLanguage:SDLLanguageRuRu, + SDLRPCParameterNameDisplayCapabilities:info, + SDLRPCParameterNameButtonCapabilities:@[button], + SDLRPCParameterNameSoftButtonCapabilities:@[softButton], + SDLRPCParameterNamePresetBankCapabilities:presetBank, + SDLRPCParameterNameHMIZoneCapabilities:@[SDLHMIZoneCapabilitiesBack, SDLHMIZoneCapabilitiesFront], + SDLRPCParameterNameSpeechCapabilities:@[SDLSpeechCapabilitiesSAPIPhonemes, SDLSpeechCapabilitiesSilence], + SDLRPCParameterNameVRCapabilities:@[SDLVRCapabilitiesText], + SDLRPCParameterNameAudioPassThruCapabilities:@[audioPassThru], + SDLRPCParameterNamePCMStreamCapabilities: audioPassThru, + SDLRPCParameterNameVehicleType:vehicle, + SDLRPCParameterNamePrerecordedSpeech:@[SDLPrerecordedSpeechListen, SDLPrerecordedSpeechHelp], + SDLRPCParameterNameSupportedDiagnosticModes:@[@67, @99, @111], + SDLRPCParameterNameHMICapabilities: hmiCapabilities, + SDLRPCParameterNameSDLVersion: @"sdlVersion", + SDLRPCParameterNameSystemSoftwareVersion: @"systemSoftwareVersion", + SDLRPCParameterNameIconResumed: @YES, }, - SDLNameOperationName:SDLNameRegisterAppInterface}}; + SDLRPCParameterNameOperationName:SDLRPCFunctionNameRegisterAppInterface}}; SDLRegisterAppInterfaceResponse* testResponse = [[SDLRegisterAppInterfaceResponse alloc] initWithDictionary:dict]; expect(testResponse.syncMsgVersion).to(equal(version)); diff --git a/SmartDeviceLinkTests/RPCSpecs/ResponseSpecs/SDLResetGlobalPropertiesResponseSpec.m b/SmartDeviceLinkTests/RPCSpecs/ResponseSpecs/SDLResetGlobalPropertiesResponseSpec.m index fb9b4a2ed..95286de9c 100644 --- a/SmartDeviceLinkTests/RPCSpecs/ResponseSpecs/SDLResetGlobalPropertiesResponseSpec.m +++ b/SmartDeviceLinkTests/RPCSpecs/ResponseSpecs/SDLResetGlobalPropertiesResponseSpec.m @@ -9,8 +9,8 @@ #import <Nimble/Nimble.h> #import "SDLResetGlobalPropertiesResponse.h" -#import "SDLNames.h" +#import "SDLRPCParameterNames.h" QuickSpecBegin(SDLResetGlobalPropertiesResponseSpec) -QuickSpecEnd
\ No newline at end of file +QuickSpecEnd diff --git a/SmartDeviceLinkTests/RPCSpecs/ResponseSpecs/SDLScrollableMessageResponseSpec.m b/SmartDeviceLinkTests/RPCSpecs/ResponseSpecs/SDLScrollableMessageResponseSpec.m index 5cebb0229..662b508e9 100644 --- a/SmartDeviceLinkTests/RPCSpecs/ResponseSpecs/SDLScrollableMessageResponseSpec.m +++ b/SmartDeviceLinkTests/RPCSpecs/ResponseSpecs/SDLScrollableMessageResponseSpec.m @@ -9,8 +9,8 @@ #import <Nimble/Nimble.h> #import "SDLScrollableMessageResponse.h" -#import "SDLNames.h" +#import "SDLRPCParameterNames.h" QuickSpecBegin(SDLScrollableMessageResponseSpec) -QuickSpecEnd
\ No newline at end of file +QuickSpecEnd diff --git a/SmartDeviceLinkTests/RPCSpecs/ResponseSpecs/SDLSendHapticDataResponseSpec.m b/SmartDeviceLinkTests/RPCSpecs/ResponseSpecs/SDLSendHapticDataResponseSpec.m index 29be138ad..6f6993125 100644 --- a/SmartDeviceLinkTests/RPCSpecs/ResponseSpecs/SDLSendHapticDataResponseSpec.m +++ b/SmartDeviceLinkTests/RPCSpecs/ResponseSpecs/SDLSendHapticDataResponseSpec.m @@ -11,7 +11,7 @@ #import <Quick/Quick.h> #import <Nimble/Nimble.h> -#import "SDLNames.h" +#import "SDLRPCParameterNames.h" #import "SDLSendHapticDataResponse.h" QuickSpecBegin(SDLSendHapticDataResponseSpec) diff --git a/SmartDeviceLinkTests/RPCSpecs/ResponseSpecs/SDLSetAppIconResponseSpec.m b/SmartDeviceLinkTests/RPCSpecs/ResponseSpecs/SDLSetAppIconResponseSpec.m index 44593a080..eec77c545 100644 --- a/SmartDeviceLinkTests/RPCSpecs/ResponseSpecs/SDLSetAppIconResponseSpec.m +++ b/SmartDeviceLinkTests/RPCSpecs/ResponseSpecs/SDLSetAppIconResponseSpec.m @@ -9,7 +9,7 @@ #import <Nimble/Nimble.h> #import "SDLSetAppIconResponse.h" -#import "SDLNames.h" +#import "SDLRPCParameterNames.h" QuickSpecBegin(SDLSetAppIconResponseSpec) diff --git a/SmartDeviceLinkTests/RPCSpecs/ResponseSpecs/SDLSetDisplayLayoutResponseSpec.m b/SmartDeviceLinkTests/RPCSpecs/ResponseSpecs/SDLSetDisplayLayoutResponseSpec.m index 29b589eef..41e36b842 100644 --- a/SmartDeviceLinkTests/RPCSpecs/ResponseSpecs/SDLSetDisplayLayoutResponseSpec.m +++ b/SmartDeviceLinkTests/RPCSpecs/ResponseSpecs/SDLSetDisplayLayoutResponseSpec.m @@ -10,7 +10,8 @@ #import "SDLButtonCapabilities.h" #import "SDLDisplayCapabilities.h" -#import "SDLNames.h" +#import "SDLRPCParameterNames.h" +#import "SDLRPCFunctionNames.h" #import "SDLPresetBankCapabilities.h" #import "SDLSetDisplayLayoutResponse.h" #import "SDLSoftButtonCapabilities.h" @@ -39,13 +40,13 @@ describe(@"Getter/Setter Tests", ^ { }); it(@"Should get correctly when initialized", ^ { - NSMutableDictionary<NSString *, id> *dict = [@{SDLNameRequest: - @{SDLNameParameters: - @{SDLNameDisplayCapabilities:info, - SDLNameButtonCapabilities:[@[button] mutableCopy], - SDLNameSoftButtonCapabilities:[@[softButton] mutableCopy], - SDLNamePresetBankCapabilities:presetBank}, - SDLNameOperationName:SDLNameSetDisplayLayout}} mutableCopy]; + NSMutableDictionary<NSString *, id> *dict = [@{SDLRPCParameterNameRequest: + @{SDLRPCParameterNameParameters: + @{SDLRPCParameterNameDisplayCapabilities:info, + SDLRPCParameterNameButtonCapabilities:[@[button] mutableCopy], + SDLRPCParameterNameSoftButtonCapabilities:[@[softButton] mutableCopy], + SDLRPCParameterNamePresetBankCapabilities:presetBank}, + SDLRPCParameterNameOperationName:SDLRPCFunctionNameSetDisplayLayout}} mutableCopy]; SDLSetDisplayLayoutResponse* testResponse = [[SDLSetDisplayLayoutResponse alloc] initWithDictionary:dict]; expect(testResponse.displayCapabilities).to(equal(info)); diff --git a/SmartDeviceLinkTests/RPCSpecs/ResponseSpecs/SDLSetGlobalPropertiesResponseSpec.m b/SmartDeviceLinkTests/RPCSpecs/ResponseSpecs/SDLSetGlobalPropertiesResponseSpec.m index 80a5f47ec..5ed1eb45c 100644 --- a/SmartDeviceLinkTests/RPCSpecs/ResponseSpecs/SDLSetGlobalPropertiesResponseSpec.m +++ b/SmartDeviceLinkTests/RPCSpecs/ResponseSpecs/SDLSetGlobalPropertiesResponseSpec.m @@ -9,7 +9,7 @@ #import <Nimble/Nimble.h> #import "SDLSetGlobalPropertiesResponse.h" -#import "SDLNames.h" +#import "SDLRPCParameterNames.h" QuickSpecBegin(SDLSetGlobalPropertiesResponseSpec) diff --git a/SmartDeviceLinkTests/RPCSpecs/ResponseSpecs/SDLSetInteriorVehicleDataResponseSpec.m b/SmartDeviceLinkTests/RPCSpecs/ResponseSpecs/SDLSetInteriorVehicleDataResponseSpec.m index a41210e91..cbb26be8b 100644 --- a/SmartDeviceLinkTests/RPCSpecs/ResponseSpecs/SDLSetInteriorVehicleDataResponseSpec.m +++ b/SmartDeviceLinkTests/RPCSpecs/ResponseSpecs/SDLSetInteriorVehicleDataResponseSpec.m @@ -10,7 +10,8 @@ #import "SDLSetInteriorVehicleDataResponse.h" #import "SDLModuleData.h" -#import "SDLNames.h" +#import "SDLRPCParameterNames.h" +#import "SDLRPCFunctionNames.h" QuickSpecBegin(SDLSetInteriorVehicleDataResponseSpec) @@ -31,10 +32,10 @@ describe(@"Getter/Setter Tests", ^ { it(@"Should get correctly when initialized", ^ { - NSMutableDictionary<NSString *, id> *dict = [@{SDLNameResponse: - @{SDLNameParameters: - @{SDLNameModuleData:someModuleData}, - SDLNameOperationName:SDLNameSetInteriorVehicleData}} mutableCopy]; + NSMutableDictionary<NSString *, id> *dict = [@{SDLRPCParameterNameResponse: + @{SDLRPCParameterNameParameters: + @{SDLRPCParameterNameModuleData:someModuleData}, + SDLRPCParameterNameOperationName:SDLRPCFunctionNameSetInteriorVehicleData}} mutableCopy]; SDLSetInteriorVehicleDataResponse* testResponse = [[SDLSetInteriorVehicleDataResponse alloc] initWithDictionary:dict]; expect(testResponse.moduleData).to(equal(someModuleData)); diff --git a/SmartDeviceLinkTests/RPCSpecs/ResponseSpecs/SDLSetMediaClockTimerResponseSpec.m b/SmartDeviceLinkTests/RPCSpecs/ResponseSpecs/SDLSetMediaClockTimerResponseSpec.m index e840213d6..dfc0abdf2 100644 --- a/SmartDeviceLinkTests/RPCSpecs/ResponseSpecs/SDLSetMediaClockTimerResponseSpec.m +++ b/SmartDeviceLinkTests/RPCSpecs/ResponseSpecs/SDLSetMediaClockTimerResponseSpec.m @@ -9,7 +9,7 @@ #import <Nimble/Nimble.h> #import "SDLSetMediaClockTimerResponse.h" -#import "SDLNames.h" +#import "SDLRPCParameterNames.h" QuickSpecBegin(SDLSetMediaClockTimerResponseSpec) diff --git a/SmartDeviceLinkTests/RPCSpecs/ResponseSpecs/SDLShowConstantTBTResponseSpec.m b/SmartDeviceLinkTests/RPCSpecs/ResponseSpecs/SDLShowConstantTBTResponseSpec.m index 1bd2c57cd..d7ca02d43 100644 --- a/SmartDeviceLinkTests/RPCSpecs/ResponseSpecs/SDLShowConstantTBTResponseSpec.m +++ b/SmartDeviceLinkTests/RPCSpecs/ResponseSpecs/SDLShowConstantTBTResponseSpec.m @@ -9,7 +9,7 @@ #import <Nimble/Nimble.h> #import "SDLShowConstantTBTResponse.h" -#import "SDLNames.h" +#import "SDLRPCParameterNames.h" QuickSpecBegin(SDLShowConstantTBTResponseSpec) diff --git a/SmartDeviceLinkTests/RPCSpecs/ResponseSpecs/SDLShowResponseSpec.m b/SmartDeviceLinkTests/RPCSpecs/ResponseSpecs/SDLShowResponseSpec.m index bbfa524c0..23ae97f4d 100644 --- a/SmartDeviceLinkTests/RPCSpecs/ResponseSpecs/SDLShowResponseSpec.m +++ b/SmartDeviceLinkTests/RPCSpecs/ResponseSpecs/SDLShowResponseSpec.m @@ -9,7 +9,7 @@ #import <Nimble/Nimble.h> #import "SDLShowResponse.h" -#import "SDLNames.h" +#import "SDLRPCParameterNames.h" QuickSpecBegin(SDLShowResponseSpec) diff --git a/SmartDeviceLinkTests/RPCSpecs/ResponseSpecs/SDLSliderResponseSpec.m b/SmartDeviceLinkTests/RPCSpecs/ResponseSpecs/SDLSliderResponseSpec.m index b7dce33cb..bddbb04a4 100644 --- a/SmartDeviceLinkTests/RPCSpecs/ResponseSpecs/SDLSliderResponseSpec.m +++ b/SmartDeviceLinkTests/RPCSpecs/ResponseSpecs/SDLSliderResponseSpec.m @@ -10,7 +10,8 @@ #import "SDLSliderResponse.h" #import "SDLDIDResult.h" -#import "SDLNames.h" +#import "SDLRPCParameterNames.h" +#import "SDLRPCFunctionNames.h" QuickSpecBegin(SDLSliderResponseSpec) @@ -24,10 +25,10 @@ describe(@"Getter/Setter Tests", ^ { }); it(@"Should get correctly when initialized", ^ { - NSMutableDictionary<NSString *, id> *dict = [@{SDLNameResponse: - @{SDLNameParameters: - @{SDLNameSliderPosition:@13}, - SDLNameOperationName:SDLNameSlider}} mutableCopy]; + NSMutableDictionary<NSString *, id> *dict = [@{SDLRPCParameterNameResponse: + @{SDLRPCParameterNameParameters: + @{SDLRPCParameterNameSliderPosition:@13}, + SDLRPCParameterNameOperationName:SDLRPCFunctionNameSlider}} mutableCopy]; SDLSliderResponse* testResponse = [[SDLSliderResponse alloc] initWithDictionary:dict]; expect(testResponse.sliderPosition).to(equal(@13)); diff --git a/SmartDeviceLinkTests/RPCSpecs/ResponseSpecs/SDLSpeakResponseSpec.m b/SmartDeviceLinkTests/RPCSpecs/ResponseSpecs/SDLSpeakResponseSpec.m index 688e8f34c..dd3264265 100644 --- a/SmartDeviceLinkTests/RPCSpecs/ResponseSpecs/SDLSpeakResponseSpec.m +++ b/SmartDeviceLinkTests/RPCSpecs/ResponseSpecs/SDLSpeakResponseSpec.m @@ -9,7 +9,7 @@ #import <Nimble/Nimble.h> #import "SDLSpeakResponse.h" -#import "SDLNames.h" +#import "SDLRPCParameterNames.h" QuickSpecBegin(SDLSpeakResponseSpec) diff --git a/SmartDeviceLinkTests/RPCSpecs/ResponseSpecs/SDLSubscribeButtonResponseSpec.m b/SmartDeviceLinkTests/RPCSpecs/ResponseSpecs/SDLSubscribeButtonResponseSpec.m index 5e78d95ed..e97276a4a 100644 --- a/SmartDeviceLinkTests/RPCSpecs/ResponseSpecs/SDLSubscribeButtonResponseSpec.m +++ b/SmartDeviceLinkTests/RPCSpecs/ResponseSpecs/SDLSubscribeButtonResponseSpec.m @@ -9,8 +9,8 @@ #import <Nimble/Nimble.h> #import "SDLSubscribeButtonResponse.h" -#import "SDLNames.h" +#import "SDLRPCParameterNames.h" QuickSpecBegin(SDLSubscribeButtonResponseSpec) -QuickSpecEnd
\ No newline at end of file +QuickSpecEnd diff --git a/SmartDeviceLinkTests/RPCSpecs/ResponseSpecs/SDLSubscribeVehicleDataResponseSpec.m b/SmartDeviceLinkTests/RPCSpecs/ResponseSpecs/SDLSubscribeVehicleDataResponseSpec.m index 8ea1c9107..fa3f163a4 100644 --- a/SmartDeviceLinkTests/RPCSpecs/ResponseSpecs/SDLSubscribeVehicleDataResponseSpec.m +++ b/SmartDeviceLinkTests/RPCSpecs/ResponseSpecs/SDLSubscribeVehicleDataResponseSpec.m @@ -8,7 +8,8 @@ #import <Quick/Quick.h> #import <Nimble/Nimble.h> -#import "SDLNames.h" +#import "SDLRPCParameterNames.h" +#import "SDLRPCFunctionNames.h" #import "SDLSubscribeVehicleDataResponse.h" #import "SDLVehicleDataResult.h" @@ -83,38 +84,38 @@ describe(@"Getter/Setter Tests", ^ { }); it(@"Should get correctly when initialized", ^ { - NSDictionary<NSString *, id> *dict = @{SDLNameResponse: - @{SDLNameParameters: - @{SDLNameAccelerationPedalPosition:vehicleDataResult, - SDLNameAirbagStatus:vehicleDataResult, - SDLNameBeltStatus:vehicleDataResult, - SDLNameBodyInformation:vehicleDataResult, - SDLNameCloudAppVehicleID:vehicleDataResult, - SDLNameClusterModes:vehicleDataResult, - SDLNameDeviceStatus:vehicleDataResult, - SDLNameDriverBraking:vehicleDataResult, - SDLNameECallInfo:vehicleDataResult, - SDLNameElectronicParkBrakeStatus:vehicleDataResult, - SDLNameEmergencyEvent:vehicleDataResult, - SDLNameEngineOilLife:vehicleDataResult, - SDLNameEngineTorque:vehicleDataResult, - SDLNameExternalTemperature:vehicleDataResult, - SDLNameFuelLevel:vehicleDataResult, - SDLNameFuelLevelState:vehicleDataResult, - SDLNameFuelRange:vehicleDataResult, - SDLNameGPS:vehicleDataResult, - SDLNameHeadLampStatus:vehicleDataResult, - SDLNameInstantFuelConsumption:vehicleDataResult, - SDLNameMyKey:vehicleDataResult, - SDLNameOdometer:vehicleDataResult, - SDLNamePRNDL:vehicleDataResult, - SDLNameRPM:vehicleDataResult, - SDLNameSpeed:vehicleDataResult, - SDLNameSteeringWheelAngle:vehicleDataResult, - SDLNameTirePressure:vehicleDataResult, - SDLNameTurnSignal:vehicleDataResult, - SDLNameWiperStatus:vehicleDataResult}, - SDLNameOperationName:SDLNameSubscribeVehicleData}}; + NSDictionary<NSString *, id> *dict = @{SDLRPCParameterNameResponse: + @{SDLRPCParameterNameParameters: + @{SDLRPCParameterNameAccelerationPedalPosition:vehicleDataResult, + SDLRPCParameterNameAirbagStatus:vehicleDataResult, + SDLRPCParameterNameBeltStatus:vehicleDataResult, + SDLRPCParameterNameBodyInformation:vehicleDataResult, + SDLRPCParameterNameCloudAppVehicleID:vehicleDataResult, + SDLRPCParameterNameClusterModes:vehicleDataResult, + SDLRPCParameterNameDeviceStatus:vehicleDataResult, + SDLRPCParameterNameDriverBraking:vehicleDataResult, + SDLRPCParameterNameECallInfo:vehicleDataResult, + SDLRPCParameterNameElectronicParkBrakeStatus:vehicleDataResult, + SDLRPCParameterNameEmergencyEvent:vehicleDataResult, + SDLRPCParameterNameEngineOilLife:vehicleDataResult, + SDLRPCParameterNameEngineTorque:vehicleDataResult, + SDLRPCParameterNameExternalTemperature:vehicleDataResult, + SDLRPCParameterNameFuelLevel:vehicleDataResult, + SDLRPCParameterNameFuelLevelState:vehicleDataResult, + SDLRPCParameterNameFuelRange:vehicleDataResult, + SDLRPCParameterNameGPS:vehicleDataResult, + SDLRPCParameterNameHeadLampStatus:vehicleDataResult, + SDLRPCParameterNameInstantFuelConsumption:vehicleDataResult, + SDLRPCParameterNameMyKey:vehicleDataResult, + SDLRPCParameterNameOdometer:vehicleDataResult, + SDLRPCParameterNamePRNDL:vehicleDataResult, + SDLRPCParameterNameRPM:vehicleDataResult, + SDLRPCParameterNameSpeed:vehicleDataResult, + SDLRPCParameterNameSteeringWheelAngle:vehicleDataResult, + SDLRPCParameterNameTirePressure:vehicleDataResult, + SDLRPCParameterNameTurnSignal:vehicleDataResult, + SDLRPCParameterNameWiperStatus:vehicleDataResult}, + SDLRPCParameterNameOperationName:SDLRPCFunctionNameSubscribeVehicleData}}; SDLSubscribeVehicleDataResponse* testResponse = [[SDLSubscribeVehicleDataResponse alloc] initWithDictionary:dict]; expect(testResponse.accPedalPosition).to(equal(vehicleDataResult)); diff --git a/SmartDeviceLinkTests/RPCSpecs/ResponseSpecs/SDLSyncPDataResponseSpec.m b/SmartDeviceLinkTests/RPCSpecs/ResponseSpecs/SDLSyncPDataResponseSpec.m index 6a287f226..511a0df77 100644 --- a/SmartDeviceLinkTests/RPCSpecs/ResponseSpecs/SDLSyncPDataResponseSpec.m +++ b/SmartDeviceLinkTests/RPCSpecs/ResponseSpecs/SDLSyncPDataResponseSpec.m @@ -9,8 +9,8 @@ #import <Nimble/Nimble.h> #import "SDLSyncPDataResponse.h" -#import "SDLNames.h" +#import "SDLRPCParameterNames.h" QuickSpecBegin(SDLSyncPDataResponseSpec) -QuickSpecEnd
\ No newline at end of file +QuickSpecEnd diff --git a/SmartDeviceLinkTests/RPCSpecs/ResponseSpecs/SDLSystemRequestResponseSpec.m b/SmartDeviceLinkTests/RPCSpecs/ResponseSpecs/SDLSystemRequestResponseSpec.m index 2571379c8..4624f6de8 100644 --- a/SmartDeviceLinkTests/RPCSpecs/ResponseSpecs/SDLSystemRequestResponseSpec.m +++ b/SmartDeviceLinkTests/RPCSpecs/ResponseSpecs/SDLSystemRequestResponseSpec.m @@ -9,8 +9,8 @@ #import <Nimble/Nimble.h> #import "SDLSystemRequestResponse.h" -#import "SDLNames.h" +#import "SDLRPCParameterNames.h" QuickSpecBegin(SDLSystemRequestResponseSpec) -QuickSpecEnd
\ No newline at end of file +QuickSpecEnd diff --git a/SmartDeviceLinkTests/RPCSpecs/ResponseSpecs/SDLUnregisterAppInterfaceResponseSpec.m b/SmartDeviceLinkTests/RPCSpecs/ResponseSpecs/SDLUnregisterAppInterfaceResponseSpec.m index f10eb6048..0384a94af 100644 --- a/SmartDeviceLinkTests/RPCSpecs/ResponseSpecs/SDLUnregisterAppInterfaceResponseSpec.m +++ b/SmartDeviceLinkTests/RPCSpecs/ResponseSpecs/SDLUnregisterAppInterfaceResponseSpec.m @@ -9,8 +9,8 @@ #import <Nimble/Nimble.h> #import "SDLUnregisterAppInterfaceResponse.h" -#import "SDLNames.h" +#import "SDLRPCParameterNames.h" QuickSpecBegin(SDLUnregisterAppInterfaceResponseSpec) -QuickSpecEnd
\ No newline at end of file +QuickSpecEnd diff --git a/SmartDeviceLinkTests/RPCSpecs/ResponseSpecs/SDLUnsubscribeButtonResponseSpec.m b/SmartDeviceLinkTests/RPCSpecs/ResponseSpecs/SDLUnsubscribeButtonResponseSpec.m index ca76ef4e7..4f3052ccc 100644 --- a/SmartDeviceLinkTests/RPCSpecs/ResponseSpecs/SDLUnsubscribeButtonResponseSpec.m +++ b/SmartDeviceLinkTests/RPCSpecs/ResponseSpecs/SDLUnsubscribeButtonResponseSpec.m @@ -9,8 +9,8 @@ #import <Nimble/Nimble.h> #import "SDLUnsubscribeButtonResponse.h" -#import "SDLNames.h" +#import "SDLRPCParameterNames.h" QuickSpecBegin(SDLUnsubscribeButtonResponseSpec) -QuickSpecEnd
\ No newline at end of file +QuickSpecEnd diff --git a/SmartDeviceLinkTests/RPCSpecs/ResponseSpecs/SDLUnsubscribeVehicleDataResponseSpec.m b/SmartDeviceLinkTests/RPCSpecs/ResponseSpecs/SDLUnsubscribeVehicleDataResponseSpec.m index 0ebf3d4f4..d9ba58f6b 100644 --- a/SmartDeviceLinkTests/RPCSpecs/ResponseSpecs/SDLUnsubscribeVehicleDataResponseSpec.m +++ b/SmartDeviceLinkTests/RPCSpecs/ResponseSpecs/SDLUnsubscribeVehicleDataResponseSpec.m @@ -9,7 +9,8 @@ #import <Nimble/Nimble.h> #import "SDLUnsubscribeVehicleDataResponse.h" -#import "SDLNames.h" +#import "SDLRPCParameterNames.h" +#import "SDLRPCFunctionNames.h" #import "SDLVehicleDataResult.h" @@ -83,39 +84,39 @@ describe(@"Getter/Setter Tests", ^ { }); it(@"Should get correctly when initialized", ^ { - NSMutableDictionary<NSString *, id> *dict = [@{SDLNameResponse: - @{SDLNameParameters: - @{SDLNameGPS:vehicleDataResult, - SDLNameSpeed:vehicleDataResult, - SDLNameRPM:vehicleDataResult, - SDLNameFuelLevel:vehicleDataResult, - SDLNameFuelLevelState:vehicleDataResult, - SDLNameFuelRange:vehicleDataResult, - SDLNameInstantFuelConsumption:vehicleDataResult, - SDLNameExternalTemperature:vehicleDataResult, - SDLNamePRNDL:vehicleDataResult, - SDLNameTirePressure:vehicleDataResult, - SDLNameOdometer:vehicleDataResult, - SDLNameBeltStatus:vehicleDataResult, - SDLNameBodyInformation:vehicleDataResult, - SDLNameDeviceStatus:vehicleDataResult, - SDLNameDriverBraking:vehicleDataResult, - SDLNameWiperStatus:vehicleDataResult, - SDLNameHeadLampStatus:vehicleDataResult, - SDLNameEngineOilLife:vehicleDataResult, - SDLNameEngineTorque:vehicleDataResult, - SDLNameAccelerationPedalPosition:vehicleDataResult, - SDLNameSteeringWheelAngle:vehicleDataResult, - SDLNameECallInfo:vehicleDataResult, - SDLNameAirbagStatus:vehicleDataResult, - SDLNameEmergencyEvent:vehicleDataResult, - SDLNameClusterModes:vehicleDataResult, - SDLNameMyKey:vehicleDataResult, - SDLNameElectronicParkBrakeStatus:vehicleDataResult, - SDLNameTurnSignal:vehicleDataResult, - SDLNameCloudAppVehicleID:vehicleDataResult + NSMutableDictionary<NSString *, id> *dict = [@{SDLRPCParameterNameResponse: + @{SDLRPCParameterNameParameters: + @{SDLRPCParameterNameGPS:vehicleDataResult, + SDLRPCParameterNameSpeed:vehicleDataResult, + SDLRPCParameterNameRPM:vehicleDataResult, + SDLRPCParameterNameFuelLevel:vehicleDataResult, + SDLRPCParameterNameFuelLevelState:vehicleDataResult, + SDLRPCParameterNameFuelRange:vehicleDataResult, + SDLRPCParameterNameInstantFuelConsumption:vehicleDataResult, + SDLRPCParameterNameExternalTemperature:vehicleDataResult, + SDLRPCParameterNamePRNDL:vehicleDataResult, + SDLRPCParameterNameTirePressure:vehicleDataResult, + SDLRPCParameterNameOdometer:vehicleDataResult, + SDLRPCParameterNameBeltStatus:vehicleDataResult, + SDLRPCParameterNameBodyInformation:vehicleDataResult, + SDLRPCParameterNameDeviceStatus:vehicleDataResult, + SDLRPCParameterNameDriverBraking:vehicleDataResult, + SDLRPCParameterNameWiperStatus:vehicleDataResult, + SDLRPCParameterNameHeadLampStatus:vehicleDataResult, + SDLRPCParameterNameEngineOilLife:vehicleDataResult, + SDLRPCParameterNameEngineTorque:vehicleDataResult, + SDLRPCParameterNameAccelerationPedalPosition:vehicleDataResult, + SDLRPCParameterNameSteeringWheelAngle:vehicleDataResult, + SDLRPCParameterNameECallInfo:vehicleDataResult, + SDLRPCParameterNameAirbagStatus:vehicleDataResult, + SDLRPCParameterNameEmergencyEvent:vehicleDataResult, + SDLRPCParameterNameClusterModes:vehicleDataResult, + SDLRPCParameterNameMyKey:vehicleDataResult, + SDLRPCParameterNameElectronicParkBrakeStatus:vehicleDataResult, + SDLRPCParameterNameTurnSignal:vehicleDataResult, + SDLRPCParameterNameCloudAppVehicleID:vehicleDataResult }, - SDLNameOperationName:SDLNameUnsubscribeVehicleData}} mutableCopy]; + SDLRPCParameterNameOperationName:SDLRPCFunctionNameUnsubscribeVehicleData}} mutableCopy]; SDLUnsubscribeVehicleDataResponse* testResponse = [[SDLUnsubscribeVehicleDataResponse alloc] initWithDictionary:dict]; expect(testResponse.gps).to(equal(vehicleDataResult)); diff --git a/SmartDeviceLinkTests/RPCSpecs/ResponseSpecs/SDLUpdateTurnListResponseSpec.m b/SmartDeviceLinkTests/RPCSpecs/ResponseSpecs/SDLUpdateTurnListResponseSpec.m index d455dea46..28679dddf 100644 --- a/SmartDeviceLinkTests/RPCSpecs/ResponseSpecs/SDLUpdateTurnListResponseSpec.m +++ b/SmartDeviceLinkTests/RPCSpecs/ResponseSpecs/SDLUpdateTurnListResponseSpec.m @@ -9,8 +9,8 @@ #import <Nimble/Nimble.h> #import "SDLUpdateTurnListResponse.h" -#import "SDLNames.h" +#import "SDLRPCParameterNames.h" QuickSpecBegin(SDLUpdateTurnListResponseSpec) -QuickSpecEnd
\ No newline at end of file +QuickSpecEnd diff --git a/SmartDeviceLinkTests/RPCSpecs/StructSpecs/SDLAirbagStatusSpec.m b/SmartDeviceLinkTests/RPCSpecs/StructSpecs/SDLAirbagStatusSpec.m index 01a535ce4..032857f4b 100644 --- a/SmartDeviceLinkTests/RPCSpecs/StructSpecs/SDLAirbagStatusSpec.m +++ b/SmartDeviceLinkTests/RPCSpecs/StructSpecs/SDLAirbagStatusSpec.m @@ -9,7 +9,7 @@ #import <Nimble/Nimble.h> #import "SDLAirbagStatus.h" -#import "SDLNames.h" +#import "SDLRPCParameterNames.h" #import "SDLVehicleDataEventStatus.h" @@ -39,14 +39,14 @@ describe(@"Getter/Setter Tests", ^ { }); it(@"Should get correctly when initialized", ^ { - NSMutableDictionary* dict = [@{SDLNameDriverAirbagDeployed:SDLVehicleDataEventStatusYes, - SDLNameDriverSideAirbagDeployed:SDLVehicleDataEventStatusNoEvent, - SDLNameDriverCurtainAirbagDeployed:SDLVehicleDataEventStatusNo, - SDLNamePassengerAirbagDeployed:SDLVehicleDataEventStatusNotSupported, - SDLNamePassengerCurtainAirbagDeployed:SDLVehicleDataEventStatusFault, - SDLNameDriverKneeAirbagDeployed:SDLVehicleDataEventStatusNo, - SDLNamePassengerSideAirbagDeployed:SDLVehicleDataEventStatusYes, - SDLNamePassengerKneeAirbagDeployed:SDLVehicleDataEventStatusNoEvent} mutableCopy]; + NSMutableDictionary* dict = [@{SDLRPCParameterNameDriverAirbagDeployed:SDLVehicleDataEventStatusYes, + SDLRPCParameterNameDriverSideAirbagDeployed:SDLVehicleDataEventStatusNoEvent, + SDLRPCParameterNameDriverCurtainAirbagDeployed:SDLVehicleDataEventStatusNo, + SDLRPCParameterNamePassengerAirbagDeployed:SDLVehicleDataEventStatusNotSupported, + SDLRPCParameterNamePassengerCurtainAirbagDeployed:SDLVehicleDataEventStatusFault, + SDLRPCParameterNameDriverKneeAirbagDeployed:SDLVehicleDataEventStatusNo, + SDLRPCParameterNamePassengerSideAirbagDeployed:SDLVehicleDataEventStatusYes, + SDLRPCParameterNamePassengerKneeAirbagDeployed:SDLVehicleDataEventStatusNoEvent} mutableCopy]; SDLAirbagStatus* testStruct = [[SDLAirbagStatus alloc] initWithDictionary:dict]; expect(testStruct.driverAirbagDeployed).to(equal(SDLVehicleDataEventStatusYes)); diff --git a/SmartDeviceLinkTests/RPCSpecs/StructSpecs/SDLAppInfoSpec.m b/SmartDeviceLinkTests/RPCSpecs/StructSpecs/SDLAppInfoSpec.m index b8495dc74..f230a7898 100644 --- a/SmartDeviceLinkTests/RPCSpecs/StructSpecs/SDLAppInfoSpec.m +++ b/SmartDeviceLinkTests/RPCSpecs/StructSpecs/SDLAppInfoSpec.m @@ -10,7 +10,7 @@ #import <Nimble/Nimble.h> #import "SDLAppInfo.h" -#import "SDLNames.h" +#import "SDLRPCParameterNames.h" QuickSpecBegin(SDLAppInfoSpec) @@ -28,9 +28,9 @@ describe(@"Getter/Setter Tests", ^ { }); it(@"Should get correctly when initialized", ^ { - NSMutableDictionary<NSString *, id> *dict = [@{SDLNameAppDisplayName:@"display name", - SDLNameAppVersion:@"1.2.3.4", - SDLNameAppBundleId:@"com.app.bundle"} mutableCopy]; + NSMutableDictionary<NSString *, id> *dict = [@{SDLRPCParameterNameAppDisplayName:@"display name", + SDLRPCParameterNameAppVersion:@"1.2.3.4", + SDLRPCParameterNameAppBundleId:@"com.app.bundle"} mutableCopy]; SDLAppInfo* testStruct = [[SDLAppInfo alloc] initWithDictionary:dict]; expect(testStruct.appDisplayName).to(equal(@"display name")); diff --git a/SmartDeviceLinkTests/RPCSpecs/StructSpecs/SDLAppServiceCapabilitySpec.m b/SmartDeviceLinkTests/RPCSpecs/StructSpecs/SDLAppServiceCapabilitySpec.m new file mode 100644 index 000000000..220ce9e30 --- /dev/null +++ b/SmartDeviceLinkTests/RPCSpecs/StructSpecs/SDLAppServiceCapabilitySpec.m @@ -0,0 +1,68 @@ +// +// SDLAppServiceCapabilitySpec.m +// SmartDeviceLinkTests +// +// Created by Nicole on 1/30/19. +// Copyright © 2019 smartdevicelink. All rights reserved. +// + +#import <Quick/Quick.h> +#import <Nimble/Nimble.h> + +#import "SDLAppServiceCapability.h" +#import "SDLAppServiceRecord.h" +#import "SDLRPCParameterNames.h" + +QuickSpecBegin(SDLAppServiceCapabilitySpec) + +describe(@"Getter/Setter Tests", ^{ + __block SDLServiceUpdateReason testUpdateReason = nil; + __block SDLAppServiceRecord *testUpdatedAppServiceRecord = nil; + + beforeEach(^{ + testUpdateReason = SDLServiceUpdateActivated; + testUpdatedAppServiceRecord = [[SDLAppServiceRecord alloc] initWithDictionary:@{SDLRPCParameterNameServiceID:@"1234", SDLRPCParameterNameServicePublished:@YES}]; + }); + + it(@"Should set and get correctly", ^{ + SDLAppServiceCapability *testStruct = [[SDLAppServiceCapability alloc] init]; + testStruct.updateReason = testUpdateReason; + testStruct.updatedAppServiceRecord = testUpdatedAppServiceRecord; + + expect(testStruct.updateReason).to(equal(testUpdateReason)); + expect(testStruct.updatedAppServiceRecord).to(equal(testUpdatedAppServiceRecord)); + }); + + it(@"Should get correctly when initialized with a dictionary", ^{ + NSDictionary *dict = @{SDLRPCParameterNameUpdateReason:testUpdateReason, + SDLRPCParameterNameUpdatedAppServiceRecord:testUpdatedAppServiceRecord + }; + + SDLAppServiceCapability *testStruct = [[SDLAppServiceCapability alloc] initWithDictionary:dict]; + expect(testStruct.updateReason).to(equal(testUpdateReason)); + expect(testStruct.updatedAppServiceRecord).to(equal(testUpdatedAppServiceRecord)); + }); + + it(@"Should get correctly when initialized with initWithUpdatedAppServiceRecord:", ^{ + SDLAppServiceCapability *testStruct = [[SDLAppServiceCapability alloc] initWithUpdatedAppServiceRecord:testUpdatedAppServiceRecord]; + + expect(testStruct.updateReason).to(beNil()); + expect(testStruct.updatedAppServiceRecord).to(equal(testUpdatedAppServiceRecord)); + }); + + it(@"Should get correctly when initialized with initWithUpdateReason:updatedAppServiceRecord", ^{ + SDLAppServiceCapability *testStruct = [[SDLAppServiceCapability alloc] initWithUpdateReason:testUpdateReason updatedAppServiceRecord:testUpdatedAppServiceRecord]; + + expect(testStruct.updateReason).to(equal(testUpdateReason)); + expect(testStruct.updatedAppServiceRecord).to(equal(testUpdatedAppServiceRecord)); + }); + + it(@"Should return nil if not set", ^{ + SDLAppServiceCapability *testStruct = [[SDLAppServiceCapability alloc] init]; + + expect(testStruct.updateReason).to(beNil()); + expect(testStruct.updatedAppServiceRecord).to(beNil()); + }); +}); + +QuickSpecEnd diff --git a/SmartDeviceLinkTests/RPCSpecs/StructSpecs/SDLAppServiceDataSpec.m b/SmartDeviceLinkTests/RPCSpecs/StructSpecs/SDLAppServiceDataSpec.m new file mode 100644 index 000000000..3e94c5def --- /dev/null +++ b/SmartDeviceLinkTests/RPCSpecs/StructSpecs/SDLAppServiceDataSpec.m @@ -0,0 +1,140 @@ +// +// SDLAppServiceDataSpec.m +// SmartDeviceLinkTests +// +// Created by Nicole on 2/5/19. +// Copyright © 2019 smartdevicelink. All rights reserved. +// + +#import <Quick/Quick.h> +#import <Nimble/Nimble.h> + +#import "SDLAppServiceData.h" +#import "SDLAppServiceType.h" +#import "SDLMediaServiceData.h" +#import "SDLNavigationServiceData.h" +#import "SDLRPCParameterNames.h" +#import "SDLWeatherServiceData.h" + +QuickSpecBegin(SDLAppServiceDataSpec) + +describe(@"Getter/Setter Tests", ^{ + __block NSString *testServiceType = nil; + __block SDLAppServiceType testAppServiceType = nil; + __block NSString *testServiceId = nil; + __block SDLMediaServiceData *testMediaServiceData = nil; + __block SDLWeatherServiceData *testWeatherServiceData = nil; + __block SDLNavigationServiceData *testNavigationServiceData = nil; + + beforeEach(^{ + testServiceType = SDLAppServiceTypeMedia; + testAppServiceType = SDLAppServiceTypeNavigation; + testServiceId = @"a1*54z"; + testMediaServiceData = [[SDLMediaServiceData alloc] init]; + testWeatherServiceData = [[SDLWeatherServiceData alloc] init]; + testNavigationServiceData = [[SDLNavigationServiceData alloc] init]; + }); + + it(@"Should set and get correctly", ^{ + SDLAppServiceData *testStruct = [[SDLAppServiceData alloc] init]; + testStruct.serviceType = testServiceType; + testStruct.serviceId = testServiceId; + testStruct.mediaServiceData = testMediaServiceData; + testStruct.weatherServiceData = testWeatherServiceData; + testStruct.navigationServiceData = testNavigationServiceData; + + expect(testStruct.serviceType).to(equal(testServiceType)); + expect(testStruct.serviceId).to(equal(testServiceId)); + expect(testStruct.mediaServiceData).to(equal(testMediaServiceData)); + expect(testStruct.weatherServiceData).to(equal(testWeatherServiceData)); + expect(testStruct.navigationServiceData).to(equal(testNavigationServiceData)); + }); + + it(@"Should get correctly when initialized with a dictionary", ^{ + NSDictionary *dict = @{SDLRPCParameterNameServiceType:testServiceType, + SDLRPCParameterNameServiceID:testServiceId, + SDLRPCParameterNameMediaServiceData:testMediaServiceData, + SDLRPCParameterNameWeatherServiceData:testWeatherServiceData, + SDLRPCParameterNameNavigationServiceData:testNavigationServiceData + }; + SDLAppServiceData *testStruct = [[SDLAppServiceData alloc] initWithDictionary:dict]; + + expect(testStruct.serviceType).to(equal(testServiceType)); + expect(testStruct.serviceId).to(equal(testServiceId)); + expect(testStruct.mediaServiceData).to(equal(testMediaServiceData)); + expect(testStruct.weatherServiceData).to(equal(testWeatherServiceData)); + expect(testStruct.navigationServiceData).to(equal(testNavigationServiceData)); + }); + + it(@"Should get correctly when initialized with initWithServiceType:serviceId:", ^{ + SDLAppServiceData *testStruct = [[SDLAppServiceData alloc] initWithServiceType:testServiceType serviceId:testServiceId]; + + expect(testStruct.serviceType).to(equal(testServiceType)); + expect(testStruct.serviceId).to(equal(testServiceId)); + expect(testStruct.mediaServiceData).to(beNil()); + expect(testStruct.weatherServiceData).to(beNil()); + expect(testStruct.navigationServiceData).to(beNil()); + }); + + it(@"Should get correctly when initialized with initWithAppServiceType:serviceId:", ^{ + SDLAppServiceData *testStruct = [[SDLAppServiceData alloc] initWithAppServiceType:testAppServiceType serviceId:testServiceId]; + + expect(testStruct.serviceType).to(equal(testAppServiceType)); + expect(testStruct.serviceId).to(equal(testServiceId)); + expect(testStruct.mediaServiceData).to(beNil()); + expect(testStruct.weatherServiceData).to(beNil()); + expect(testStruct.navigationServiceData).to(beNil()); + }); + + it(@"Should get correctly when initialized with initWithMediaServiceData:serviceId:", ^{ + SDLAppServiceData *testStruct = [[SDLAppServiceData alloc] initWithMediaServiceData:testMediaServiceData serviceId:testServiceId]; + + expect(testStruct.serviceType).to(equal(SDLAppServiceTypeMedia)); + expect(testStruct.serviceId).to(equal(testServiceId)); + expect(testStruct.mediaServiceData).to(equal(testMediaServiceData)); + expect(testStruct.weatherServiceData).to(beNil()); + expect(testStruct.navigationServiceData).to(beNil()); + }); + + it(@"Should get correctly when initialized with initWithWeatherServiceData:serviceId:", ^{ + SDLAppServiceData *testStruct = [[SDLAppServiceData alloc] initWithWeatherServiceData:testWeatherServiceData serviceId:testServiceId]; + + expect(testStruct.serviceType).to(equal(SDLAppServiceTypeWeather)); + expect(testStruct.serviceId).to(equal(testServiceId)); + expect(testStruct.mediaServiceData).to(beNil()); + expect(testStruct.weatherServiceData).to(equal(testWeatherServiceData)); + expect(testStruct.navigationServiceData).to(beNil()); + }); + + it(@"Should get correctly when initialized with initWithNavigationServiceData:serviceId:", ^{ + SDLAppServiceData *testStruct = [[SDLAppServiceData alloc] initWithNavigationServiceData:testNavigationServiceData serviceId:testServiceId]; + + expect(testStruct.serviceType).to(equal(SDLAppServiceTypeNavigation)); + expect(testStruct.serviceId).to(equal(testServiceId)); + expect(testStruct.mediaServiceData).to(beNil()); + expect(testStruct.weatherServiceData).to(beNil()); + expect(testStruct.navigationServiceData).to(equal(testNavigationServiceData)); + }); + + it(@"Should get correctly when initialized with initWithServiceType:serviceId:mediaServiceData:weatherServiceData:navigationServiceData:", ^{ + SDLAppServiceData *testStruct = [[SDLAppServiceData alloc] initWithServiceType:testServiceType serviceId:testServiceId mediaServiceData:testMediaServiceData weatherServiceData:testWeatherServiceData navigationServiceData:testNavigationServiceData]; + + expect(testStruct.serviceType).to(equal(testServiceType)); + expect(testStruct.serviceId).to(equal(testServiceId)); + expect(testStruct.mediaServiceData).to(equal(testMediaServiceData)); + expect(testStruct.weatherServiceData).to(equal(testWeatherServiceData)); + expect(testStruct.navigationServiceData).to(equal(testNavigationServiceData)); + }); + + it(@"Should return nil if not set", ^{ + SDLAppServiceData *testStruct = [[SDLAppServiceData alloc] init]; + + expect(testStruct.serviceType).to(beNil()); + expect(testStruct.serviceId).to(beNil()); + expect(testStruct.mediaServiceData).to(beNil()); + expect(testStruct.weatherServiceData).to(beNil()); + expect(testStruct.navigationServiceData).to(beNil()); + }); +}); + +QuickSpecEnd diff --git a/SmartDeviceLinkTests/RPCSpecs/StructSpecs/SDLAppServiceManifestSpec.m b/SmartDeviceLinkTests/RPCSpecs/StructSpecs/SDLAppServiceManifestSpec.m new file mode 100644 index 000000000..3b3467c3a --- /dev/null +++ b/SmartDeviceLinkTests/RPCSpecs/StructSpecs/SDLAppServiceManifestSpec.m @@ -0,0 +1,196 @@ +// +// SDLAppServiceManifestSpec.m +// SmartDeviceLinkTests +// +// Created by Nicole on 1/30/19. +// Copyright © 2019 smartdevicelink. All rights reserved. +// + +#import <Quick/Quick.h> +#import <Nimble/Nimble.h> + +#import "SDLAppServiceManifest.h" +#import "SDLAppServiceType.h" +#import "SDLFunctionID.h" +#import "SDLImage.h" +#import "SDLNavigationServiceManifest.h" +#import "SDLMediaServiceManifest.h" +#import "SDLRPCParameterNames.h" +#import "SDLRPCFunctionNames.h" +#import "SDLSyncMsgVersion.h" +#import "SDLWeatherServiceManifest.h" + +QuickSpecBegin(SDLAppServiceManifestSpec) + +describe(@"Getter/Setter Tests", ^ { + __block NSString *testServiceName = nil; + __block NSString *testServiceType = nil; + __block SDLAppServiceType testAppServiceType = nil; + __block SDLImage *testServiceIcon = nil; + __block NSNumber<SDLBool> *testAllowAppConsumers = nil; + __block SDLSyncMsgVersion *testRPCSpecVersion = nil; + __block NSArray<NSNumber<SDLInt> *> *testHandledRPCs = nil; + __block SDLWeatherServiceManifest *testWeatherServiceManifest = nil; + __block SDLMediaServiceManifest *testMediaServiceManifest = nil; + __block SDLNavigationServiceManifest *testNavigationServiceManifest = nil; + + beforeEach(^{ + testServiceName = @"testService"; + testServiceType = SDLAppServiceTypeMedia; + testAppServiceType = SDLAppServiceTypeNavigation; + testServiceIcon = [[SDLImage alloc] initWithName:@"testImage" isTemplate:false]; + testAllowAppConsumers = @YES; + testRPCSpecVersion = [[SDLSyncMsgVersion alloc] initWithMajorVersion:5 minorVersion:2 patchVersion:1]; + testHandledRPCs = [[NSArray alloc] initWithObjects:[SDLFunctionID.sharedInstance functionIdForName:SDLRPCFunctionNameAddCommand], [SDLFunctionID.sharedInstance functionIdForName:SDLRPCFunctionNameCreateInteractionChoiceSet], nil]; + testWeatherServiceManifest = [[SDLWeatherServiceManifest alloc] initWithCurrentForecastSupported:true maxMultidayForecastAmount:3 maxHourlyForecastAmount:0 maxMinutelyForecastAmount:0 weatherForLocationSupported:false]; + testMediaServiceManifest = [[SDLMediaServiceManifest alloc] init]; + testNavigationServiceManifest = [[SDLNavigationServiceManifest alloc] init]; + }); + + it(@"Should set and get correctly", ^{ + SDLAppServiceManifest *testStruct = [[SDLAppServiceManifest alloc] init]; + testStruct.serviceName = testServiceName; + testStruct.serviceType = testServiceType; + testStruct.serviceIcon = testServiceIcon; + testStruct.allowAppConsumers = testAllowAppConsumers; + testStruct.rpcSpecVersion = testRPCSpecVersion; + testStruct.handledRPCs = testHandledRPCs; + testStruct.weatherServiceManifest = testWeatherServiceManifest; + testStruct.mediaServiceManifest = testMediaServiceManifest; + testStruct.navigationServiceManifest = testNavigationServiceManifest; + + expect(testStruct.serviceName).to(match(testServiceName)); + expect(testStruct.serviceType).to(match(testServiceType)); + expect(testStruct.serviceIcon).to(equal(testServiceIcon)); + expect(testStruct.allowAppConsumers).to(beTrue()); + expect(testStruct.rpcSpecVersion).to(equal(testRPCSpecVersion)); + expect(testStruct.handledRPCs).to(equal(testHandledRPCs)); + expect(testStruct.weatherServiceManifest).to(equal(testWeatherServiceManifest)); + expect(testStruct.mediaServiceManifest).to(equal(testMediaServiceManifest)); + expect(testStruct.navigationServiceManifest).to(equal(testNavigationServiceManifest)); + }); + + it(@"Should get correctly when initialized with a dictionary", ^{ + NSDictionary *dict = @{SDLRPCParameterNameServiceName:testServiceName, + SDLRPCParameterNameServiceType:testServiceType, + SDLRPCParameterNameServiceIcon:testServiceIcon, + SDLRPCParameterNameAllowAppConsumers:testAllowAppConsumers, + SDLRPCParameterNameRPCSpecVersion:testRPCSpecVersion, + SDLRPCParameterNameHandledRPCs:testHandledRPCs, + SDLRPCParameterNameWeatherServiceManifest:testWeatherServiceManifest, + SDLRPCParameterNameMediaServiceManifest:testMediaServiceManifest, + SDLRPCParameterNameNavigationServiceManifest:testNavigationServiceManifest + }; + SDLAppServiceManifest *testStruct = [[SDLAppServiceManifest alloc] initWithDictionary:dict]; + + expect(testStruct.serviceName).to(match(testServiceName)); + expect(testStruct.serviceType).to(equal(testServiceType)); + expect(testStruct.serviceIcon).to(equal(testServiceIcon)); + expect(testStruct.allowAppConsumers).to(beTrue()); + expect(testStruct.rpcSpecVersion).to(equal(testRPCSpecVersion)); + expect(testStruct.handledRPCs).to(equal(testHandledRPCs)); + expect(testStruct.weatherServiceManifest).to(equal(testWeatherServiceManifest)); + expect(testStruct.mediaServiceManifest).to(equal(testMediaServiceManifest)); + expect(testStruct.navigationServiceManifest).to(equal(testNavigationServiceManifest)); + }); + + it(@"Should init correctly with initWithServiceType:", ^{ + SDLAppServiceManifest *testStruct = [[SDLAppServiceManifest alloc] initWithServiceType:testServiceType]; + + expect(testStruct.serviceName).to(beNil()); + expect(testStruct.serviceType).to(equal(testServiceType)); + expect(testStruct.serviceIcon).to(beNil()); + expect(testStruct.allowAppConsumers).to(beNil()); + expect(testStruct.rpcSpecVersion).to(beNil()); + expect(testStruct.handledRPCs).to(beNil()); + expect(testStruct.weatherServiceManifest).to(beNil()); + expect(testStruct.mediaServiceManifest).to(beNil()); + expect(testStruct.navigationServiceManifest).to(beNil()); + }); + + it(@"Should init correctly with initWithAppServiceType:", ^{ + SDLAppServiceManifest *testStruct = [[SDLAppServiceManifest alloc] initWithAppServiceType:testAppServiceType]; + + expect(testStruct.serviceName).to(beNil()); + expect(testStruct.serviceType).to(equal(testAppServiceType)); + expect(testStruct.serviceIcon).to(beNil()); + expect(testStruct.allowAppConsumers).to(beNil()); + expect(testStruct.rpcSpecVersion).to(beNil()); + expect(testStruct.handledRPCs).to(beNil()); + expect(testStruct.weatherServiceManifest).to(beNil()); + expect(testStruct.mediaServiceManifest).to(beNil()); + expect(testStruct.navigationServiceManifest).to(beNil()); + }); + + it(@"Should init correctly with initWithMediaServiceName:serviceIcon:allowAppConsumers:rpcSpecVersion:handledRPCs:mediaServiceManifest:", ^{ + SDLAppServiceManifest *testStruct = [[SDLAppServiceManifest alloc] initWithMediaServiceName:testServiceName serviceIcon:testServiceIcon allowAppConsumers:testAllowAppConsumers rpcSpecVersion:testRPCSpecVersion handledRPCs:testHandledRPCs mediaServiceManifest:testMediaServiceManifest]; + + expect(testStruct.serviceName).to(match(testServiceName)); + expect(testStruct.serviceType).to(equal(SDLAppServiceTypeMedia)); + expect(testStruct.serviceIcon).to(equal(testServiceIcon)); + expect(testStruct.allowAppConsumers).to(beTrue()); + expect(testStruct.rpcSpecVersion).to(equal(testRPCSpecVersion)); + expect(testStruct.handledRPCs).to(equal(testHandledRPCs)); + expect(testStruct.weatherServiceManifest).to(beNil()); + expect(testStruct.mediaServiceManifest).to(equal(testMediaServiceManifest)); + expect(testStruct.navigationServiceManifest).to(beNil()); + }); + + it(@"Should init correctly with initWithWeatherServiceName:serviceIcon:allowAppConsumers:rpcSpecVersion:handledRPCs:weatherServiceManifest:", ^{ + SDLAppServiceManifest *testStruct = [[SDLAppServiceManifest alloc] initWithWeatherServiceName:testServiceName serviceIcon:testServiceIcon allowAppConsumers:testAllowAppConsumers rpcSpecVersion:testRPCSpecVersion handledRPCs:testHandledRPCs weatherServiceManifest:testWeatherServiceManifest]; + + expect(testStruct.serviceName).to(match(testServiceName)); + expect(testStruct.serviceType).to(equal(SDLAppServiceTypeWeather)); + expect(testStruct.serviceIcon).to(equal(testServiceIcon)); + expect(testStruct.allowAppConsumers).to(beTrue()); + expect(testStruct.rpcSpecVersion).to(equal(testRPCSpecVersion)); + expect(testStruct.handledRPCs).to(equal(testHandledRPCs)); + expect(testStruct.weatherServiceManifest).to(equal(testWeatherServiceManifest)); + expect(testStruct.mediaServiceManifest).to(beNil()); + expect(testStruct.navigationServiceManifest).to(beNil()); + }); + + it(@"Should init correctly with initWithNavigationServiceName:serviceIcon:allowAppConsumers:rpcSpecVersion:handledRPCs:navigationServiceManifest:", ^{ + SDLAppServiceManifest *testStruct = [[SDLAppServiceManifest alloc] initWithNavigationServiceName:testServiceName serviceIcon:testServiceIcon allowAppConsumers:testAllowAppConsumers rpcSpecVersion:testRPCSpecVersion handledRPCs:testHandledRPCs navigationServiceManifest:testNavigationServiceManifest]; + + expect(testStruct.serviceName).to(match(testServiceName)); + expect(testStruct.serviceType).to(equal(SDLAppServiceTypeNavigation)); + expect(testStruct.serviceIcon).to(equal(testServiceIcon)); + expect(testStruct.allowAppConsumers).to(beTrue()); + expect(testStruct.rpcSpecVersion).to(equal(testRPCSpecVersion)); + expect(testStruct.handledRPCs).to(equal(testHandledRPCs)); + expect(testStruct.weatherServiceManifest).to(beNil()); + expect(testStruct.mediaServiceManifest).to(beNil()); + expect(testStruct.navigationServiceManifest).to(equal(testNavigationServiceManifest)); + }); + + it(@"Should init correctly with initWithServiceName:serviceType:serviceIcon:allowAppConsumers:rpcSpecVersion:handledRPCs:mediaServiceManifest:weatherServiceManifest:navigationServiceManifest:", ^{ + SDLAppServiceManifest *testStruct = [[SDLAppServiceManifest alloc] initWithServiceName:testServiceName serviceType:testServiceType serviceIcon:testServiceIcon allowAppConsumers:testAllowAppConsumers rpcSpecVersion:testRPCSpecVersion handledRPCs:testHandledRPCs mediaServiceManifest:testMediaServiceManifest weatherServiceManifest:testWeatherServiceManifest navigationServiceManifest:testNavigationServiceManifest]; + + expect(testStruct.serviceName).to(match(testServiceName)); + expect(testStruct.serviceType).to(equal(testServiceType)); + expect(testStruct.serviceIcon).to(equal(testServiceIcon)); + expect(testStruct.allowAppConsumers).to(beTrue()); + expect(testStruct.rpcSpecVersion).to(equal(testRPCSpecVersion)); + expect(testStruct.handledRPCs).to(equal(testHandledRPCs)); + expect(testStruct.weatherServiceManifest).to(equal(testWeatherServiceManifest)); + expect(testStruct.mediaServiceManifest).to(equal(testMediaServiceManifest)); + expect(testStruct.navigationServiceManifest).to(equal(testNavigationServiceManifest)); + }); + + it(@"Should return nil if not set", ^{ + SDLAppServiceManifest *testStruct = [[SDLAppServiceManifest alloc] init]; + + expect(testStruct.serviceName).to(beNil()); + expect(testStruct.serviceType).to(beNil()); + expect(testStruct.serviceIcon).to(beNil()); + expect(testStruct.allowAppConsumers).to(beNil()); + expect(testStruct.rpcSpecVersion).to(beNil()); + expect(testStruct.handledRPCs).to(beNil()); + expect(testStruct.weatherServiceManifest).to(beNil()); + expect(testStruct.mediaServiceManifest).to(beNil()); + expect(testStruct.navigationServiceManifest).to(beNil()); + }); +}); + +QuickSpecEnd diff --git a/SmartDeviceLinkTests/RPCSpecs/StructSpecs/SDLAppServiceRecordSpec.m b/SmartDeviceLinkTests/RPCSpecs/StructSpecs/SDLAppServiceRecordSpec.m new file mode 100644 index 000000000..f0d99c84f --- /dev/null +++ b/SmartDeviceLinkTests/RPCSpecs/StructSpecs/SDLAppServiceRecordSpec.m @@ -0,0 +1,78 @@ +// +// SDLAppServiceRecordSpec.m +// SmartDeviceLinkTests +// +// Created by Nicole on 1/29/19. +// Copyright © 2019 smartdevicelink. All rights reserved. +// + +#import <Quick/Quick.h> +#import <Nimble/Nimble.h> + +#import "SDLAppServiceManifest.h" +#import "SDLAppServiceRecord.h" +#import "SDLRPCParameterNames.h" + +QuickSpecBegin(SDLAppServiceRecordSpec) + +describe(@"Getter/Setter Tests", ^{ + __block NSString *testServiceID = nil; + __block SDLAppServiceManifest *testAppServiceManifest = nil; + __block NSNumber<SDLBool> *testServicePublished = nil; + __block NSNumber<SDLBool> *testServiceActive = nil; + + beforeEach(^{ + testServiceID = @"12345"; + testAppServiceManifest = [[SDLAppServiceManifest alloc] initWithDictionary:@{SDLRPCParameterNameAllowAppConsumers:@NO}]; + testServicePublished = @NO; + testServiceActive = @YES; + }); + + it(@"Should set and get correctly", ^{ + SDLAppServiceRecord *testStruct = [[SDLAppServiceRecord alloc] init]; + testStruct.serviceID = testServiceID; + testStruct.serviceManifest = testAppServiceManifest; + testStruct.servicePublished = testServicePublished; + testStruct.serviceActive = testServiceActive; + + expect(testStruct.serviceID).to(match(testServiceID)); + expect(testStruct.serviceManifest).to(equal(testAppServiceManifest)); + expect(testStruct.servicePublished).to(equal(testServicePublished)); + expect(testStruct.serviceActive).to(equal(testServiceActive)); + }); + + it(@"Should initWithServiceId:serviceManifest:servicePublished:serviceActive: correctly", ^{ + SDLAppServiceRecord *testStruct = [[SDLAppServiceRecord alloc] initWithServiceID:testServiceID serviceManifest:testAppServiceManifest servicePublished:false serviceActive:true]; + + expect(testStruct.serviceID).to(match(testServiceID)); + expect(testStruct.serviceManifest).to(equal(testAppServiceManifest)); + expect(testStruct.servicePublished).to(equal(testServicePublished)); + expect(testStruct.serviceActive).to(equal(testServiceActive)); + }); + + it(@"Should get correctly when initialized with a dictionary", ^{ + NSDictionary *dict = @{SDLRPCParameterNameServiceID:testServiceID, + SDLRPCParameterNameServiceManifest:testAppServiceManifest, + SDLRPCParameterNameServicePublished:testServicePublished, + SDLRPCParameterNameServiceActive:testServiceActive + }; + SDLAppServiceRecord *testStruct = [[SDLAppServiceRecord alloc] initWithDictionary:dict]; + + expect(testStruct.serviceID).to(match(testServiceID)); + expect(testStruct.serviceManifest).to(equal(testAppServiceManifest)); + expect(testStruct.servicePublished).to(equal(testServicePublished)); + expect(testStruct.serviceActive).to(equal(testServiceActive)); + }); + + it(@"Should return nil if not set", ^{ + SDLAppServiceRecord *testStruct = [[SDLAppServiceRecord alloc] init]; + + expect(testStruct.serviceID).to(beNil()); + expect(testStruct.serviceManifest).to(beNil()); + expect(testStruct.servicePublished).to(beNil()); + expect(testStruct.serviceActive).to(beNil()); + }); +}); + +QuickSpecEnd + diff --git a/SmartDeviceLinkTests/RPCSpecs/StructSpecs/SDLAppServicesCapabilitiesSpec.m b/SmartDeviceLinkTests/RPCSpecs/StructSpecs/SDLAppServicesCapabilitiesSpec.m new file mode 100644 index 000000000..486a664e8 --- /dev/null +++ b/SmartDeviceLinkTests/RPCSpecs/StructSpecs/SDLAppServicesCapabilitiesSpec.m @@ -0,0 +1,53 @@ +// +// SDLAppServicesCapabilitiesSpec.m +// SmartDeviceLinkTests +// +// Created by Nicole on 1/30/19. +// Copyright © 2019 smartdevicelink. All rights reserved. +// + +#import <Quick/Quick.h> +#import <Nimble/Nimble.h> + +#import "SDLAppServiceCapability.h" +#import "SDLAppServicesCapabilities.h" +#import "SDLRPCParameterNames.h" + +QuickSpecBegin(SDLAppServicesCapabilitiesSpec) + +describe(@"Getter/Setter Tests", ^{ + __block NSArray<SDLAppServiceCapability *> *testAppServices = nil; + + beforeEach(^{ + testAppServices = @[[[SDLAppServiceCapability alloc] initWithDictionary:@{SDLRPCParameterNameUpdateReason:SDLServiceUpdateRemoved}]]; + }); + + it(@"Should set and get correctly", ^{ + SDLAppServicesCapabilities *testStruct = [[SDLAppServicesCapabilities alloc] init]; + testStruct.appServices = testAppServices; + + expect(testStruct.appServices).to(equal(testAppServices)); + }); + + it(@"Should set and get with initWithServicesSupported:appServices:", ^{ + SDLAppServicesCapabilities *testStruct = [[SDLAppServicesCapabilities alloc] initWithAppServices:testAppServices]; + + expect(testStruct.appServices).to(equal(testAppServices)); + }); + + it(@"Should get correctly when initialized with a dictionary", ^{ + NSDictionary *dict = @{SDLRPCParameterNameAppServices:testAppServices + }; + SDLAppServicesCapabilities *testStruct = [[SDLAppServicesCapabilities alloc] initWithDictionary:dict]; + + expect(testStruct.appServices).to(equal(testAppServices)); + }); + + it(@"Should return nil if not set", ^{ + SDLAppServicesCapabilities *testStruct = [[SDLAppServicesCapabilities alloc] init]; + + expect(testStruct.appServices).to(beNil()); + }); +}); + +QuickSpecEnd diff --git a/SmartDeviceLinkTests/RPCSpecs/StructSpecs/SDLAudioControlCapabilitiesSpec.m b/SmartDeviceLinkTests/RPCSpecs/StructSpecs/SDLAudioControlCapabilitiesSpec.m index f785e9bce..d99d76c22 100644 --- a/SmartDeviceLinkTests/RPCSpecs/StructSpecs/SDLAudioControlCapabilitiesSpec.m +++ b/SmartDeviceLinkTests/RPCSpecs/StructSpecs/SDLAudioControlCapabilitiesSpec.m @@ -9,7 +9,7 @@ #import <Nimble/Nimble.h> #import "SDLAudioControlCapabilities.h" -#import "SDLNames.h" +#import "SDLRPCParameterNames.h" QuickSpecBegin( SDLAudioControlCapabilitiesSpec) @@ -56,12 +56,12 @@ describe(@"Getter/Setter Tests", ^ { }); it(@"Should get correctly when initialized", ^ { - NSMutableDictionary* dict = [@{SDLNameModuleName:@"module", - SDLNameSourceAvailable:@(NO), - SDLNameKeepContextAvailable: @YES, - SDLNameVolumeAvailable:@(YES), - SDLNameEqualizerAvailable:@(NO), - SDLNameEqualizerMaxChannelId:@12 + NSMutableDictionary* dict = [@{SDLRPCParameterNameModuleName:@"module", + SDLRPCParameterNameSourceAvailable:@(NO), + SDLRPCParameterNameKeepContextAvailable: @YES, + SDLRPCParameterNameVolumeAvailable:@(YES), + SDLRPCParameterNameEqualizerAvailable:@(NO), + SDLRPCParameterNameEqualizerMaxChannelId:@12 } mutableCopy]; SDLAudioControlCapabilities* testStruct = [[SDLAudioControlCapabilities alloc] initWithDictionary:dict]; diff --git a/SmartDeviceLinkTests/RPCSpecs/StructSpecs/SDLAudioControlDataSpec.m b/SmartDeviceLinkTests/RPCSpecs/StructSpecs/SDLAudioControlDataSpec.m index f12cbc52b..19b88b71b 100644 --- a/SmartDeviceLinkTests/RPCSpecs/StructSpecs/SDLAudioControlDataSpec.m +++ b/SmartDeviceLinkTests/RPCSpecs/StructSpecs/SDLAudioControlDataSpec.m @@ -11,7 +11,7 @@ #import "SDLAudioControlData.h" #import "SDLPrimaryAudioSource.h" #import "SDLEqualizerSettings.h" -#import "SDLNames.h" +#import "SDLRPCParameterNames.h" QuickSpecBegin( SDLAudioControlDataSpec) @@ -43,10 +43,10 @@ describe(@"Getter/Setter Tests", ^ { }); it(@"Should get correctly when initialized", ^ { - NSMutableDictionary* dict = [@{SDLNameSource:SDLPrimaryAudioSourceCD, - SDLNameKeepContext:@(NO), - SDLNameVolume:@(NO), - SDLNameEqualizerSettings:[@[someEqualizerSettings] copy] + NSMutableDictionary* dict = [@{SDLRPCParameterNameSource:SDLPrimaryAudioSourceCD, + SDLRPCParameterNameKeepContext:@(NO), + SDLRPCParameterNameVolume:@(NO), + SDLRPCParameterNameEqualizerSettings:[@[someEqualizerSettings] copy] } mutableCopy]; SDLAudioControlData* testStruct = [[SDLAudioControlData alloc] initWithDictionary:dict]; diff --git a/SmartDeviceLinkTests/RPCSpecs/StructSpecs/SDLAudioPassThruCapabilitiesSpec.m b/SmartDeviceLinkTests/RPCSpecs/StructSpecs/SDLAudioPassThruCapabilitiesSpec.m index 5e2981852..915af499a 100644 --- a/SmartDeviceLinkTests/RPCSpecs/StructSpecs/SDLAudioPassThruCapabilitiesSpec.m +++ b/SmartDeviceLinkTests/RPCSpecs/StructSpecs/SDLAudioPassThruCapabilitiesSpec.m @@ -11,7 +11,7 @@ #import "SDLAudioPassThruCapabilities.h" #import "SDLAudioType.h" #import "SDLBitsPerSample.h" -#import "SDLNames.h" +#import "SDLRPCParameterNames.h" #import "SDLSamplingRate.h" @@ -31,9 +31,9 @@ describe(@"Getter/Setter Tests", ^ { }); it(@"Should get correctly when initialized", ^ { - NSMutableDictionary* dict = [@{SDLNameSamplingRate:SDLSamplingRate22KHZ, - SDLNameBitsPerSample:SDLBitsPerSample8Bit, - SDLNameAudioType:SDLAudioTypePCM} mutableCopy]; + NSMutableDictionary* dict = [@{SDLRPCParameterNameSamplingRate:SDLSamplingRate22KHZ, + SDLRPCParameterNameBitsPerSample:SDLBitsPerSample8Bit, + SDLRPCParameterNameAudioType:SDLAudioTypePCM} mutableCopy]; SDLAudioPassThruCapabilities* testStruct = [[SDLAudioPassThruCapabilities alloc] initWithDictionary:dict]; expect(testStruct.samplingRate).to(equal(SDLSamplingRate22KHZ)); diff --git a/SmartDeviceLinkTests/RPCSpecs/StructSpecs/SDLBeltStatusSpec.m b/SmartDeviceLinkTests/RPCSpecs/StructSpecs/SDLBeltStatusSpec.m index e6e9495c5..dbe9d7b1f 100644 --- a/SmartDeviceLinkTests/RPCSpecs/StructSpecs/SDLBeltStatusSpec.m +++ b/SmartDeviceLinkTests/RPCSpecs/StructSpecs/SDLBeltStatusSpec.m @@ -9,7 +9,7 @@ #import <Nimble/Nimble.h> #import "SDLBeltStatus.h" -#import "SDLNames.h" +#import "SDLRPCParameterNames.h" #import "SDLVehicleDataEventStatus.h" @@ -53,21 +53,21 @@ describe(@"Getter/Setter Tests", ^ { }); it(@"Should get correctly when initialized", ^ { - NSMutableDictionary* dict = [@{SDLNameDriverBeltDeployed:SDLVehicleDataEventStatusNoEvent, - SDLNamePassengerBeltDeployed:SDLVehicleDataEventStatusYes, - SDLNamePassengerBuckleBelted:SDLVehicleDataEventStatusNo, - SDLNameDriverBuckleBelted:SDLVehicleDataEventStatusFault, - SDLNameLeftRow2BuckleBelted:SDLVehicleDataEventStatusYes, - SDLNamePassengerChildDetected:SDLVehicleDataEventStatusNo, - SDLNameRightRow2BuckleBelted:SDLVehicleDataEventStatusNotSupported, - SDLNameMiddleRow2BuckleBelted:SDLVehicleDataEventStatusNoEvent, - SDLNameMiddleRow3BuckleBelted:SDLVehicleDataEventStatusYes, - SDLNameLeftRow3BuckleBelted:SDLVehicleDataEventStatusFault, - SDLNameRightRow3BuckleBelted:SDLVehicleDataEventStatusNo, - SDLNameLeftRearInflatableBelted:SDLVehicleDataEventStatusNotSupported, - SDLNameRightRearInflatableBelted:SDLVehicleDataEventStatusFault, - SDLNameMiddleRow1BeltDeployed:SDLVehicleDataEventStatusNoEvent, - SDLNameMiddleRow1BuckleBelted:SDLVehicleDataEventStatusNotSupported} mutableCopy]; + NSMutableDictionary* dict = [@{SDLRPCParameterNameDriverBeltDeployed:SDLVehicleDataEventStatusNoEvent, + SDLRPCParameterNamePassengerBeltDeployed:SDLVehicleDataEventStatusYes, + SDLRPCParameterNamePassengerBuckleBelted:SDLVehicleDataEventStatusNo, + SDLRPCParameterNameDriverBuckleBelted:SDLVehicleDataEventStatusFault, + SDLRPCParameterNameLeftRow2BuckleBelted:SDLVehicleDataEventStatusYes, + SDLRPCParameterNamePassengerChildDetected:SDLVehicleDataEventStatusNo, + SDLRPCParameterNameRightRow2BuckleBelted:SDLVehicleDataEventStatusNotSupported, + SDLRPCParameterNameMiddleRow2BuckleBelted:SDLVehicleDataEventStatusNoEvent, + SDLRPCParameterNameMiddleRow3BuckleBelted:SDLVehicleDataEventStatusYes, + SDLRPCParameterNameLeftRow3BuckleBelted:SDLVehicleDataEventStatusFault, + SDLRPCParameterNameRightRow3BuckleBelted:SDLVehicleDataEventStatusNo, + SDLRPCParameterNameLeftRearInflatableBelted:SDLVehicleDataEventStatusNotSupported, + SDLRPCParameterNameRightRearInflatableBelted:SDLVehicleDataEventStatusFault, + SDLRPCParameterNameMiddleRow1BeltDeployed:SDLVehicleDataEventStatusNoEvent, + SDLRPCParameterNameMiddleRow1BuckleBelted:SDLVehicleDataEventStatusNotSupported} mutableCopy]; SDLBeltStatus* testStruct = [[SDLBeltStatus alloc] initWithDictionary:dict]; expect(testStruct.driverBeltDeployed).to(equal(SDLVehicleDataEventStatusNoEvent)); diff --git a/SmartDeviceLinkTests/RPCSpecs/StructSpecs/SDLBodyInformationSpec.m b/SmartDeviceLinkTests/RPCSpecs/StructSpecs/SDLBodyInformationSpec.m index 6ed210075..9c8765525 100644 --- a/SmartDeviceLinkTests/RPCSpecs/StructSpecs/SDLBodyInformationSpec.m +++ b/SmartDeviceLinkTests/RPCSpecs/StructSpecs/SDLBodyInformationSpec.m @@ -11,7 +11,7 @@ #import "SDLBodyInformation.h" #import "SDLIgnitionStableStatus.h" #import "SDLIgnitionStatus.h" -#import "SDLNames.h" +#import "SDLRPCParameterNames.h" QuickSpecBegin(SDLBodyInformationSpec) @@ -37,13 +37,13 @@ describe(@"Getter/Setter Tests", ^ { }); it(@"Should get correctly when initialized", ^ { - NSMutableDictionary* dict = [@{SDLNameParkBrakeActive:@YES, - SDLNameIgnitionStableStatus:SDLIgnitionStableStatusNotStable, - SDLNameIgnitionStatus:SDLIgnitionStatusStart, - SDLNameDriverDoorAjar:@NO, - SDLNamePassengerDoorAjar:@NO, - SDLNameRearLeftDoorAjar:@NO, - SDLNameRearRightDoorAjar:@YES} mutableCopy]; + NSMutableDictionary* dict = [@{SDLRPCParameterNameParkBrakeActive:@YES, + SDLRPCParameterNameIgnitionStableStatus:SDLIgnitionStableStatusNotStable, + SDLRPCParameterNameIgnitionStatus:SDLIgnitionStatusStart, + SDLRPCParameterNameDriverDoorAjar:@NO, + SDLRPCParameterNamePassengerDoorAjar:@NO, + SDLRPCParameterNameRearLeftDoorAjar:@NO, + SDLRPCParameterNameRearRightDoorAjar:@YES} mutableCopy]; SDLBodyInformation* testStruct = [[SDLBodyInformation alloc] initWithDictionary:dict]; expect(testStruct.parkBrakeActive).to(equal(@YES)); diff --git a/SmartDeviceLinkTests/RPCSpecs/StructSpecs/SDLButtonCapabilitiesSpec.m b/SmartDeviceLinkTests/RPCSpecs/StructSpecs/SDLButtonCapabilitiesSpec.m index b10e0b094..f4a0a3a89 100644 --- a/SmartDeviceLinkTests/RPCSpecs/StructSpecs/SDLButtonCapabilitiesSpec.m +++ b/SmartDeviceLinkTests/RPCSpecs/StructSpecs/SDLButtonCapabilitiesSpec.m @@ -10,7 +10,7 @@ #import "SDLButtonCapabilities.h" #import "SDLButtonName.h" -#import "SDLNames.h" +#import "SDLRPCParameterNames.h" QuickSpecBegin(SDLButtonCapabilitiesSpec) @@ -31,10 +31,10 @@ describe(@"Getter/Setter Tests", ^ { }); it(@"Should get correctly when initialized", ^ { - NSMutableDictionary* dict = [@{SDLNameName:SDLButtonNameCustomButton, - SDLNameShortPressAvailable:@YES, - SDLNameLongPressAvailable:@YES, - SDLNameUpDownAvailable:@NO} mutableCopy]; + NSMutableDictionary* dict = [@{SDLRPCParameterNameName:SDLButtonNameCustomButton, + SDLRPCParameterNameShortPressAvailable:@YES, + SDLRPCParameterNameLongPressAvailable:@YES, + SDLRPCParameterNameUpDownAvailable:@NO} mutableCopy]; SDLButtonCapabilities* testStruct = [[SDLButtonCapabilities alloc] initWithDictionary:dict]; expect(testStruct.name).to(equal(SDLButtonNameCustomButton)); diff --git a/SmartDeviceLinkTests/RPCSpecs/StructSpecs/SDLChoiceSpec.m b/SmartDeviceLinkTests/RPCSpecs/StructSpecs/SDLChoiceSpec.m index 3fa486a98..7cb870b61 100644 --- a/SmartDeviceLinkTests/RPCSpecs/StructSpecs/SDLChoiceSpec.m +++ b/SmartDeviceLinkTests/RPCSpecs/StructSpecs/SDLChoiceSpec.m @@ -10,7 +10,7 @@ #import "SDLChoice.h" #import "SDLImage.h" -#import "SDLNames.h" +#import "SDLRPCParameterNames.h" QuickSpecBegin(SDLChoiceSpec) @@ -40,13 +40,13 @@ describe(@"Getter/Setter Tests", ^ { }); it(@"Should get correctly when initialized", ^ { - NSMutableDictionary<NSString *, id> *dict = [@{SDLNameChoiceId:@3, - SDLNameMenuName:@"Hello", - SDLNameVRCommands:[@[@"1", @"2"] mutableCopy], - SDLNameImage:image, - SDLNameSecondaryText:@"Arbitrary", - SDLNameTertiaryText:@"qwerty", - SDLNameSecondaryImage:secondaryImage} mutableCopy]; + NSMutableDictionary<NSString *, id> *dict = [@{SDLRPCParameterNameChoiceId:@3, + SDLRPCParameterNameMenuName:@"Hello", + SDLRPCParameterNameVRCommands:[@[@"1", @"2"] mutableCopy], + SDLRPCParameterNameImage:image, + SDLRPCParameterNameSecondaryText:@"Arbitrary", + SDLRPCParameterNameTertiaryText:@"qwerty", + SDLRPCParameterNameSecondaryImage:secondaryImage} mutableCopy]; SDLChoice* testStruct = [[SDLChoice alloc] initWithDictionary:dict]; expect(testStruct.choiceID).to(equal(@3)); diff --git a/SmartDeviceLinkTests/RPCSpecs/StructSpecs/SDLClimateControlCapabilitiesSpec.m b/SmartDeviceLinkTests/RPCSpecs/StructSpecs/SDLClimateControlCapabilitiesSpec.m index 298dd27a3..1bc146b4e 100644 --- a/SmartDeviceLinkTests/RPCSpecs/StructSpecs/SDLClimateControlCapabilitiesSpec.m +++ b/SmartDeviceLinkTests/RPCSpecs/StructSpecs/SDLClimateControlCapabilitiesSpec.m @@ -11,7 +11,7 @@ #import "SDLClimateControlCapabilities.h" #import "SDLDefrostZone.h" #import "SDLVentilationMode.h" -#import "SDLNames.h" +#import "SDLRPCParameterNames.h" QuickSpecBegin(SDLClimateControlCapabilitiesSpec) @@ -57,22 +57,22 @@ describe(@"Getter/Setter Tests", ^ { }); it(@"Should get correctly when initialized", ^ { - NSMutableDictionary<NSString *, id> *dict = [@{SDLNameModuleName:@"Name", - SDLNameFanSpeedAvailable:@YES, - SDLNameDesiredTemperatureAvailable:@NO, - SDLNameACEnableAvailable:@NO, - SDLNameACMaxEnableAvailable:@NO, - SDLNameCirculateAirEnableAvailable:@YES, - SDLNameAutoModeEnableAvailable:@NO, - SDLNameDualModeEnableAvailable:@NO, - SDLNameDefrostZoneAvailable:@YES, - SDLNameDefrostZone:[@[SDLDefrostZoneFront] copy], - SDLNameVentilationModeAvailable:@NO, - SDLNameVentilationMode:[@[SDLVentilationModeUpper] copy], - SDLNameHeatedSteeringWheelAvailable:@YES, - SDLNameHeatedWindshieldAvailable:@NO, - SDLNameHeatedRearWindowAvailable:@YES, - SDLNameHeatedMirrorsAvailable:@NO + NSMutableDictionary<NSString *, id> *dict = [@{SDLRPCParameterNameModuleName:@"Name", + SDLRPCParameterNameFanSpeedAvailable:@YES, + SDLRPCParameterNameDesiredTemperatureAvailable:@NO, + SDLRPCParameterNameACEnableAvailable:@NO, + SDLRPCParameterNameACMaxEnableAvailable:@NO, + SDLRPCParameterNameCirculateAirEnableAvailable:@YES, + SDLRPCParameterNameAutoModeEnableAvailable:@NO, + SDLRPCParameterNameDualModeEnableAvailable:@NO, + SDLRPCParameterNameDefrostZoneAvailable:@YES, + SDLRPCParameterNameDefrostZone:[@[SDLDefrostZoneFront] copy], + SDLRPCParameterNameVentilationModeAvailable:@NO, + SDLRPCParameterNameVentilationMode:[@[SDLVentilationModeUpper] copy], + SDLRPCParameterNameHeatedSteeringWheelAvailable:@YES, + SDLRPCParameterNameHeatedWindshieldAvailable:@NO, + SDLRPCParameterNameHeatedRearWindowAvailable:@YES, + SDLRPCParameterNameHeatedMirrorsAvailable:@NO } mutableCopy]; SDLClimateControlCapabilities* testStruct = [[SDLClimateControlCapabilities alloc] initWithDictionary:dict]; diff --git a/SmartDeviceLinkTests/RPCSpecs/StructSpecs/SDLClimateControlDataSpec.m b/SmartDeviceLinkTests/RPCSpecs/StructSpecs/SDLClimateControlDataSpec.m index 2075fb53d..8864f9ef5 100644 --- a/SmartDeviceLinkTests/RPCSpecs/StructSpecs/SDLClimateControlDataSpec.m +++ b/SmartDeviceLinkTests/RPCSpecs/StructSpecs/SDLClimateControlDataSpec.m @@ -12,7 +12,7 @@ #import "SDLTemperature.h" #import "SDLDefrostZone.h" #import "SDLVentilationMode.h" -#import "SDLNames.h" +#import "SDLRPCParameterNames.h" QuickSpecBegin(SDLClimateControlDataSpec) @@ -100,20 +100,20 @@ describe(@"Getter/Setter Tests", ^ { }); it(@"Should get correctly when initialized with a dictionary", ^ { - NSMutableDictionary<NSString *, id> *dict = [@{SDLNameFanSpeed : @43, - SDLNameCurrentTemperature : currentTemp, - SDLNameDesiredTemperature : desiredTemp, - SDLNameACEnable : @YES, - SDLNameCirculateAirEnable : @YES, - SDLNameAutoModeEnable : @NO, - SDLNameDefrostZone : SDLDefrostZoneFront, - SDLNameDualModeEnable : @NO, - SDLNameACMaxEnable : @YES, - SDLNameVentilationMode :SDLVentilationModeBoth, - SDLNameHeatedSteeringWheelEnable:@NO, - SDLNameHeatedWindshieldEnable:@YES, - SDLNameHeatedRearWindowEnable:@NO, - SDLNameHeatedMirrorsEnable:@YES, + NSMutableDictionary<NSString *, id> *dict = [@{SDLRPCParameterNameFanSpeed : @43, + SDLRPCParameterNameCurrentTemperature : currentTemp, + SDLRPCParameterNameDesiredTemperature : desiredTemp, + SDLRPCParameterNameACEnable : @YES, + SDLRPCParameterNameCirculateAirEnable : @YES, + SDLRPCParameterNameAutoModeEnable : @NO, + SDLRPCParameterNameDefrostZone : SDLDefrostZoneFront, + SDLRPCParameterNameDualModeEnable : @NO, + SDLRPCParameterNameACMaxEnable : @YES, + SDLRPCParameterNameVentilationMode :SDLVentilationModeBoth, + SDLRPCParameterNameHeatedSteeringWheelEnable:@NO, + SDLRPCParameterNameHeatedWindshieldEnable:@YES, + SDLRPCParameterNameHeatedRearWindowEnable:@NO, + SDLRPCParameterNameHeatedMirrorsEnable:@YES, } mutableCopy]; SDLClimateControlData* testStruct = [[SDLClimateControlData alloc] initWithDictionary:dict]; diff --git a/SmartDeviceLinkTests/RPCSpecs/StructSpecs/SDLClusterModeStatusSpec.m b/SmartDeviceLinkTests/RPCSpecs/StructSpecs/SDLClusterModeStatusSpec.m index f61afe79e..fcafcde1b 100644 --- a/SmartDeviceLinkTests/RPCSpecs/StructSpecs/SDLClusterModeStatusSpec.m +++ b/SmartDeviceLinkTests/RPCSpecs/StructSpecs/SDLClusterModeStatusSpec.m @@ -12,7 +12,7 @@ #import "SDLClusterModeStatus.h" #import "SDLPowerModeQualificationStatus.h" #import "SDLPowerModeStatus.h" -#import "SDLNames.h" +#import "SDLRPCParameterNames.h" QuickSpecBegin(SDLClusterModeStatusSpec) @@ -32,10 +32,10 @@ describe(@"Getter/Setter Tests", ^ { }); it(@"Should get correctly when initialized", ^ { - NSMutableDictionary* dict = [@{SDLNamePowerModeActive:@NO, - SDLNamePowerModeQualificationStatus:SDLPowerModeQualificationStatusOk, - SDLNameCarModeStatus:SDLCarModeStatusCrash, - SDLNamePowerModeStatus:SDLPowerModeStatusKeyOut} mutableCopy]; + NSMutableDictionary* dict = [@{SDLRPCParameterNamePowerModeActive:@NO, + SDLRPCParameterNamePowerModeQualificationStatus:SDLPowerModeQualificationStatusOk, + SDLRPCParameterNameCarModeStatus:SDLCarModeStatusCrash, + SDLRPCParameterNamePowerModeStatus:SDLPowerModeStatusKeyOut} mutableCopy]; SDLClusterModeStatus* testStruct = [[SDLClusterModeStatus alloc] initWithDictionary:dict]; expect(testStruct.powerModeActive).to(equal(@NO)); diff --git a/SmartDeviceLinkTests/RPCSpecs/StructSpecs/SDLDIDResult.m b/SmartDeviceLinkTests/RPCSpecs/StructSpecs/SDLDIDResult.m index d0715bded..263793455 100644 --- a/SmartDeviceLinkTests/RPCSpecs/StructSpecs/SDLDIDResult.m +++ b/SmartDeviceLinkTests/RPCSpecs/StructSpecs/SDLDIDResult.m @@ -9,7 +9,7 @@ #import <Nimble/Nimble.h> #import "SDLDIDResult.h" -#import "SDLNames.h" +#import "SDLRPCParameterNames.h" #import "SDLVehicleDataResultCode.h" @@ -29,9 +29,9 @@ describe(@"Getter/Setter Tests", ^ { }); it(@"Should get correctly when initialized", ^ { - NSMutableDictionary* dict = [@{SDLNameResultCode:SDLVehicleDataResultCodeDataNotSubscribed, - SDLNameDIDLocation:@300, - SDLNameData:@"gertwydhty4235tdhedt4tue"} mutableCopy]; + NSMutableDictionary* dict = [@{SDLRPCParameterNameResultCode:SDLVehicleDataResultCodeDataNotSubscribed, + SDLRPCParameterNameDIDLocation:@300, + SDLRPCParameterNameData:@"gertwydhty4235tdhedt4tue"} mutableCopy]; SDLDIDResult* testStruct = [[SDLDIDResult alloc] initWithDictionary:dict]; expect(testStruct.resultCode).to(equal(SDLVehicleDataResultCodeDataNotSubscribed)); diff --git a/SmartDeviceLinkTests/RPCSpecs/StructSpecs/SDLDateTimeSpec.m b/SmartDeviceLinkTests/RPCSpecs/StructSpecs/SDLDateTimeSpec.m index c152ad461..5f4091d0f 100644 --- a/SmartDeviceLinkTests/RPCSpecs/StructSpecs/SDLDateTimeSpec.m +++ b/SmartDeviceLinkTests/RPCSpecs/StructSpecs/SDLDateTimeSpec.m @@ -12,7 +12,7 @@ #import <Nimble/Nimble.h> #import "SDLDateTime.h" -#import "SDLNames.h" +#import "SDLRPCParameterNames.h" QuickSpecBegin(SDLDateTimeSpec) @@ -42,15 +42,15 @@ describe(@"Getter/Setter Tests", ^ { }); it(@"Should get correctly when initialized with dictionary", ^{ - NSMutableDictionary* dict = [@{SDLNameMillisecond:@100, - SDLNameSecond:@4, - SDLNameMinute:@12, - SDLNameHour:@20, - SDLNameDay:@30, - SDLNameMonth:@1, - SDLNameYear:@4000, - SDLNameTimezoneMinuteOffset:@0, - SDLNameTimezoneHourOffset:@1000} mutableCopy]; + NSMutableDictionary* dict = [@{SDLRPCParameterNameMillisecond:@100, + SDLRPCParameterNameSecond:@4, + SDLRPCParameterNameMinute:@12, + SDLRPCParameterNameHour:@20, + SDLRPCParameterNameDay:@30, + SDLRPCParameterNameMonth:@1, + SDLRPCParameterNameYear:@4000, + SDLRPCParameterNameTimezoneMinuteOffset:@0, + SDLRPCParameterNameTimezoneHourOffset:@1000} mutableCopy]; SDLDateTime* testStruct = [[SDLDateTime alloc] initWithDictionary:dict]; expect(testStruct.millisecond).to(equal(@100)); diff --git a/SmartDeviceLinkTests/RPCSpecs/StructSpecs/SDLDeviceInfoSpec.m b/SmartDeviceLinkTests/RPCSpecs/StructSpecs/SDLDeviceInfoSpec.m index 3108257f4..d1fcc5b55 100644 --- a/SmartDeviceLinkTests/RPCSpecs/StructSpecs/SDLDeviceInfoSpec.m +++ b/SmartDeviceLinkTests/RPCSpecs/StructSpecs/SDLDeviceInfoSpec.m @@ -9,7 +9,7 @@ #import <Nimble/Nimble.h> #import "SDLDeviceInfo.h" -#import "SDLNames.h" +#import "SDLRPCParameterNames.h" QuickSpecBegin(SDLDeviceInfoSpec) @@ -33,12 +33,12 @@ describe(@"Getter/Setter Tests", ^ { }); it(@"Should get correctly when initialized", ^ { - NSMutableDictionary<NSString *, id> *dict = [@{SDLNameHardware:@"GDFR34F", - SDLNameFirmwareRevision:@"4.2a", - SDLNameOS:@"Robot", - SDLNameOSVersion:@"9.9", - SDLNameCarrier:@"ThatOneWirelessCompany", - SDLNameMaxNumberRFCOMMPorts:@20} mutableCopy]; + NSMutableDictionary<NSString *, id> *dict = [@{SDLRPCParameterNameHardware:@"GDFR34F", + SDLRPCParameterNameFirmwareRevision:@"4.2a", + SDLRPCParameterNameOS:@"Robot", + SDLRPCParameterNameOSVersion:@"9.9", + SDLRPCParameterNameCarrier:@"ThatOneWirelessCompany", + SDLRPCParameterNameMaxNumberRFCOMMPorts:@20} mutableCopy]; SDLDeviceInfo* testStruct = [[SDLDeviceInfo alloc] initWithDictionary:dict]; expect(testStruct.hardware).to(equal(@"GDFR34F")); diff --git a/SmartDeviceLinkTests/RPCSpecs/StructSpecs/SDLDeviceStatusSpec.m b/SmartDeviceLinkTests/RPCSpecs/StructSpecs/SDLDeviceStatusSpec.m index eb56a11a0..847c7b95c 100644 --- a/SmartDeviceLinkTests/RPCSpecs/StructSpecs/SDLDeviceStatusSpec.m +++ b/SmartDeviceLinkTests/RPCSpecs/StructSpecs/SDLDeviceStatusSpec.m @@ -10,7 +10,7 @@ #import "SDLDeviceLevelStatus.h" #import "SDLDeviceStatus.h" -#import "SDLNames.h" +#import "SDLRPCParameterNames.h" #import "SDLPrimaryAudioSource.h" @@ -46,17 +46,17 @@ describe(@"Getter/Setter Tests", ^ { }); it(@"Should get correctly when initialized", ^ { - NSMutableDictionary* dict = [@{SDLNameVoiceRecognitionOn:@NO, - SDLNameBluetoothIconOn:@NO, - SDLNameCallActive:@YES, - SDLNamePhoneRoaming:@NO, - SDLNameTextMessageAvailable:@YES, - SDLNameBatteryLevelStatus:SDLDeviceLevelStatusFourBars, - SDLNameStereoAudioOutputMuted:@YES, - SDLNameMonoAudioOutputMuted:@YES, - SDLNameSignalLevelStatus:SDLDeviceLevelStatusTwoBars, - SDLNamePrimaryAudioSource:SDLPrimaryAudioSourceBluetoothStereo, - SDLNameECallEventActive:@NO} mutableCopy]; + NSMutableDictionary* dict = [@{SDLRPCParameterNameVoiceRecognitionOn:@NO, + SDLRPCParameterNameBluetoothIconOn:@NO, + SDLRPCParameterNameCallActive:@YES, + SDLRPCParameterNamePhoneRoaming:@NO, + SDLRPCParameterNameTextMessageAvailable:@YES, + SDLRPCParameterNameBatteryLevelStatus:SDLDeviceLevelStatusFourBars, + SDLRPCParameterNameStereoAudioOutputMuted:@YES, + SDLRPCParameterNameMonoAudioOutputMuted:@YES, + SDLRPCParameterNameSignalLevelStatus:SDLDeviceLevelStatusTwoBars, + SDLRPCParameterNamePrimaryAudioSource:SDLPrimaryAudioSourceBluetoothStereo, + SDLRPCParameterNameECallEventActive:@NO} mutableCopy]; SDLDeviceStatus* testStruct = [[SDLDeviceStatus alloc] initWithDictionary:dict]; expect(testStruct.voiceRecOn).to(equal(@NO)); diff --git a/SmartDeviceLinkTests/RPCSpecs/StructSpecs/SDLDisplayCapabilitiesSpec.m b/SmartDeviceLinkTests/RPCSpecs/StructSpecs/SDLDisplayCapabilitiesSpec.m index 6c68a3e26..ab19ae425 100644 --- a/SmartDeviceLinkTests/RPCSpecs/StructSpecs/SDLDisplayCapabilitiesSpec.m +++ b/SmartDeviceLinkTests/RPCSpecs/StructSpecs/SDLDisplayCapabilitiesSpec.m @@ -12,7 +12,7 @@ #import "SDLDisplayType.h" #import "SDLImageField.h" #import "SDLMediaClockFormat.h" -#import "SDLNames.h" +#import "SDLRPCParameterNames.h" #import "SDLScreenParams.h" #import "SDLTextField.h" @@ -52,15 +52,15 @@ describe(@"Getter/Setter Tests", ^ { }); it(@"Should get correctly when initialized", ^ { - NSMutableDictionary* dict = [@{SDLNameDisplayType:SDLDisplayTypeGen26DMA, - SDLNameDisplayName: @"test", - SDLNameTextFields:[@[textField] mutableCopy], - SDLNameImageFields:[@[imageField] mutableCopy], - SDLNameMediaClockFormats:[@[SDLMediaClockFormatClockText1, SDLMediaClockFormatClock3, SDLMediaClockFormatClockText3] copy], - SDLNameGraphicSupported:@YES, - SDLNameTemplatesAvailable:[@[@"String", @"String", @"String"] mutableCopy], - SDLNameScreenParams:screenParams, - SDLNameNumberCustomPresetsAvailable:@43} mutableCopy]; + NSMutableDictionary* dict = [@{SDLRPCParameterNameDisplayType:SDLDisplayTypeGen26DMA, + SDLRPCParameterNameDisplayName: @"test", + SDLRPCParameterNameTextFields:[@[textField] mutableCopy], + SDLRPCParameterNameImageFields:[@[imageField] mutableCopy], + SDLRPCParameterNameMediaClockFormats:[@[SDLMediaClockFormatClockText1, SDLMediaClockFormatClock3, SDLMediaClockFormatClockText3] copy], + SDLRPCParameterNameGraphicSupported:@YES, + SDLRPCParameterNameTemplatesAvailable:[@[@"String", @"String", @"String"] mutableCopy], + SDLRPCParameterNameScreenParams:screenParams, + SDLRPCParameterNameNumberCustomPresetsAvailable:@43} mutableCopy]; SDLDisplayCapabilities* testStruct = [[SDLDisplayCapabilities alloc] initWithDictionary:dict]; expect(testStruct.displayType).to(equal(SDLDisplayTypeGen26DMA)); diff --git a/SmartDeviceLinkTests/RPCSpecs/StructSpecs/SDLECallInfoSpec.m b/SmartDeviceLinkTests/RPCSpecs/StructSpecs/SDLECallInfoSpec.m index c69c46b84..d7229bdbc 100644 --- a/SmartDeviceLinkTests/RPCSpecs/StructSpecs/SDLECallInfoSpec.m +++ b/SmartDeviceLinkTests/RPCSpecs/StructSpecs/SDLECallInfoSpec.m @@ -11,7 +11,7 @@ #import "SDLVehicleDataNotificationStatus.h" #import "SDLECallConfirmationStatus.h" #import "SDLECallInfo.h" -#import "SDLNames.h" +#import "SDLRPCParameterNames.h" QuickSpecBegin(SDLECallInfoSpec) @@ -30,9 +30,9 @@ describe(@"Getter/Setter Tests", ^ { }); it(@"Should get correctly when initialized", ^ { - NSMutableDictionary* dict = [@{SDLNameECallNotificationStatus:SDLVehicleDataNotificationStatusNormal, - SDLNameAuxECallNotificationStatus:SDLVehicleDataNotificationStatusActive, - SDLNameECallConfirmationStatus:SDLECallConfirmationStatusInProgress} mutableCopy]; + NSMutableDictionary* dict = [@{SDLRPCParameterNameECallNotificationStatus:SDLVehicleDataNotificationStatusNormal, + SDLRPCParameterNameAuxECallNotificationStatus:SDLVehicleDataNotificationStatusActive, + SDLRPCParameterNameECallConfirmationStatus:SDLECallConfirmationStatusInProgress} mutableCopy]; SDLECallInfo* testStruct = [[SDLECallInfo alloc] initWithDictionary:dict]; expect(testStruct.eCallNotificationStatus).to(equal(SDLVehicleDataNotificationStatusNormal)); diff --git a/SmartDeviceLinkTests/RPCSpecs/StructSpecs/SDLEmergencyEventSpec.m b/SmartDeviceLinkTests/RPCSpecs/StructSpecs/SDLEmergencyEventSpec.m index 0048ffdff..3ac05c2e5 100644 --- a/SmartDeviceLinkTests/RPCSpecs/StructSpecs/SDLEmergencyEventSpec.m +++ b/SmartDeviceLinkTests/RPCSpecs/StructSpecs/SDLEmergencyEventSpec.m @@ -11,7 +11,7 @@ #import "SDLEmergencyEvent.h" #import "SDLEmergencyEventType.h" #import "SDLFuelCutoffStatus.h" -#import "SDLNames.h" +#import "SDLRPCParameterNames.h" #import "SDLVehicleDataEventStatus.h" @@ -35,11 +35,11 @@ describe(@"Getter/Setter Tests", ^ { }); it(@"Should get correctly when initialized", ^ { - NSMutableDictionary* dict = [@{SDLNameEmergencyEventType:SDLEmergencyEventTypeFrontal, - SDLNameFuelCutoffStatus:SDLFuelCutoffStatusNormalOperation, - SDLNameRolloverEvent:SDLVehicleDataEventStatusYes, - SDLNameMaximumChangeVelocity:@33, - SDLNameMultipleEvents:SDLVehicleDataEventStatusNo} mutableCopy]; + NSMutableDictionary* dict = [@{SDLRPCParameterNameEmergencyEventType:SDLEmergencyEventTypeFrontal, + SDLRPCParameterNameFuelCutoffStatus:SDLFuelCutoffStatusNormalOperation, + SDLRPCParameterNameRolloverEvent:SDLVehicleDataEventStatusYes, + SDLRPCParameterNameMaximumChangeVelocity:@33, + SDLRPCParameterNameMultipleEvents:SDLVehicleDataEventStatusNo} mutableCopy]; SDLEmergencyEvent* testStruct = [[SDLEmergencyEvent alloc] initWithDictionary:dict]; expect(testStruct.emergencyEventType).to(equal(SDLEmergencyEventTypeFrontal)); diff --git a/SmartDeviceLinkTests/RPCSpecs/StructSpecs/SDLEqualizerSettingsSpec.m b/SmartDeviceLinkTests/RPCSpecs/StructSpecs/SDLEqualizerSettingsSpec.m index cd5dfe3b1..599a36b1c 100644 --- a/SmartDeviceLinkTests/RPCSpecs/StructSpecs/SDLEqualizerSettingsSpec.m +++ b/SmartDeviceLinkTests/RPCSpecs/StructSpecs/SDLEqualizerSettingsSpec.m @@ -8,7 +8,7 @@ #import <Nimble/Nimble.h> #import "SDLEqualizerSettings.h" -#import "SDLNames.h" +#import "SDLRPCParameterNames.h" QuickSpecBegin(SDLEqualizerSettingsSpec) @@ -35,9 +35,9 @@ describe(@"Getter/Setter Tests", ^ { }); it(@"Should get correctly when initialized", ^ { - NSMutableDictionary* dict = [@{SDLNameChannelId:@2, - SDLNameChannelName:@"channel", - SDLNameChannelSetting:@45 + NSMutableDictionary* dict = [@{SDLRPCParameterNameChannelId:@2, + SDLRPCParameterNameChannelName:@"channel", + SDLRPCParameterNameChannelSetting:@45 } mutableCopy]; SDLEqualizerSettings* testStruct = [[SDLEqualizerSettings alloc] initWithDictionary:dict]; diff --git a/SmartDeviceLinkTests/RPCSpecs/StructSpecs/SDLFuelRangeSpec.m b/SmartDeviceLinkTests/RPCSpecs/StructSpecs/SDLFuelRangeSpec.m index f812613da..8461f67a9 100644 --- a/SmartDeviceLinkTests/RPCSpecs/StructSpecs/SDLFuelRangeSpec.m +++ b/SmartDeviceLinkTests/RPCSpecs/StructSpecs/SDLFuelRangeSpec.m @@ -12,7 +12,7 @@ #import <Nimble/Nimble.h> #import "SDLFuelRange.h" -#import "SDLNames.h" +#import "SDLRPCParameterNames.h" QuickSpecBegin(SDLFuelRangeSpec) @@ -28,8 +28,8 @@ describe(@"Getter/Setter Tests", ^ { }); it(@"Should get correctly when initialized", ^ { - NSDictionary *dict = @{SDLNameType:SDLFuelTypeLPG, - SDLNameRange:@23 + NSDictionary *dict = @{SDLRPCParameterNameType:SDLFuelTypeLPG, + SDLRPCParameterNameRange:@23 }; SDLFuelRange *testStruct = [[SDLFuelRange alloc] initWithDictionary:dict]; diff --git a/SmartDeviceLinkTests/RPCSpecs/StructSpecs/SDLGPSDataSpec.m b/SmartDeviceLinkTests/RPCSpecs/StructSpecs/SDLGPSDataSpec.m index 35cc2b659..9251e315f 100644 --- a/SmartDeviceLinkTests/RPCSpecs/StructSpecs/SDLGPSDataSpec.m +++ b/SmartDeviceLinkTests/RPCSpecs/StructSpecs/SDLGPSDataSpec.m @@ -11,7 +11,7 @@ #import "SDLCompassDirection.h" #import "SDLDimension.h" #import "SDLGPSData.h" -#import "SDLNames.h" +#import "SDLRPCParameterNames.h" QuickSpecBegin(SDLGPSDataSpec) @@ -60,24 +60,24 @@ describe(@"Getter/Setter Tests", ^ { }); it(@"Should get correctly when initialized", ^ { - NSMutableDictionary* dict = [@{SDLNameLongitudeDegrees:@31.41592653589793, - SDLNameLatitudeDegrees:@45, - SDLNameUTCYear:@2015, - SDLNameUTCMonth:@1, - SDLNameUTCDay:@26, - SDLNameUTCHours:@23, - SDLNameUTCMinutes:@59, - SDLNameUTCSeconds:@59, - SDLNameCompassDirection:SDLCompassDirectionSoutheast, - SDLNamePDOP:@3.4, - SDLNameHDOP:@9.9, - SDLNameVDOP:@0, - SDLNameActual:@NO, - SDLNameSatellites:@12, - SDLNameDimension:SDLDimension3D, - SDLNameAltitude:@3000, - SDLNameHeading:@96, - SDLNameSpeed:@64} mutableCopy]; + NSMutableDictionary* dict = [@{SDLRPCParameterNameLongitudeDegrees:@31.41592653589793, + SDLRPCParameterNameLatitudeDegrees:@45, + SDLRPCParameterNameUTCYear:@2015, + SDLRPCParameterNameUTCMonth:@1, + SDLRPCParameterNameUTCDay:@26, + SDLRPCParameterNameUTCHours:@23, + SDLRPCParameterNameUTCMinutes:@59, + SDLRPCParameterNameUTCSeconds:@59, + SDLRPCParameterNameCompassDirection:SDLCompassDirectionSoutheast, + SDLRPCParameterNamePDOP:@3.4, + SDLRPCParameterNameHDOP:@9.9, + SDLRPCParameterNameVDOP:@0, + SDLRPCParameterNameActual:@NO, + SDLRPCParameterNameSatellites:@12, + SDLRPCParameterNameDimension:SDLDimension3D, + SDLRPCParameterNameAltitude:@3000, + SDLRPCParameterNameHeading:@96, + SDLRPCParameterNameSpeed:@64} mutableCopy]; SDLGPSData* testStruct = [[SDLGPSData alloc] initWithDictionary:dict]; expect(testStruct.longitudeDegrees).to(equal(@31.41592653589793)); diff --git a/SmartDeviceLinkTests/RPCSpecs/StructSpecs/SDLHMICapabilitiesSpec.m b/SmartDeviceLinkTests/RPCSpecs/StructSpecs/SDLHMICapabilitiesSpec.m index 72cc3df64..c47c4ce24 100644 --- a/SmartDeviceLinkTests/RPCSpecs/StructSpecs/SDLHMICapabilitiesSpec.m +++ b/SmartDeviceLinkTests/RPCSpecs/StructSpecs/SDLHMICapabilitiesSpec.m @@ -7,7 +7,7 @@ #import <Nimble/Nimble.h> #import "SDLHMICapabilities.h" -#import "SDLNames.h" +#import "SDLRPCParameterNames.h" QuickSpecBegin(SDLHMICapabilitiesSpec) @@ -42,9 +42,9 @@ describe(@"SDLHMICapabilities struct", ^{ context(@"When initialized with a dictionary", ^{ beforeEach(^{ NSDictionary<NSString *, NSNumber *> *structInitDict = @{ - SDLNameNavigation: someNavigationState, - SDLNamePhoneCall: somePhoneCallState, - SDLNameVideoStreaming: someVideoStreamState + SDLRPCParameterNameNavigation: someNavigationState, + SDLRPCParameterNamePhoneCall: somePhoneCallState, + SDLRPCParameterNameVideoStreaming: someVideoStreamState }; testStruct = [[SDLHMICapabilities alloc] initWithDictionary:[structInitDict mutableCopy]]; }); diff --git a/SmartDeviceLinkTests/RPCSpecs/StructSpecs/SDLHMIPermissionsSpec.m b/SmartDeviceLinkTests/RPCSpecs/StructSpecs/SDLHMIPermissionsSpec.m index aed9830d4..9b677e6ee 100644 --- a/SmartDeviceLinkTests/RPCSpecs/StructSpecs/SDLHMIPermissionsSpec.m +++ b/SmartDeviceLinkTests/RPCSpecs/StructSpecs/SDLHMIPermissionsSpec.m @@ -10,7 +10,7 @@ #import "SDLHMIPermissions.h" #import "SDLHMILevel.h" -#import "SDLNames.h" +#import "SDLRPCParameterNames.h" QuickSpecBegin(SDLHMIPermissionsSpec) @@ -26,8 +26,8 @@ describe(@"Getter/Setter Tests", ^ { }); it(@"Should get correctly when initialized", ^ { - NSMutableDictionary* dict = [@{SDLNameAllowed:[@[SDLHMILevelBackground, SDLHMILevelFull] copy], - SDLNameUserDisallowed:[@[SDLHMILevelNone, SDLHMILevelLimited] copy]} mutableCopy]; + NSMutableDictionary* dict = [@{SDLRPCParameterNameAllowed:[@[SDLHMILevelBackground, SDLHMILevelFull] copy], + SDLRPCParameterNameUserDisallowed:[@[SDLHMILevelNone, SDLHMILevelLimited] copy]} mutableCopy]; SDLHMIPermissions* testStruct = [[SDLHMIPermissions alloc] initWithDictionary:dict]; expect(testStruct.allowed).to(equal([@[SDLHMILevelBackground, SDLHMILevelFull] copy])); diff --git a/SmartDeviceLinkTests/RPCSpecs/StructSpecs/SDLHMISettingsControlCapabilitiesSpec.m b/SmartDeviceLinkTests/RPCSpecs/StructSpecs/SDLHMISettingsControlCapabilitiesSpec.m index f9b60810d..7bc085453 100644 --- a/SmartDeviceLinkTests/RPCSpecs/StructSpecs/SDLHMISettingsControlCapabilitiesSpec.m +++ b/SmartDeviceLinkTests/RPCSpecs/StructSpecs/SDLHMISettingsControlCapabilitiesSpec.m @@ -9,7 +9,7 @@ #import <Nimble/Nimble.h> #import "SDLHMISettingsControlCapabilities.h" -#import "SDLNames.h" +#import "SDLRPCParameterNames.h" QuickSpecBegin(SDLHMISettingsControlCapabilitiesSpec) @@ -48,10 +48,10 @@ describe(@"Getter/Setter Tests", ^ { }); it(@"Should get correctly when initialized", ^ { - NSMutableDictionary* dict = [@{SDLNameModuleName:@"temperatureUnit", - SDLNameTemperatureUnitAvailable:@(YES), - SDLNameDistanceUnitAvailable:@(YES), - SDLNameDisplayModeUnitAvailable:@(NO) + NSMutableDictionary* dict = [@{SDLRPCParameterNameModuleName:@"temperatureUnit", + SDLRPCParameterNameTemperatureUnitAvailable:@(YES), + SDLRPCParameterNameDistanceUnitAvailable:@(YES), + SDLRPCParameterNameDisplayModeUnitAvailable:@(NO) } mutableCopy]; SDLHMISettingsControlCapabilities* testStruct = [[SDLHMISettingsControlCapabilities alloc] initWithDictionary:dict]; diff --git a/SmartDeviceLinkTests/RPCSpecs/StructSpecs/SDLHMISettingsControlDataSpec.m b/SmartDeviceLinkTests/RPCSpecs/StructSpecs/SDLHMISettingsControlDataSpec.m index f2a1cd399..59f730476 100644 --- a/SmartDeviceLinkTests/RPCSpecs/StructSpecs/SDLHMISettingsControlDataSpec.m +++ b/SmartDeviceLinkTests/RPCSpecs/StructSpecs/SDLHMISettingsControlDataSpec.m @@ -7,7 +7,7 @@ #import <Nimble/Nimble.h> #import "SDLHMISettingsControlData.h" -#import "SDLNames.h" +#import "SDLRPCParameterNames.h" QuickSpecBegin(SDLHMISettingsControlDataSpec) @@ -34,9 +34,9 @@ describe(@"Getter/Setter Tests", ^ { }); it(@"Should get correctly when initialized", ^ { - NSMutableDictionary* dict = [@{SDLNameDisplayMode:SDLDisplayModeAuto, - SDLNameTemperatureUnit:SDLTemperatureUnitCelsius, - SDLNameDistanceUnit:SDLDistanceUnitKilometers} mutableCopy]; + NSMutableDictionary* dict = [@{SDLRPCParameterNameDisplayMode:SDLDisplayModeAuto, + SDLRPCParameterNameTemperatureUnit:SDLTemperatureUnitCelsius, + SDLRPCParameterNameDistanceUnit:SDLDistanceUnitKilometers} mutableCopy]; SDLHMISettingsControlData* testStruct = [[SDLHMISettingsControlData alloc] initWithDictionary:dict]; expect(testStruct.displayMode).to(equal(SDLDisplayModeAuto)); diff --git a/SmartDeviceLinkTests/RPCSpecs/StructSpecs/SDLHapticRectSpec.m b/SmartDeviceLinkTests/RPCSpecs/StructSpecs/SDLHapticRectSpec.m index 6235ea62f..b5ea6b725 100644 --- a/SmartDeviceLinkTests/RPCSpecs/StructSpecs/SDLHapticRectSpec.m +++ b/SmartDeviceLinkTests/RPCSpecs/StructSpecs/SDLHapticRectSpec.m @@ -11,7 +11,7 @@ #import <Quick/Quick.h> #import <Nimble/Nimble.h> -#import "SDLNames.h" +#import "SDLRPCParameterNames.h" #import "SDLHapticRect.h" #import "SDLRectangle.h" @@ -41,12 +41,12 @@ describe(@"Getter/Setter Tests", ^{ }); it(@"Should get correctly when initialized with a dict", ^{ - NSMutableDictionary *dict = [@{SDLNameId:@2, - SDLNameRect: @{ - SDLNameX:@20, - SDLNameY:@200, - SDLNameWidth:@2000, - SDLNameHeight:@3000 + NSMutableDictionary *dict = [@{SDLRPCParameterNameId:@2, + SDLRPCParameterNameRect: @{ + SDLRPCParameterNameX:@20, + SDLRPCParameterNameY:@200, + SDLRPCParameterNameWidth:@2000, + SDLRPCParameterNameHeight:@3000 } } mutableCopy]; SDLHapticRect *testStruct = [[SDLHapticRect alloc] initWithDictionary:dict]; diff --git a/SmartDeviceLinkTests/RPCSpecs/StructSpecs/SDLHeadLampStatusSpec.m b/SmartDeviceLinkTests/RPCSpecs/StructSpecs/SDLHeadLampStatusSpec.m index fe7a21198..201ce6bce 100644 --- a/SmartDeviceLinkTests/RPCSpecs/StructSpecs/SDLHeadLampStatusSpec.m +++ b/SmartDeviceLinkTests/RPCSpecs/StructSpecs/SDLHeadLampStatusSpec.m @@ -10,7 +10,7 @@ #import "SDLAmbientLightStatus.h" #import "SDLHeadLampStatus.h" -#import "SDLNames.h" +#import "SDLRPCParameterNames.h" QuickSpecBegin(SDLHeadLampStatusSpec) @@ -29,9 +29,9 @@ describe(@"Getter/Setter Tests", ^ { }); it(@"Should get correctly when initialized", ^ { - NSMutableDictionary* dict = [@{SDLNameLowBeamsOn:@YES, - SDLNameHighBeamsOn:@NO, - SDLNameAmbientLightSensorStatus:SDLAmbientLightStatusTwilight3} mutableCopy]; + NSMutableDictionary* dict = [@{SDLRPCParameterNameLowBeamsOn:@YES, + SDLRPCParameterNameHighBeamsOn:@NO, + SDLRPCParameterNameAmbientLightSensorStatus:SDLAmbientLightStatusTwilight3} mutableCopy]; SDLHeadLampStatus* testStruct = [[SDLHeadLampStatus alloc] initWithDictionary:dict]; expect(testStruct.lowBeamsOn).to(equal(@YES)); diff --git a/SmartDeviceLinkTests/RPCSpecs/StructSpecs/SDLImageFieldSpec.m b/SmartDeviceLinkTests/RPCSpecs/StructSpecs/SDLImageFieldSpec.m index b40371a4d..3850163be 100644 --- a/SmartDeviceLinkTests/RPCSpecs/StructSpecs/SDLImageFieldSpec.m +++ b/SmartDeviceLinkTests/RPCSpecs/StructSpecs/SDLImageFieldSpec.m @@ -12,7 +12,7 @@ #import "SDLImageField.h" #import "SDLImageFieldName.h" #import "SDLImageResolution.h" -#import "SDLNames.h" +#import "SDLRPCParameterNames.h" QuickSpecBegin(SDLImageFieldSpec) @@ -33,9 +33,9 @@ describe(@"Getter/Setter Tests", ^ { }); it(@"Should get correctly when initialized", ^ { - NSMutableDictionary* dict = [@{SDLNameName:SDLImageFieldNameTurnIcon, - SDLNameImageTypeSupported:[@[SDLFileTypePNG, SDLFileTypeJPEG] copy], - SDLNameImageResolution:resolution} mutableCopy]; + NSMutableDictionary* dict = [@{SDLRPCParameterNameName:SDLImageFieldNameTurnIcon, + SDLRPCParameterNameImageTypeSupported:[@[SDLFileTypePNG, SDLFileTypeJPEG] copy], + SDLRPCParameterNameImageResolution:resolution} mutableCopy]; SDLImageField* testStruct = [[SDLImageField alloc] initWithDictionary:dict]; expect(testStruct.name).to(equal(SDLImageFieldNameTurnIcon)); diff --git a/SmartDeviceLinkTests/RPCSpecs/StructSpecs/SDLImageResolutionSpec.m b/SmartDeviceLinkTests/RPCSpecs/StructSpecs/SDLImageResolutionSpec.m index c56008516..8bacdab56 100644 --- a/SmartDeviceLinkTests/RPCSpecs/StructSpecs/SDLImageResolutionSpec.m +++ b/SmartDeviceLinkTests/RPCSpecs/StructSpecs/SDLImageResolutionSpec.m @@ -2,7 +2,7 @@ #import <Nimble/Nimble.h> #import "SDLImageResolution.h" -#import "SDLNames.h" +#import "SDLRPCParameterNames.h" QuickSpecBegin(SDLImageResolutionSpec) @@ -25,8 +25,8 @@ describe(@"Getter/Setter Tests", ^ { }); it(@"Should get correctly when initialized", ^ { - NSDictionary *dict = @{SDLNameResolutionHeight:@69, - SDLNameResolutionWidth:@869, + NSDictionary *dict = @{SDLRPCParameterNameResolutionHeight:@69, + SDLRPCParameterNameResolutionWidth:@869, }; SDLImageResolution *testStruct = [[SDLImageResolution alloc] initWithDictionary:dict]; diff --git a/SmartDeviceLinkTests/RPCSpecs/StructSpecs/SDLImageSpec.m b/SmartDeviceLinkTests/RPCSpecs/StructSpecs/SDLImageSpec.m index a88619d1b..62335c659 100644 --- a/SmartDeviceLinkTests/RPCSpecs/StructSpecs/SDLImageSpec.m +++ b/SmartDeviceLinkTests/RPCSpecs/StructSpecs/SDLImageSpec.m @@ -10,7 +10,7 @@ #import "SDLImage.h" #import "SDLImageType.h" -#import "SDLNames.h" +#import "SDLRPCParameterNames.h" QuickSpecBegin(SDLImageSpec) @@ -47,9 +47,9 @@ describe(@"Getter/Setter Tests", ^{ NSString *value = @"value"; SDLImageType imageType = SDLImageTypeStatic; - NSDictionary* dict = [@{SDLNameValue:value, - SDLNameImageType:imageType, - SDLNameImageTemplate:@YES + NSDictionary* dict = [@{SDLRPCParameterNameValue:value, + SDLRPCParameterNameImageType:imageType, + SDLRPCParameterNameImageTemplate:@YES } mutableCopy]; testSDLImage = [[SDLImage alloc] initWithDictionary:dict]; diff --git a/SmartDeviceLinkTests/RPCSpecs/StructSpecs/SDLKeyboardPropertiesSpec.m b/SmartDeviceLinkTests/RPCSpecs/StructSpecs/SDLKeyboardPropertiesSpec.m index 4a8dc21bb..a615413fa 100644 --- a/SmartDeviceLinkTests/RPCSpecs/StructSpecs/SDLKeyboardPropertiesSpec.m +++ b/SmartDeviceLinkTests/RPCSpecs/StructSpecs/SDLKeyboardPropertiesSpec.m @@ -12,7 +12,7 @@ #import "SDLKeypressMode.h" #import "SDLKeyboardProperties.h" #import "SDLLanguage.h" -#import "SDLNames.h" +#import "SDLRPCParameterNames.h" QuickSpecBegin(SDLKeyboardPropertiesSpec) @@ -35,11 +35,11 @@ describe(@"Getter/Setter Tests", ^ { }); it(@"Should get correctly when initialized", ^ { - NSMutableDictionary* dict = [@{SDLNameLanguage:SDLLanguageDaDk, - SDLNameKeyboardLayout:SDLKeyboardLayoutQWERTZ, - SDLNameKeypressMode:SDLKeypressModeResendCurrentEntry, - SDLNameLimitedCharacterList:[@[@"s", @"r", @"f", @"q"] mutableCopy], - SDLNameAutoCompleteText:@"Auto Carrot"} mutableCopy]; + NSMutableDictionary* dict = [@{SDLRPCParameterNameLanguage:SDLLanguageDaDk, + SDLRPCParameterNameKeyboardLayout:SDLKeyboardLayoutQWERTZ, + SDLRPCParameterNameKeypressMode:SDLKeypressModeResendCurrentEntry, + SDLRPCParameterNameLimitedCharacterList:[@[@"s", @"r", @"f", @"q"] mutableCopy], + SDLRPCParameterNameAutoCompleteText:@"Auto Carrot"} mutableCopy]; SDLKeyboardProperties* testStruct = [[SDLKeyboardProperties alloc] initWithDictionary:dict]; expect(testStruct.language).to(equal(SDLLanguageDaDk)); diff --git a/SmartDeviceLinkTests/RPCSpecs/StructSpecs/SDLLightCapabilitiesSpec.m b/SmartDeviceLinkTests/RPCSpecs/StructSpecs/SDLLightCapabilitiesSpec.m index c3dc54ffa..a5aa62996 100644 --- a/SmartDeviceLinkTests/RPCSpecs/StructSpecs/SDLLightCapabilitiesSpec.m +++ b/SmartDeviceLinkTests/RPCSpecs/StructSpecs/SDLLightCapabilitiesSpec.m @@ -7,7 +7,7 @@ #import <Quick/Quick.h> #import <Nimble/Nimble.h> -#import "SDLNames.h" +#import "SDLRPCParameterNames.h" #import "SDLLightName.h" #import "SDLLightCapabilities.h" @@ -37,9 +37,9 @@ describe(@"Getter/Setter Tests", ^ { }); it(@"Should get correctly when initialized", ^ { - NSMutableDictionary* dict = [@{SDLNameName:SDLLightNameFogLights, - SDLNameDensityAvailable:@YES, - SDLNameRGBColorSpaceAvailable:@NO + NSMutableDictionary* dict = [@{SDLRPCParameterNameName:SDLLightNameFogLights, + SDLRPCParameterNameDensityAvailable:@YES, + SDLRPCParameterNameRGBColorSpaceAvailable:@NO } mutableCopy]; SDLLightCapabilities* testStruct = [[SDLLightCapabilities alloc] initWithDictionary:dict]; diff --git a/SmartDeviceLinkTests/RPCSpecs/StructSpecs/SDLLightControlCapabilitiesSpec.m b/SmartDeviceLinkTests/RPCSpecs/StructSpecs/SDLLightControlCapabilitiesSpec.m index 1bcfad24c..837a6cacd 100644 --- a/SmartDeviceLinkTests/RPCSpecs/StructSpecs/SDLLightControlCapabilitiesSpec.m +++ b/SmartDeviceLinkTests/RPCSpecs/StructSpecs/SDLLightControlCapabilitiesSpec.m @@ -9,7 +9,7 @@ #import <Nimble/Nimble.h> #import "SDLLightControlCapabilities.h" -#import "SDLNames.h" +#import "SDLRPCParameterNames.h" #import "SDLLightCapabilities.h" QuickSpecBegin( SDLLightControlCapabilitiesSpec) @@ -37,8 +37,8 @@ describe(@"Getter/Setter Tests", ^ { }); it(@"Should get correctly when initialized", ^ { - NSMutableDictionary* dict = [@{SDLNameModuleName:@"moduleName", - SDLNameSupportedLights:[@[somelightCapabilities] copy] + NSMutableDictionary* dict = [@{SDLRPCParameterNameModuleName:@"moduleName", + SDLRPCParameterNameSupportedLights:[@[somelightCapabilities] copy] } mutableCopy]; SDLLightControlCapabilities* testStruct = [[SDLLightControlCapabilities alloc] initWithDictionary:dict]; diff --git a/SmartDeviceLinkTests/RPCSpecs/StructSpecs/SDLLightControlDataSpec.m b/SmartDeviceLinkTests/RPCSpecs/StructSpecs/SDLLightControlDataSpec.m index 40f342f05..a882bdf2f 100644 --- a/SmartDeviceLinkTests/RPCSpecs/StructSpecs/SDLLightControlDataSpec.m +++ b/SmartDeviceLinkTests/RPCSpecs/StructSpecs/SDLLightControlDataSpec.m @@ -9,7 +9,7 @@ #import <Nimble/Nimble.h> #import "SDLLightControlData.h" -#import "SDLNames.h" +#import "SDLRPCParameterNames.h" #import "SDLLightState.h" QuickSpecBegin(SDLLightControlDataSpec) @@ -31,7 +31,7 @@ describe(@"Getter/Setter Tests", ^ { }); it(@"Should get correctly when initialized", ^ { - NSMutableDictionary* dict = [@{SDLNameLightState:[@[someLightState] copy]} mutableCopy]; + NSMutableDictionary* dict = [@{SDLRPCParameterNameLightState:[@[someLightState] copy]} mutableCopy]; SDLLightControlData* testStruct = [[SDLLightControlData alloc] initWithDictionary:dict]; diff --git a/SmartDeviceLinkTests/RPCSpecs/StructSpecs/SDLLightStateSpec.m b/SmartDeviceLinkTests/RPCSpecs/StructSpecs/SDLLightStateSpec.m index 3975cb3ed..dc478bb06 100644 --- a/SmartDeviceLinkTests/RPCSpecs/StructSpecs/SDLLightStateSpec.m +++ b/SmartDeviceLinkTests/RPCSpecs/StructSpecs/SDLLightStateSpec.m @@ -11,7 +11,7 @@ #import "SDLLightStatus.h" #import "SDLRGBColor.h" #import "SDLLightName.h" -#import "SDLNames.h" +#import "SDLRPCParameterNames.h" QuickSpecBegin(SDLLightStateSpec) @@ -63,10 +63,10 @@ describe(@"Getter/Setter Tests", ^ { }); it(@"Should get correctly when initialized", ^ { - NSMutableDictionary* dict = [@{SDLNameId:SDLLightNameFogLights, - SDLNameStatus:SDLLightStatusOn, - SDLNameDensity:@(0.5), - SDLNameColor:someRGBColor} mutableCopy]; + NSMutableDictionary* dict = [@{SDLRPCParameterNameId:SDLLightNameFogLights, + SDLRPCParameterNameStatus:SDLLightStatusOn, + SDLRPCParameterNameDensity:@(0.5), + SDLRPCParameterNameColor:someRGBColor} mutableCopy]; SDLLightState* testStruct = [[SDLLightState alloc] initWithDictionary:dict]; diff --git a/SmartDeviceLinkTests/RPCSpecs/StructSpecs/SDLLocationCoordinateSpec.m b/SmartDeviceLinkTests/RPCSpecs/StructSpecs/SDLLocationCoordinateSpec.m index 663eae3fe..011c8f8e4 100644 --- a/SmartDeviceLinkTests/RPCSpecs/StructSpecs/SDLLocationCoordinateSpec.m +++ b/SmartDeviceLinkTests/RPCSpecs/StructSpecs/SDLLocationCoordinateSpec.m @@ -7,7 +7,7 @@ #import <Nimble/Nimble.h> #import "SDLLocationCoordinate.h" -#import "SDLNames.h" +#import "SDLRPCParameterNames.h" QuickSpecBegin(SDLLocationCoordinateSpec) @@ -51,8 +51,8 @@ describe(@"Getter/Setter Tests", ^ { someLongitude = @123.4567; someLatitude = @65.4321; NSDictionary *initDict = @{ - SDLNameLongitudeDegrees: someLongitude, - SDLNameLatitudeDegrees: someLatitude, + SDLRPCParameterNameLongitudeDegrees: someLongitude, + SDLRPCParameterNameLatitudeDegrees: someLatitude, }; testStruct = [[SDLLocationCoordinate alloc] initWithDictionary:[NSMutableDictionary dictionaryWithDictionary:initDict]]; @@ -69,7 +69,18 @@ describe(@"Getter/Setter Tests", ^ { expect(testStruct.latitudeDegrees).to(beIdenticalTo(someLatitude)); }); }); - + + context(@"when init with initWithLatitudeDegrees:longitudeDegrees", ^{ + it(@"should get and set correctly", ^{ + float testLatitude = 34.5; + float testLongitude = 120.345; + SDLLocationCoordinate *testStruct = [[SDLLocationCoordinate alloc] initWithLatitudeDegrees:testLatitude longitudeDegrees:testLongitude]; + + expect(testStruct.latitudeDegrees).to(equal(testLatitude)); + expect(testStruct.longitudeDegrees).to(equal(testLongitude)); + }); + }); + context(@"when parameters are not set", ^{ beforeEach(^{ NSDictionary *initDict = @{ diff --git a/SmartDeviceLinkTests/RPCSpecs/StructSpecs/SDLLocationDetailsSpec.m b/SmartDeviceLinkTests/RPCSpecs/StructSpecs/SDLLocationDetailsSpec.m index de18bb501..5bbdd7f00 100644 --- a/SmartDeviceLinkTests/RPCSpecs/StructSpecs/SDLLocationDetailsSpec.m +++ b/SmartDeviceLinkTests/RPCSpecs/StructSpecs/SDLLocationDetailsSpec.m @@ -10,7 +10,7 @@ #import "SDLImage.h" #import "SDLLocationCoordinate.h" -#import "SDLNames.h" +#import "SDLRPCParameterNames.h" #import "SDLOasisAddress.h" QuickSpecBegin(SDLLocationDetailsSpec) @@ -87,6 +87,51 @@ describe(@"Getter/Setter Tests", ^ { }); }); + + context(@"when initialized with a convenience init", ^{ + __block SDLLocationCoordinate *testCoordinate = nil; + __block NSString *testLocationName = nil; + __block NSArray<NSString *> *testAddressLines = nil; + __block NSString *testLocationDescription = nil; + __block NSString *testPhoneNumber = nil; + __block SDLImage *testLocationImage = nil; + __block SDLOasisAddress *testSearchAddress = nil; + + beforeEach(^{ + testCoordinate = [[SDLLocationCoordinate alloc] init]; + testLocationName = @"testLocationName"; + testAddressLines = @[@"testAddressLines1", @"testAddressLines2"]; + testLocationDescription = @"testLocationDescription"; + testPhoneNumber = @"testPhoneNumber"; + testLocationImage = [[SDLImage alloc] initWithStaticIconName:SDLStaticIconNameKey]; + testSearchAddress = [[SDLOasisAddress alloc] init]; + }); + + it(@"should init correctly with initWithCoordinate:", ^{ + testStruct = [[SDLLocationDetails alloc] initWithCoordinate:testCoordinate]; + + expect(testStruct.coordinate).to(equal(testCoordinate)); + expect(testStruct.locationName).to(beNil()); + expect(testStruct.addressLines).to(beNil()); + expect(testStruct.locationDescription).to(beNil()); + expect(testStruct.phoneNumber).to(beNil()); + expect(testStruct.locationImage).to(beNil()); + expect(testStruct.searchAddress).to(beNil()); + }); + + it(@"should init correctly with all parameters", ^{ + testStruct = [[SDLLocationDetails alloc] initWithCoordinate:testCoordinate locationName:testLocationName addressLines:testAddressLines locationDescription:testLocationDescription phoneNumber:testPhoneNumber locationImage:testLocationImage searchAddress:testSearchAddress]; + + expect(testStruct.coordinate).to(equal(testCoordinate)); + expect(testStruct.locationName).to(equal(testLocationName)); + expect(testStruct.addressLines).to(equal(testAddressLines)); + expect(testStruct.locationDescription).to(equal(testLocationDescription)); + expect(testStruct.phoneNumber).to(equal(testPhoneNumber)); + expect(testStruct.locationImage).to(equal(testLocationImage)); + expect(testStruct.searchAddress).to(equal(testSearchAddress)); + }); + + }); describe(@"when initialized with a dictionary", ^{ context(@"when parameters are set correctly", ^{ @@ -99,13 +144,13 @@ describe(@"Getter/Setter Tests", ^ { someImage = [[SDLImage alloc] init]; someAddress = [[SDLOasisAddress alloc] initWithSubThoroughfare:@"test" thoroughfare:@"1" locality:@"local" administrativeArea:@"admin" postalCode:@"48067" countryCode:@"12345"]; NSDictionary *initDict = @{ - SDLNameLocationCoordinate: someCoordinate, - SDLNameLocationName: someLocation, - SDLNameLocationDescription: someLocationDescription, - SDLNameAddressLines: someAddressLines, - SDLNamePhoneNumber: somePhoneNumber, - SDLNameLocationImage: someImage, - SDLNameSearchAddress: someAddress + SDLRPCParameterNameLocationCoordinate: someCoordinate, + SDLRPCParameterNameLocationName: someLocation, + SDLRPCParameterNameLocationDescription: someLocationDescription, + SDLRPCParameterNameAddressLines: someAddressLines, + SDLRPCParameterNamePhoneNumber: somePhoneNumber, + SDLRPCParameterNameLocationImage: someImage, + SDLRPCParameterNameSearchAddress: someAddress }; testStruct = [[SDLLocationDetails alloc] initWithDictionary:[NSMutableDictionary dictionaryWithDictionary:initDict]]; @@ -151,8 +196,8 @@ describe(@"Getter/Setter Tests", ^ { context(@"when parameters are not set", ^{ beforeEach(^{ NSDictionary *initDict = @{ - SDLNameRequest: @{ - SDLNameParameters: @{} + SDLRPCParameterNameRequest: @{ + SDLRPCParameterNameParameters: @{} } }; diff --git a/SmartDeviceLinkTests/RPCSpecs/StructSpecs/SDLMassageCushionFirmnessSpec.m b/SmartDeviceLinkTests/RPCSpecs/StructSpecs/SDLMassageCushionFirmnessSpec.m index 4fc8f0b43..1bd9b0a83 100644 --- a/SmartDeviceLinkTests/RPCSpecs/StructSpecs/SDLMassageCushionFirmnessSpec.m +++ b/SmartDeviceLinkTests/RPCSpecs/StructSpecs/SDLMassageCushionFirmnessSpec.m @@ -7,7 +7,7 @@ #import <Quick/Quick.h> #import <Nimble/Nimble.h> -#import "SDLNames.h" +#import "SDLRPCParameterNames.h" #import "SDLMassageCushionFirmness.h" QuickSpecBegin(SDLMassageCushionFirmnessSpec) @@ -31,8 +31,8 @@ describe(@"Getter/Setter Tests", ^ { }); it(@"Should get correctly when initialized", ^ { - NSMutableDictionary* dict = [@{SDLNameCushion:SDLMassageCushionSeatBolsters, - SDLNameFirmness:@12 + NSMutableDictionary* dict = [@{SDLRPCParameterNameCushion:SDLMassageCushionSeatBolsters, + SDLRPCParameterNameFirmness:@12 } mutableCopy]; SDLMassageCushionFirmness* testStruct = [[SDLMassageCushionFirmness alloc] initWithDictionary:dict]; diff --git a/SmartDeviceLinkTests/RPCSpecs/StructSpecs/SDLMassageModeDataSpec.m b/SmartDeviceLinkTests/RPCSpecs/StructSpecs/SDLMassageModeDataSpec.m index 6b52a36b2..486049ffe 100644 --- a/SmartDeviceLinkTests/RPCSpecs/StructSpecs/SDLMassageModeDataSpec.m +++ b/SmartDeviceLinkTests/RPCSpecs/StructSpecs/SDLMassageModeDataSpec.m @@ -8,7 +8,7 @@ #import <Quick/Quick.h> #import <Nimble/Nimble.h> -#import "SDLNames.h" +#import "SDLRPCParameterNames.h" #import "SDLMassageModeData.h" QuickSpecBegin(SDLMassageModeDataSpec) @@ -32,8 +32,8 @@ describe(@"Getter/Setter Tests", ^ { }); it(@"Should get correctly when initialized", ^ { - NSMutableDictionary* dict = [@{SDLNameMassageMode:SDLMassageModeLow, - SDLNameMassageZone:SDLMassageZoneLumbar + NSMutableDictionary* dict = [@{SDLRPCParameterNameMassageMode:SDLMassageModeLow, + SDLRPCParameterNameMassageZone:SDLMassageZoneLumbar } mutableCopy]; SDLMassageModeData* testStruct = [[SDLMassageModeData alloc] initWithDictionary:dict]; diff --git a/SmartDeviceLinkTests/RPCSpecs/StructSpecs/SDLMediaServiceDataSpec.m b/SmartDeviceLinkTests/RPCSpecs/StructSpecs/SDLMediaServiceDataSpec.m new file mode 100644 index 000000000..821b7a098 --- /dev/null +++ b/SmartDeviceLinkTests/RPCSpecs/StructSpecs/SDLMediaServiceDataSpec.m @@ -0,0 +1,136 @@ +// +// SDLMediaServiceDataSpec.m +// SmartDeviceLinkTests +// +// Created by Nicole on 2/8/19. +// Copyright © 2019 smartdevicelink. All rights reserved. +// + +#import <Quick/Quick.h> +#import <Nimble/Nimble.h> + +#import "SDLMediaServiceData.h" +#import "SDLMediaType.h" +#import "SDLRPCParameterNames.h" + +QuickSpecBegin(SDLMediaServiceDataSpec) + +describe(@"Getter/Setter Tests", ^{ + __block SDLMediaType testMediaType = nil; + __block NSString *testMediaTitle = nil; + __block NSString *testMediaArtist = nil; + __block NSString *testMediaAlbum = nil; + __block NSString *testPlaylistName = nil; + __block BOOL testIsExplicit = nil; + __block int testTrackPlaybackProgress = 45; + __block int testTrackPlaybackDuration = 3; + __block int testQueuePlaybackProgress = 21; + __block int testQueuePlaybackDuration = 5; + __block int testQueueCurrentTrackNumber = 3; + __block int testQueueTotalTrackCount = 56; + + beforeEach(^{ + testMediaType = SDLMediaTypePodcast; + testMediaTitle = @"testMediaTitle"; + testMediaArtist = @"testMediaArtist"; + testMediaAlbum = @"testMediaAlbum"; + testPlaylistName = @"testPlaylistName"; + testIsExplicit = true; + }); + + it(@"Should set and get correctly", ^{ + SDLMediaServiceData *testStruct = [[SDLMediaServiceData alloc] init]; + testStruct.mediaType = testMediaType; + testStruct.mediaTitle = testMediaTitle; + testStruct.mediaArtist = testMediaArtist; + testStruct.mediaAlbum = testMediaAlbum; + testStruct.playlistName = testPlaylistName; + testStruct.isExplicit = @(testIsExplicit); + testStruct.trackPlaybackProgress = @(testTrackPlaybackProgress); + testStruct.trackPlaybackDuration = @(testTrackPlaybackDuration); + testStruct.queuePlaybackProgress = @(testQueuePlaybackProgress); + testStruct.queuePlaybackDuration = @(testQueuePlaybackDuration); + testStruct.queueCurrentTrackNumber = @(testQueueCurrentTrackNumber); + testStruct.queueTotalTrackCount = @(testQueueTotalTrackCount); + + expect(testStruct.mediaType).to(equal(testMediaType)); + expect(testStruct.mediaTitle).to(equal(testMediaTitle)); + expect(testStruct.mediaArtist).to(equal(testMediaArtist)); + expect(testStruct.mediaAlbum).to(equal(testMediaAlbum)); + expect(testStruct.playlistName).to(equal(testPlaylistName)); + expect(testStruct.isExplicit).to(equal(testIsExplicit)); + expect(testStruct.trackPlaybackProgress).to(equal(testTrackPlaybackProgress)); + expect(testStruct.trackPlaybackDuration).to(equal(testTrackPlaybackDuration)); + expect(testStruct.queuePlaybackProgress).to(equal(testQueuePlaybackProgress)); + expect(testStruct.queuePlaybackDuration).to(equal(testQueuePlaybackDuration)); + expect(testStruct.queueCurrentTrackNumber).to(equal(testQueueCurrentTrackNumber)); + expect(testStruct.queueTotalTrackCount).to(equal(testQueueTotalTrackCount)); + }); + + it(@"Should get correctly when initialized with a dictionary", ^{ + NSDictionary *dict = @{SDLRPCParameterNameMediaType:testMediaType, + SDLRPCParameterNameMediaTitle:testMediaTitle, + SDLRPCParameterNameMediaArtist:testMediaArtist, + SDLRPCParameterNameMediaAlbum:testMediaAlbum, + SDLRPCParameterNamePlaylistName:testPlaylistName, + SDLRPCParameterNameIsExplicit:@(testIsExplicit), + SDLRPCParameterNameTrackPlaybackProgress:@(testTrackPlaybackProgress), + SDLRPCParameterNameTrackPlaybackDuration:@(testTrackPlaybackDuration), + SDLRPCParameterNameQueuePlaybackProgress:@(testQueuePlaybackProgress), + SDLRPCParameterNameQueuePlaybackDuration:@(testQueuePlaybackDuration), + SDLRPCParameterNameQueueCurrentTrackNumber:@(testQueueCurrentTrackNumber), + SDLRPCParameterNameQueueTotalTrackCount:@(testQueueTotalTrackCount) + }; + SDLMediaServiceData *testStruct = [[SDLMediaServiceData alloc] initWithDictionary:dict]; + + expect(testStruct.mediaType).to(equal(testMediaType)); + expect(testStruct.mediaTitle).to(equal(testMediaTitle)); + expect(testStruct.mediaArtist).to(equal(testMediaArtist)); + expect(testStruct.mediaAlbum).to(equal(testMediaAlbum)); + expect(testStruct.playlistName).to(equal(testPlaylistName)); + expect(testStruct.isExplicit).to(equal(testIsExplicit)); + expect(testStruct.trackPlaybackProgress).to(equal(testTrackPlaybackProgress)); + expect(testStruct.trackPlaybackDuration).to(equal(testTrackPlaybackDuration)); + expect(testStruct.queuePlaybackProgress).to(equal(testQueuePlaybackProgress)); + expect(testStruct.queuePlaybackDuration).to(equal(testQueuePlaybackDuration)); + expect(testStruct.queueCurrentTrackNumber).to(equal(testQueueCurrentTrackNumber)); + expect(testStruct.queueTotalTrackCount).to(equal(testQueueTotalTrackCount)); + }); + + it(@"Should get correctly when initialized with initWithMediaType:mediaTitle:mediaArtist:mediaAlbum:playlistName:isExplicit:trackPlaybackProgress:trackPlaybackDuration:queuePlaybackProgress:queuePlaybackDuration:queueCurrentTrackNumber:queueTotalTrackCount:", ^{ + SDLMediaServiceData *testStruct = [[SDLMediaServiceData alloc] initWithMediaType:testMediaType mediaTitle:testMediaTitle mediaArtist:testMediaArtist mediaAlbum:testMediaAlbum playlistName:testPlaylistName isExplicit:testIsExplicit trackPlaybackProgress:testTrackPlaybackProgress trackPlaybackDuration:testTrackPlaybackDuration queuePlaybackProgress:testQueuePlaybackProgress queuePlaybackDuration:testQueuePlaybackDuration queueCurrentTrackNumber:testQueueCurrentTrackNumber queueTotalTrackCount:testQueueTotalTrackCount]; + + expect(testStruct.mediaType).to(equal(testMediaType)); + expect(testStruct.mediaTitle).to(equal(testMediaTitle)); + expect(testStruct.mediaArtist).to(equal(testMediaArtist)); + expect(testStruct.mediaAlbum).to(equal(testMediaAlbum)); + expect(testStruct.playlistName).to(equal(testPlaylistName)); + expect(testStruct.isExplicit).to(equal(testIsExplicit)); + expect(testStruct.trackPlaybackProgress).to(equal(testTrackPlaybackProgress)); + expect(testStruct.trackPlaybackDuration).to(equal(testTrackPlaybackDuration)); + expect(testStruct.queuePlaybackProgress).to(equal(testQueuePlaybackProgress)); + expect(testStruct.queuePlaybackDuration).to(equal(testQueuePlaybackDuration)); + expect(testStruct.queueCurrentTrackNumber).to(equal(testQueueCurrentTrackNumber)); + expect(testStruct.queueTotalTrackCount).to(equal(testQueueTotalTrackCount)); + }); + + it(@"Should return nil if not set", ^{ + SDLMediaServiceData *testStruct = [[SDLMediaServiceData alloc] init]; + + expect(testStruct.mediaType).to(beNil()); + expect(testStruct.mediaTitle).to(beNil()); + expect(testStruct.mediaArtist).to(beNil()); + expect(testStruct.mediaAlbum).to(beNil()); + expect(testStruct.playlistName).to(beNil()); + expect(testStruct.isExplicit).to(beNil()); + expect(testStruct.trackPlaybackProgress).to(beNil()); + expect(testStruct.trackPlaybackDuration).to(beNil()); + expect(testStruct.queuePlaybackProgress).to(beNil()); + expect(testStruct.queuePlaybackDuration).to(beNil()); + expect(testStruct.queueCurrentTrackNumber).to(beNil()); + expect(testStruct.queueTotalTrackCount).to(beNil()); + }); +}); + +QuickSpecEnd + diff --git a/SmartDeviceLinkTests/RPCSpecs/StructSpecs/SDLMediaServiceManifestSpec.m b/SmartDeviceLinkTests/RPCSpecs/StructSpecs/SDLMediaServiceManifestSpec.m new file mode 100644 index 000000000..bdd8dab4b --- /dev/null +++ b/SmartDeviceLinkTests/RPCSpecs/StructSpecs/SDLMediaServiceManifestSpec.m @@ -0,0 +1,33 @@ +// +// SDLMediaServiceManifestSpec.m +// SmartDeviceLinkTests +// +// Created by Nicole on 2/11/19. +// Copyright © 2019 smartdevicelink. All rights reserved. +// + +#import <Quick/Quick.h> +#import <Nimble/Nimble.h> + +#import "SDLMediaServiceManifest.h" + +QuickSpecBegin(SDLMediaServiceManifestSpec) + +describe(@"Getter/Setter Tests", ^{ + it(@"Should set and get correctly", ^{ + SDLMediaServiceManifest *testStruct = [[SDLMediaServiceManifest alloc] init]; + + // no parameters to test + expect(testStruct).toNot(beNil()); + }); + + it(@"Should get correctly when initialized with a dictionary", ^{ + NSDictionary *dict = @{}; + SDLMediaServiceManifest *testStruct = [[SDLMediaServiceManifest alloc] initWithDictionary:dict]; + + // no parameters to test + expect(testStruct).toNot(beNil()); + }); +}); + +QuickSpecEnd diff --git a/SmartDeviceLinkTests/RPCSpecs/StructSpecs/SDLMenuParamsSpec.m b/SmartDeviceLinkTests/RPCSpecs/StructSpecs/SDLMenuParamsSpec.m index e2f5612d7..3b70bbfc8 100644 --- a/SmartDeviceLinkTests/RPCSpecs/StructSpecs/SDLMenuParamsSpec.m +++ b/SmartDeviceLinkTests/RPCSpecs/StructSpecs/SDLMenuParamsSpec.m @@ -9,7 +9,7 @@ #import <Nimble/Nimble.h> #import "SDLMenuParams.h" -#import "SDLNames.h" +#import "SDLRPCParameterNames.h" QuickSpecBegin(SDLMenuParamsSpec) @@ -27,9 +27,9 @@ describe(@"Initialization tests", ^{ }); it(@"should properly initialize initWithDictionary", ^{ - NSMutableDictionary* dict = [@{SDLNameParentId:@(testParentId), - SDLNamePosition:@(testPosition), - SDLNameMenuName:testMenuName} mutableCopy]; + NSMutableDictionary* dict = [@{SDLRPCParameterNameParentId:@(testParentId), + SDLRPCParameterNamePosition:@(testPosition), + SDLRPCParameterNameMenuName:testMenuName} mutableCopy]; SDLMenuParams* testStruct = [[SDLMenuParams alloc] initWithDictionary:dict]; expect(testStruct.parentID).to(equal(@(testParentId))); diff --git a/SmartDeviceLinkTests/RPCSpecs/StructSpecs/SDLMetadataTagsSpec.m b/SmartDeviceLinkTests/RPCSpecs/StructSpecs/SDLMetadataTagsSpec.m index db7d2d855..471508861 100644 --- a/SmartDeviceLinkTests/RPCSpecs/StructSpecs/SDLMetadataTagsSpec.m +++ b/SmartDeviceLinkTests/RPCSpecs/StructSpecs/SDLMetadataTagsSpec.m @@ -12,7 +12,7 @@ #import <Nimble/Nimble.h> #import "SDLMetadataTags.h" -#import "SDLNames.h" +#import "SDLRPCParameterNames.h" #import "SDLMetadataType.h" QuickSpecBegin(SDLMetadataTagsSpec) diff --git a/SmartDeviceLinkTests/RPCSpecs/StructSpecs/SDLModuleDataSpec.m b/SmartDeviceLinkTests/RPCSpecs/StructSpecs/SDLModuleDataSpec.m index 8e57eef6b..5a67924ad 100644 --- a/SmartDeviceLinkTests/RPCSpecs/StructSpecs/SDLModuleDataSpec.m +++ b/SmartDeviceLinkTests/RPCSpecs/StructSpecs/SDLModuleDataSpec.m @@ -16,7 +16,7 @@ #import "SDLAudioControlData.h" #import "SDLLightControlData.h" #import "SDLHMISettingsControlData.h" -#import "SDLNames.h" +#import "SDLRPCParameterNames.h" QuickSpecBegin(SDLModuleDataSpec) @@ -43,13 +43,13 @@ describe(@"Initialization tests", ^{ it(@"should properly initialize initWithDictionary", ^{ - NSMutableDictionary* dict = [@{SDLNameModuleType:SDLModuleTypeRadio, - SDLNameRadioControlData:someRadioData, - SDLNameClimateControlData:someClimateData, - SDLNameSeatControlData:someSeatData, - SDLNameAudioControlData:someAudioData, - SDLNameLightControlData:someLightData, - SDLNameHmiSettingsControlData:someHMISettingsData} mutableCopy]; + NSMutableDictionary* dict = [@{SDLRPCParameterNameModuleType:SDLModuleTypeRadio, + SDLRPCParameterNameRadioControlData:someRadioData, + SDLRPCParameterNameClimateControlData:someClimateData, + SDLRPCParameterNameSeatControlData:someSeatData, + SDLRPCParameterNameAudioControlData:someAudioData, + SDLRPCParameterNameLightControlData:someLightData, + SDLRPCParameterNameHmiSettingsControlData:someHMISettingsData} mutableCopy]; SDLModuleData* testStruct = [[SDLModuleData alloc] initWithDictionary:dict]; expect(testStruct.moduleType).to(equal(SDLModuleTypeRadio)); diff --git a/SmartDeviceLinkTests/RPCSpecs/StructSpecs/SDLMyKeySpec.m b/SmartDeviceLinkTests/RPCSpecs/StructSpecs/SDLMyKeySpec.m index 6d0a462fb..0eab03e46 100644 --- a/SmartDeviceLinkTests/RPCSpecs/StructSpecs/SDLMyKeySpec.m +++ b/SmartDeviceLinkTests/RPCSpecs/StructSpecs/SDLMyKeySpec.m @@ -9,7 +9,7 @@ #import <Nimble/Nimble.h> #import "SDLMyKey.h" -#import "SDLNames.h" +#import "SDLRPCParameterNames.h" #import "SDLVehicleDataStatus.h" @@ -25,7 +25,7 @@ describe(@"Getter/Setter Tests", ^ { }); it(@"Should get correctly when initialized", ^ { - NSMutableDictionary* dict = [@{SDLNameE911Override:SDLVehicleDataStatusOn} mutableCopy]; + NSMutableDictionary* dict = [@{SDLRPCParameterNameE911Override:SDLVehicleDataStatusOn} mutableCopy]; SDLMyKey* testStruct = [[SDLMyKey alloc] initWithDictionary:dict]; expect(testStruct.e911Override).to(equal(SDLVehicleDataStatusOn)); diff --git a/SmartDeviceLinkTests/RPCSpecs/StructSpecs/SDLNavigationCapabilitySpec.m b/SmartDeviceLinkTests/RPCSpecs/StructSpecs/SDLNavigationCapabilitySpec.m index 99c85cdc8..e6db95484 100644 --- a/SmartDeviceLinkTests/RPCSpecs/StructSpecs/SDLNavigationCapabilitySpec.m +++ b/SmartDeviceLinkTests/RPCSpecs/StructSpecs/SDLNavigationCapabilitySpec.m @@ -4,7 +4,7 @@ #import <Nimble/Nimble.h> #import "SDLNavigationCapability.h" -#import "SDLNames.h" +#import "SDLRPCParameterNames.h" QuickSpecBegin(SDLNavigationCapabilitySpec) @@ -23,8 +23,8 @@ describe(@"Getter/Setter Tests", ^ { describe(@"Initialization tests", ^{ it(@"Should get correctly when initialized with a dictionary", ^ { - NSDictionary *dict = @{SDLNameGetWayPointsEnabled: @(YES), - SDLNameSendLocationEnabled: @(YES)}; + NSDictionary *dict = @{SDLRPCParameterNameGetWayPointsEnabled: @(YES), + SDLRPCParameterNameSendLocationEnabled: @(YES)}; SDLNavigationCapability* testStruct = [[SDLNavigationCapability alloc] initWithDictionary:dict]; expect(testStruct.getWayPointsEnabled).to(equal(YES)); diff --git a/SmartDeviceLinkTests/RPCSpecs/StructSpecs/SDLNavigationInstructionSpec.m b/SmartDeviceLinkTests/RPCSpecs/StructSpecs/SDLNavigationInstructionSpec.m new file mode 100644 index 000000000..f7edb055b --- /dev/null +++ b/SmartDeviceLinkTests/RPCSpecs/StructSpecs/SDLNavigationInstructionSpec.m @@ -0,0 +1,124 @@ +// +// SDLNavigationInstructionSpec.m +// SmartDeviceLinkTests +// +// Created by Nicole on 2/22/19. +// Copyright © 2019 smartdevicelink. All rights reserved. +// + +#import <Quick/Quick.h> +#import <Nimble/Nimble.h> + +#import "SDLDateTime.h" +#import "SDLImage.h" +#import "SDLLocationDetails.h" +#import "SDLNavigationInstruction.h" +#import "SDLRPCParameterNames.h" + +QuickSpecBegin(SDLNavigationInstructionSpec) + +describe(@"Getter/Setter Tests", ^{ + __block SDLLocationDetails *testLocationDetails = nil; + __block SDLNavigationAction testAction = nil; + __block SDLDateTime *testETA = nil; + __block int testBearing = 34; + __block SDLNavigationJunction testJunctionType = nil; + __block SDLDirection testDrivingSide = nil; + __block NSString *testDetails = nil; + __block SDLImage *testImage = nil; + + beforeEach(^{ + testLocationDetails = [[SDLLocationDetails alloc] init]; + testAction = SDLNavigationActionExit; + testETA = [[SDLDateTime alloc] initWithHour:3 minute:2]; + testJunctionType = SDLNavigationJunctionJughandle; + testDrivingSide = SDLDirectionLeft; + testDetails = @"testDetails"; + testImage = [[SDLImage alloc] init]; + }); + + it(@"Should set and get correctly", ^{ + SDLNavigationInstruction *testStruct = [[SDLNavigationInstruction alloc] init]; + testStruct.locationDetails = testLocationDetails; + testStruct.action = testAction; + testStruct.eta = testETA; + testStruct.bearing = @(testBearing); + testStruct.junctionType = testJunctionType; + testStruct.drivingSide = testDrivingSide; + testStruct.details = testDetails; + testStruct.image = testImage; + + expect(testStruct.locationDetails).to(equal(testLocationDetails)); + expect(testStruct.action).to(equal(testAction)); + expect(testStruct.eta).to(equal(testETA)); + expect(testStruct.bearing).to(equal(testBearing)); + expect(testStruct.junctionType).to(equal(testJunctionType)); + expect(testStruct.drivingSide).to(equal(testDrivingSide)); + expect(testStruct.details).to(equal(testDetails)); + expect(testStruct.image).to(equal(testImage)); + }); + + it(@"Should get correctly when initialized with a dictionary", ^{ + NSDictionary *dict = @{SDLRPCParameterNameLocationDetails:testLocationDetails, + SDLRPCParameterNameAction:testAction, + SDLRPCParameterNameETA:testETA, + SDLRPCParameterNameBearing:@(testBearing), + SDLRPCParameterNameJunctionType:testJunctionType, + SDLRPCParameterNameDrivingSide:testDrivingSide, + SDLRPCParameterNameDetails:testDetails, + SDLRPCParameterNameImage:testImage + }; + SDLNavigationInstruction *testStruct = [[SDLNavigationInstruction alloc] initWithDictionary:dict]; + + expect(testStruct.locationDetails).to(equal(testLocationDetails)); + expect(testStruct.action).to(equal(testAction)); + expect(testStruct.eta).to(equal(testETA)); + expect(testStruct.bearing).to(equal(testBearing)); + expect(testStruct.junctionType).to(equal(testJunctionType)); + expect(testStruct.drivingSide).to(equal(testDrivingSide)); + expect(testStruct.details).to(equal(testDetails)); + expect(testStruct.image).to(equal(testImage)); + }); + + it(@"Should initialize correctly with initWithLocationDetails:action:", ^{ + SDLNavigationInstruction *testStruct = [[SDLNavigationInstruction alloc] initWithLocationDetails:testLocationDetails action:testAction]; + + expect(testStruct.locationDetails).to(equal(testLocationDetails)); + expect(testStruct.action).to(equal(testAction)); + expect(testStruct.eta).to(beNil()); + expect(testStruct.bearing).to(beNil()); + expect(testStruct.junctionType).to(beNil()); + expect(testStruct.drivingSide).to(beNil()); + expect(testStruct.details).to(beNil()); + expect(testStruct.image).to(beNil()); + }); + + it(@"Should initialize correctly with initWithLocationDetails:action:eta:bearing:junctionType:drivingSide:details:details image:", ^{ + SDLNavigationInstruction *testStruct = [[SDLNavigationInstruction alloc] initWithLocationDetails:testLocationDetails action:testAction eta:testETA bearing:testBearing junctionType:testJunctionType drivingSide:testDrivingSide details:testDetails image:testImage]; + + expect(testStruct.locationDetails).to(equal(testLocationDetails)); + expect(testStruct.action).to(equal(testAction)); + expect(testStruct.eta).to(equal(testETA)); + expect(testStruct.bearing).to(equal(testBearing)); + expect(testStruct.junctionType).to(equal(testJunctionType)); + expect(testStruct.drivingSide).to(equal(testDrivingSide)); + expect(testStruct.details).to(equal(testDetails)); + expect(testStruct.image).to(equal(testImage)); + }); + + it(@"Should return nil if not set", ^{ + SDLNavigationInstruction *testStruct = [[SDLNavigationInstruction alloc] init]; + + expect(testStruct.locationDetails).to(beNil()); + expect(testStruct.action).to(beNil()); + expect(testStruct.eta).to(beNil()); + expect(testStruct.bearing).to(beNil()); + expect(testStruct.junctionType).to(beNil()); + expect(testStruct.drivingSide).to(beNil()); + expect(testStruct.details).to(beNil()); + expect(testStruct.image).to(beNil()); + }); +}); + +QuickSpecEnd + diff --git a/SmartDeviceLinkTests/RPCSpecs/StructSpecs/SDLNavigationServiceDataSpec.m b/SmartDeviceLinkTests/RPCSpecs/StructSpecs/SDLNavigationServiceDataSpec.m new file mode 100644 index 000000000..96ec6dae7 --- /dev/null +++ b/SmartDeviceLinkTests/RPCSpecs/StructSpecs/SDLNavigationServiceDataSpec.m @@ -0,0 +1,132 @@ +// +// SDLNavigationServiceDataSpec.m +// SmartDeviceLinkTests +// +// Created by Nicole on 2/25/19. +// Copyright © 2019 smartdevicelink. All rights reserved. +// + +#import <Quick/Quick.h> +#import <Nimble/Nimble.h> + +#import "SDLDateTime.h" +#import "SDLLocationDetails.h" +#import "SDLRPCParameterNames.h" +#import "SDLNavigationInstruction.h" +#import "SDLNavigationServiceData.h" + + +QuickSpecBegin(SDLNavigationServiceDataSpec) + +describe(@"Getter/Setter Tests", ^{ + __block SDLDateTime *testTimestamp = nil; + __block SDLLocationDetails *testOrigin = nil; + __block SDLLocationDetails *testDestination = nil; + __block SDLDateTime *testDestinationETA = nil; + __block NSArray<SDLNavigationInstruction *> *testInstructions = nil; + __block SDLDateTime *testNextInstructionETA = nil; + __block float testNextInstructionDistance = 45.3; + __block float testNextInstructionDistanceScale = 0.3; + __block NSString *testPrompt = nil; + + beforeEach(^{ + testTimestamp = [[SDLDateTime alloc] initWithHour:4 minute:3]; + testOrigin = [[SDLLocationDetails alloc] init]; + testDestination = [[SDLLocationDetails alloc] init]; + testDestinationETA = [[SDLDateTime alloc] initWithHour:6 minute:1 second:1 millisecond:1]; + testInstructions = @[[[SDLNavigationInstruction alloc] init], [[SDLNavigationInstruction alloc] init]]; + testNextInstructionETA = [[SDLDateTime alloc] initWithHour:2 minute:0]; + testPrompt = @"testPrompt"; + }); + + it(@"Should set and get correctly", ^{ + SDLNavigationServiceData *testStruct = [[SDLNavigationServiceData alloc] init]; + testStruct.timestamp = testTimestamp; + testStruct.origin = testOrigin; + testStruct.destination = testDestination; + testStruct.destinationETA = testDestinationETA; + testStruct.instructions = testInstructions; + testStruct.nextInstructionETA = testNextInstructionETA; + testStruct.nextInstructionDistance = @(testNextInstructionDistance); + testStruct.nextInstructionDistanceScale = @(testNextInstructionDistanceScale); + testStruct.prompt = testPrompt; + + expect(testStruct.timestamp).to(equal(testTimestamp)); + expect(testStruct.origin).to(equal(testOrigin)); + expect(testStruct.destination).to(equal(testDestination)); + expect(testStruct.destinationETA).to(equal(testDestinationETA)); + expect(testStruct.instructions).to(equal(testInstructions)); + expect(testStruct.nextInstructionETA).to(equal(testNextInstructionETA)); + expect(testStruct.nextInstructionDistance).to(equal(testNextInstructionDistance)); + expect(testStruct.nextInstructionDistanceScale).to(equal(testNextInstructionDistanceScale)); + expect(testStruct.prompt).to(equal(testPrompt)); + }); + + it(@"Should get correctly when initialized with a dictionary", ^{ + NSDictionary *dict = @{SDLRPCParameterNameTimeStamp:testTimestamp, + SDLRPCParameterNameOrigin:testOrigin, + SDLRPCParameterNameDestination:testDestination, + SDLRPCParameterNameDestinationETA:testDestinationETA, + SDLRPCParameterNameInstructions:testInstructions, + SDLRPCParameterNameNextInstructionETA:testNextInstructionETA, + SDLRPCParameterNameNextInstructionDistance:@(testNextInstructionDistance), + SDLRPCParameterNameNextInstructionDistanceScale:@(testNextInstructionDistanceScale), + SDLRPCParameterNamePrompt:testPrompt + }; + SDLNavigationServiceData *testStruct = [[SDLNavigationServiceData alloc] initWithDictionary:dict]; + + expect(testStruct.timestamp).to(equal(testTimestamp)); + expect(testStruct.origin).to(equal(testOrigin)); + expect(testStruct.destination).to(equal(testDestination)); + expect(testStruct.destinationETA).to(equal(testDestinationETA)); + expect(testStruct.instructions).to(equal(testInstructions)); + expect(testStruct.nextInstructionETA).to(equal(testNextInstructionETA)); + expect(testStruct.nextInstructionDistance).to(equal(testNextInstructionDistance)); + expect(testStruct.nextInstructionDistanceScale).to(equal(testNextInstructionDistanceScale)); + expect(testStruct.prompt).to(equal(testPrompt)); + }); + + it(@"Should initialize correctly with initWithTimestamp:", ^{ + SDLNavigationServiceData *testStruct = [[SDLNavigationServiceData alloc] initWithTimestamp:testTimestamp]; + + expect(testStruct.timestamp).to(equal(testTimestamp)); + expect(testStruct.origin).to(beNil()); + expect(testStruct.destination).to(beNil()); + expect(testStruct.destinationETA).to(beNil()); + expect(testStruct.instructions).to(beNil()); + expect(testStruct.nextInstructionETA).to(beNil()); + expect(testStruct.nextInstructionDistance).to(beNil()); + expect(testStruct.nextInstructionDistanceScale).to(beNil()); + expect(testStruct.prompt).to(beNil()); + }); + + it(@"Should initialize correctly with initWithTimestamp:origin:destination:destinationETA:instructions:nextInstructionETA:nextInstructionDistance:nextInstructionDistanceScale:prompt:", ^{ + SDLNavigationServiceData *testStruct = [[SDLNavigationServiceData alloc] initWithTimestamp:testTimestamp origin:testOrigin destination:testDestination destinationETA:testDestinationETA instructions:testInstructions nextInstructionETA:testNextInstructionETA nextInstructionDistance:testNextInstructionDistance nextInstructionDistanceScale:testNextInstructionDistanceScale prompt:testPrompt]; + + expect(testStruct.timestamp).to(equal(testTimestamp)); + expect(testStruct.origin).to(equal(testOrigin)); + expect(testStruct.destination).to(equal(testDestination)); + expect(testStruct.destinationETA).to(equal(testDestinationETA)); + expect(testStruct.instructions).to(equal(testInstructions)); + expect(testStruct.nextInstructionETA).to(equal(testNextInstructionETA)); + expect(testStruct.nextInstructionDistance).to(equal(testNextInstructionDistance)); + expect(testStruct.nextInstructionDistanceScale).to(equal(testNextInstructionDistanceScale)); + expect(testStruct.prompt).to(equal(testPrompt)); + }); + + it(@"Should return nil if not set", ^{ + SDLNavigationServiceData *testStruct = [[SDLNavigationServiceData alloc] init]; + + expect(testStruct.timestamp).to(beNil()); + expect(testStruct.origin).to(beNil()); + expect(testStruct.destination).to(beNil()); + expect(testStruct.destinationETA).to(beNil()); + expect(testStruct.instructions).to(beNil()); + expect(testStruct.nextInstructionETA).to(beNil()); + expect(testStruct.nextInstructionDistance).to(beNil()); + expect(testStruct.nextInstructionDistanceScale).to(beNil()); + expect(testStruct.prompt).to(beNil()); + }); +}); + +QuickSpecEnd diff --git a/SmartDeviceLinkTests/RPCSpecs/StructSpecs/SDLNavigationServiceManifestSpec.m b/SmartDeviceLinkTests/RPCSpecs/StructSpecs/SDLNavigationServiceManifestSpec.m new file mode 100644 index 000000000..30786c531 --- /dev/null +++ b/SmartDeviceLinkTests/RPCSpecs/StructSpecs/SDLNavigationServiceManifestSpec.m @@ -0,0 +1,51 @@ +// +// SDLNavigationServiceManifestSpec.m +// SmartDeviceLinkTests +// +// Created by Nicole on 2/25/19. +// Copyright © 2019 smartdevicelink. All rights reserved. +// + +#import <Quick/Quick.h> +#import <Nimble/Nimble.h> + +#import "SDLRPCParameterNames.h" +#import "SDLNavigationServiceManifest.h" + +QuickSpecBegin(SDLNavigationServiceManifestSpec) + +describe(@"Getter/Setter Tests", ^{ + __block BOOL testAcceptsWayPoints = nil; + + beforeEach(^{ + testAcceptsWayPoints = false; + }); + + it(@"Should set and get correctly", ^{ + SDLNavigationServiceManifest *testStruct = [[SDLNavigationServiceManifest alloc] init]; + testStruct.acceptsWayPoints = @(testAcceptsWayPoints); + + expect(testStruct.acceptsWayPoints).to(equal(testAcceptsWayPoints)); + }); + + it(@"Should get correctly when initialized with a dictionary", ^{ + NSDictionary *dict = @{SDLRPCParameterNameAcceptsWayPoints:@(testAcceptsWayPoints)}; + SDLNavigationServiceManifest *testStruct = [[SDLNavigationServiceManifest alloc] initWithDictionary:dict]; + + expect(testStruct.acceptsWayPoints).to(equal(testAcceptsWayPoints)); + }); + + it(@"Should initialize correctly with a convenience init", ^{ + SDLNavigationServiceManifest *testStruct = [[SDLNavigationServiceManifest alloc] initWithAcceptsWayPoints:testAcceptsWayPoints]; + + expect(testStruct.acceptsWayPoints).to(equal(testAcceptsWayPoints)); + }); + + it(@"Should return nil if not set", ^{ + SDLNavigationServiceManifest *testStruct = [[SDLNavigationServiceManifest alloc] init]; + + expect(testStruct.acceptsWayPoints).to(beNil()); + }); +}); + +QuickSpecEnd diff --git a/SmartDeviceLinkTests/RPCSpecs/StructSpecs/SDLOasisAddressSpec.m b/SmartDeviceLinkTests/RPCSpecs/StructSpecs/SDLOasisAddressSpec.m index 5a4bf7cef..dbada5f4e 100644 --- a/SmartDeviceLinkTests/RPCSpecs/StructSpecs/SDLOasisAddressSpec.m +++ b/SmartDeviceLinkTests/RPCSpecs/StructSpecs/SDLOasisAddressSpec.m @@ -7,7 +7,7 @@ #import <Nimble/Nimble.h> #import "SDLOasisAddress.h" -#import "SDLNames.h" +#import "SDLRPCParameterNames.h" QuickSpecBegin(SDLOasisAddressSpec) @@ -38,15 +38,15 @@ describe(@"Getter/Setter Tests", ^ { }); it(@"Should get correctly when initialized", ^ { - NSMutableDictionary* dict = [@{SDLNameCountryName:@"United States", - SDLNameCountryCode:@"US", - SDLNamePostalCode:@"123456", - SDLNameAdministrativeArea:@"CA", - SDLNameSubAdministrativeArea:@"Santa Clara", - SDLNameLocality:@"Palo Alto", - SDLNameSubLocality:@"18", - SDLNameThoroughfare:@"Candy Lane", - SDLNameSubThoroughfare:@"123"} mutableCopy]; + NSMutableDictionary* dict = [@{SDLRPCParameterNameCountryName:@"United States", + SDLRPCParameterNameCountryCode:@"US", + SDLRPCParameterNamePostalCode:@"123456", + SDLRPCParameterNameAdministrativeArea:@"CA", + SDLRPCParameterNameSubAdministrativeArea:@"Santa Clara", + SDLRPCParameterNameLocality:@"Palo Alto", + SDLRPCParameterNameSubLocality:@"18", + SDLRPCParameterNameThoroughfare:@"Candy Lane", + SDLRPCParameterNameSubThoroughfare:@"123"} mutableCopy]; SDLOasisAddress* testStruct = [[SDLOasisAddress alloc] initWithDictionary:dict]; expect(testStruct.countryName).to(equal(@"United States")); diff --git a/SmartDeviceLinkTests/RPCSpecs/StructSpecs/SDLParameterPermissionsSpec.m b/SmartDeviceLinkTests/RPCSpecs/StructSpecs/SDLParameterPermissionsSpec.m index 92b6a5ef6..746bbea63 100644 --- a/SmartDeviceLinkTests/RPCSpecs/StructSpecs/SDLParameterPermissionsSpec.m +++ b/SmartDeviceLinkTests/RPCSpecs/StructSpecs/SDLParameterPermissionsSpec.m @@ -10,7 +10,7 @@ #import "SDLParameterPermissions.h" #import "SDLHMILevel.h" -#import "SDLNames.h" +#import "SDLRPCParameterNames.h" QuickSpecBegin(SDLParameterPermissionsSpec) @@ -26,8 +26,8 @@ describe(@"Getter/Setter Tests", ^ { }); it(@"Should get correctly when initialized", ^ { - NSMutableDictionary* dict = [@{SDLNameAllowed:[@[SDLHMILevelBackground, SDLHMILevelFull] copy], - SDLNameUserDisallowed:[@[SDLHMILevelNone, SDLHMILevelLimited] copy]} mutableCopy]; + NSMutableDictionary* dict = [@{SDLRPCParameterNameAllowed:[@[SDLHMILevelBackground, SDLHMILevelFull] copy], + SDLRPCParameterNameUserDisallowed:[@[SDLHMILevelNone, SDLHMILevelLimited] copy]} mutableCopy]; SDLParameterPermissions* testStruct = [[SDLParameterPermissions alloc] initWithDictionary:dict]; expect(testStruct.allowed).to(equal([@[SDLHMILevelBackground, SDLHMILevelFull] copy])); diff --git a/SmartDeviceLinkTests/RPCSpecs/StructSpecs/SDLPermissionItemSpec.m b/SmartDeviceLinkTests/RPCSpecs/StructSpecs/SDLPermissionItemSpec.m index 4ff0ce5e5..8f629a11d 100644 --- a/SmartDeviceLinkTests/RPCSpecs/StructSpecs/SDLPermissionItemSpec.m +++ b/SmartDeviceLinkTests/RPCSpecs/StructSpecs/SDLPermissionItemSpec.m @@ -11,7 +11,7 @@ #import "SDLHMIPermissions.h" #import "SDLParameterPermissions.h" #import "SDLPermissionItem.h" -#import "SDLNames.h" +#import "SDLRPCParameterNames.h" QuickSpecBegin(SDLPermissionItemSpec) @@ -32,9 +32,9 @@ describe(@"Getter/Setter Tests", ^ { }); it(@"Should get correctly when initialized", ^ { - NSMutableDictionary<NSString *, id> *dict = [@{SDLNameRPCName:@"RPCNameThing", - SDLNameHMIPermissions:hmiPermissions, - SDLNameParameterPermissions:parameterPermissions} mutableCopy]; + NSMutableDictionary<NSString *, id> *dict = [@{SDLRPCParameterNameRPCName:@"RPCNameThing", + SDLRPCParameterNameHMIPermissions:hmiPermissions, + SDLRPCParameterNameParameterPermissions:parameterPermissions} mutableCopy]; SDLPermissionItem* testStruct = [[SDLPermissionItem alloc] initWithDictionary:dict]; expect(testStruct.rpcName).to(equal(@"RPCNameThing")); diff --git a/SmartDeviceLinkTests/RPCSpecs/StructSpecs/SDLPhoneCapabilitySpec.m b/SmartDeviceLinkTests/RPCSpecs/StructSpecs/SDLPhoneCapabilitySpec.m index af01dae52..a38ddec4b 100644 --- a/SmartDeviceLinkTests/RPCSpecs/StructSpecs/SDLPhoneCapabilitySpec.m +++ b/SmartDeviceLinkTests/RPCSpecs/StructSpecs/SDLPhoneCapabilitySpec.m @@ -4,7 +4,7 @@ #import <Nimble/Nimble.h> #import "SDLPhoneCapability.h" -#import "SDLNames.h" +#import "SDLRPCParameterNames.h" QuickSpecBegin(SDLPhoneCapabilitySpec) @@ -20,7 +20,7 @@ describe(@"Getter/Setter Tests", ^ { describe(@"Initialization tests", ^{ it(@"Should get correctly when initialized with a dictionary", ^ { - NSDictionary *dict = @{SDLNameDialNumberEnabled: @(YES)}; + NSDictionary *dict = @{SDLRPCParameterNameDialNumberEnabled: @(YES)}; SDLPhoneCapability *testStruct = [[SDLPhoneCapability alloc] initWithDictionary:dict]; expect(testStruct.dialNumberEnabled).to(equal(YES)); diff --git a/SmartDeviceLinkTests/RPCSpecs/StructSpecs/SDLPresetBankCapabilitiesSpec.m b/SmartDeviceLinkTests/RPCSpecs/StructSpecs/SDLPresetBankCapabilitiesSpec.m index 8bab3c147..b10eace7b 100644 --- a/SmartDeviceLinkTests/RPCSpecs/StructSpecs/SDLPresetBankCapabilitiesSpec.m +++ b/SmartDeviceLinkTests/RPCSpecs/StructSpecs/SDLPresetBankCapabilitiesSpec.m @@ -9,7 +9,7 @@ #import <Nimble/Nimble.h> #import "SDLPresetBankCapabilities.h" -#import "SDLNames.h" +#import "SDLRPCParameterNames.h" QuickSpecBegin(SDLPresetBankCapabilitiesSpec) @@ -23,7 +23,7 @@ describe(@"Getter/Setter Tests", ^ { }); it(@"Should get correctly when initialized", ^ { - NSMutableDictionary<NSString *, id> *dict = [@{SDLNameOnScreenPresetsAvailable:@YES} mutableCopy]; + NSMutableDictionary<NSString *, id> *dict = [@{SDLRPCParameterNameOnScreenPresetsAvailable:@YES} mutableCopy]; SDLPresetBankCapabilities* testStruct = [[SDLPresetBankCapabilities alloc] initWithDictionary:dict]; expect(testStruct.onScreenPresetsAvailable).to(equal(@YES)); diff --git a/SmartDeviceLinkTests/RPCSpecs/StructSpecs/SDLRDSDataSpec.m b/SmartDeviceLinkTests/RPCSpecs/StructSpecs/SDLRDSDataSpec.m index 414aaa22c..082f201e3 100644 --- a/SmartDeviceLinkTests/RPCSpecs/StructSpecs/SDLRDSDataSpec.m +++ b/SmartDeviceLinkTests/RPCSpecs/StructSpecs/SDLRDSDataSpec.m @@ -9,7 +9,7 @@ #import <Nimble/Nimble.h> #import "SDLRDSData.h" -#import "SDLNames.h" +#import "SDLRPCParameterNames.h" QuickSpecBegin(SDLRDSDataSpec) @@ -30,14 +30,14 @@ describe(@"Initialization tests", ^{ it(@"should properly initialize initWithDictionary", ^{ - NSMutableDictionary* dict = [@{SDLNameProgramService : @"ps", - SDLNameRadioText : @"rt", - SDLNameClockText : @"2017-07-25T19:20:30-5:00", - SDLNameProgramIdentification : @"pi", - SDLNameProgramType : @5, - SDLNameTrafficProgramIdentification : @NO, - SDLNameTrafficAnnouncementIdentification : @YES, - SDLNameRegion : @"reg"} mutableCopy]; + NSMutableDictionary* dict = [@{SDLRPCParameterNameProgramService : @"ps", + SDLRPCParameterNameRadioText : @"rt", + SDLRPCParameterNameClockText : @"2017-07-25T19:20:30-5:00", + SDLRPCParameterNameProgramIdentification : @"pi", + SDLRPCParameterNameProgramType : @5, + SDLRPCParameterNameTrafficProgramIdentification : @NO, + SDLRPCParameterNameTrafficAnnouncementIdentification : @YES, + SDLRPCParameterNameRegion : @"reg"} mutableCopy]; SDLRDSData* testStruct = [[SDLRDSData alloc] initWithDictionary:dict]; expect(testStruct.programService).to(equal(@"ps")); diff --git a/SmartDeviceLinkTests/RPCSpecs/StructSpecs/SDLRGBColorSpec.m b/SmartDeviceLinkTests/RPCSpecs/StructSpecs/SDLRGBColorSpec.m index 49c423d41..766b72298 100644 --- a/SmartDeviceLinkTests/RPCSpecs/StructSpecs/SDLRGBColorSpec.m +++ b/SmartDeviceLinkTests/RPCSpecs/StructSpecs/SDLRGBColorSpec.m @@ -3,7 +3,7 @@ #import "SDLRGBColor.h" -#import "SDLNames.h" +#import "SDLRPCParameterNames.h" QuickSpecBegin(SDLRGBColorSpec) @@ -38,9 +38,9 @@ describe(@"RGBColor Tests", ^{ }); it(@"Should get correctly when initialized with a dict", ^{ - NSDictionary *dict = @{SDLNameRed: @0, - SDLNameGreen: @100, - SDLNameBlue: @255}; + NSDictionary *dict = @{SDLRPCParameterNameRed: @0, + SDLRPCParameterNameGreen: @100, + SDLRPCParameterNameBlue: @255}; SDLRGBColor *testStruct = [[SDLRGBColor alloc] initWithDictionary:dict]; expect(testStruct.red).to(equal(@0)); diff --git a/SmartDeviceLinkTests/RPCSpecs/StructSpecs/SDLRadioControlCapabilitiesSpec.m b/SmartDeviceLinkTests/RPCSpecs/StructSpecs/SDLRadioControlCapabilitiesSpec.m index d51d7910e..8ac7c7563 100644 --- a/SmartDeviceLinkTests/RPCSpecs/StructSpecs/SDLRadioControlCapabilitiesSpec.m +++ b/SmartDeviceLinkTests/RPCSpecs/StructSpecs/SDLRadioControlCapabilitiesSpec.m @@ -9,7 +9,7 @@ #import <Nimble/Nimble.h> #import "SDLRadioControlCapabilities.h" -#import "SDLNames.h" +#import "SDLRPCParameterNames.h" QuickSpecBegin(SDLRadioControlCapabilitiesSpec) @@ -36,19 +36,19 @@ describe(@"Initialization tests", ^{ it(@"should properly initialize initWithDictionary", ^{ - NSMutableDictionary* dict = [@{SDLNameModuleName : @"someName", - SDLNameRadioEnableAvailable : @YES, - SDLNameRadioBandAvailable : @YES, - SDLNameRadioFrequencyAvailable : @YES, - SDLNameHDChannelAvailable : @NO, - SDLNameRDSDataAvailable : @NO, - SDLNameAvailableHDsAvailable : @NO, - SDLNameStateAvailable : @YES, - SDLNameSignalStrengthAvailable : @YES, - SDLNameSignalChangeThresholdAvailable : @NO, - SDLNameHDRadioEnableAvailable : @YES, - SDLNameSiriusXMRadioAvailable : @NO, - SDLNameSISDataAvailable:@YES + NSMutableDictionary* dict = [@{SDLRPCParameterNameModuleName : @"someName", + SDLRPCParameterNameRadioEnableAvailable : @YES, + SDLRPCParameterNameRadioBandAvailable : @YES, + SDLRPCParameterNameRadioFrequencyAvailable : @YES, + SDLRPCParameterNameHDChannelAvailable : @NO, + SDLRPCParameterNameRDSDataAvailable : @NO, + SDLRPCParameterNameAvailableHDsAvailable : @NO, + SDLRPCParameterNameStateAvailable : @YES, + SDLRPCParameterNameSignalStrengthAvailable : @YES, + SDLRPCParameterNameSignalChangeThresholdAvailable : @NO, + SDLRPCParameterNameHDRadioEnableAvailable : @YES, + SDLRPCParameterNameSiriusXMRadioAvailable : @NO, + SDLRPCParameterNameSISDataAvailable:@YES } mutableCopy]; SDLRadioControlCapabilities* testStruct = [[SDLRadioControlCapabilities alloc] initWithDictionary:dict]; diff --git a/SmartDeviceLinkTests/RPCSpecs/StructSpecs/SDLRadioControlDataSpec.m b/SmartDeviceLinkTests/RPCSpecs/StructSpecs/SDLRadioControlDataSpec.m index d974c1b2c..58d9f8f92 100644 --- a/SmartDeviceLinkTests/RPCSpecs/StructSpecs/SDLRadioControlDataSpec.m +++ b/SmartDeviceLinkTests/RPCSpecs/StructSpecs/SDLRadioControlDataSpec.m @@ -13,7 +13,7 @@ #import "SDLRadioState.h" #import "SDLRDSData.h" #import "SDLSISData.h" -#import "SDLNames.h" +#import "SDLRPCParameterNames.h" QuickSpecBegin(SDLRadioControlDataSpec) __block SDLRDSData* someRdsData = [[SDLRDSData alloc] init]; @@ -37,17 +37,17 @@ describe(@"Initialization tests", ^{ }); it(@"should properly initialize initWithDictionary", ^{ - NSMutableDictionary* dict = [@{SDLNameFrequencyInteger : @101, - SDLNameFrequencyFraction : @7, - SDLNameBand : SDLRadioBandAM, - SDLNameRDSData : someRdsData, - SDLNameAvailableHDs : @2, - SDLNameHDChannel : @2, - SDLNameSignalStrength : @54, - SDLNameSignalChangeThreshold : @76, - SDLNameRadioEnable : @YES, - SDLNameState : SDLRadioStateNotFound, - SDLNameHDRadioEnable : @NO + NSMutableDictionary* dict = [@{SDLRPCParameterNameFrequencyInteger : @101, + SDLRPCParameterNameFrequencyFraction : @7, + SDLRPCParameterNameBand : SDLRadioBandAM, + SDLRPCParameterNameRDSData : someRdsData, + SDLRPCParameterNameAvailableHDs : @2, + SDLRPCParameterNameHDChannel : @2, + SDLRPCParameterNameSignalStrength : @54, + SDLRPCParameterNameSignalChangeThreshold : @76, + SDLRPCParameterNameRadioEnable : @YES, + SDLRPCParameterNameState : SDLRadioStateNotFound, + SDLRPCParameterNameHDRadioEnable : @NO } mutableCopy]; SDLRadioControlData* testStruct = [[SDLRadioControlData alloc] initWithDictionary:dict]; diff --git a/SmartDeviceLinkTests/RPCSpecs/StructSpecs/SDLRectangleSpec.m b/SmartDeviceLinkTests/RPCSpecs/StructSpecs/SDLRectangleSpec.m index 87c516bfa..ceb7628e9 100644 --- a/SmartDeviceLinkTests/RPCSpecs/StructSpecs/SDLRectangleSpec.m +++ b/SmartDeviceLinkTests/RPCSpecs/StructSpecs/SDLRectangleSpec.m @@ -3,7 +3,7 @@ #import <Quick/Quick.h> #import <Nimble/Nimble.h> -#import "SDLNames.h" +#import "SDLRPCParameterNames.h" #import "SDLRectangle.h" QuickSpecBegin(SDLRectangleSpec) @@ -33,10 +33,10 @@ describe(@"Rectangle Tests", ^{ }); it(@"Should get correctly when initialized with a dict", ^{ - NSDictionary *dict = @{SDLNameX:@20, - SDLNameY:@200, - SDLNameWidth:@2000, - SDLNameHeight:@3000}; + NSDictionary *dict = @{SDLRPCParameterNameX:@20, + SDLRPCParameterNameY:@200, + SDLRPCParameterNameWidth:@2000, + SDLRPCParameterNameHeight:@3000}; SDLRectangle *testStruct = [[SDLRectangle alloc] initWithDictionary:dict]; expect(testStruct.x).to(equal(@20)); diff --git a/SmartDeviceLinkTests/RPCSpecs/StructSpecs/SDLRemoteControlCapabilitiesSpec.m b/SmartDeviceLinkTests/RPCSpecs/StructSpecs/SDLRemoteControlCapabilitiesSpec.m index 7067d058d..c8b359d49 100644 --- a/SmartDeviceLinkTests/RPCSpecs/StructSpecs/SDLRemoteControlCapabilitiesSpec.m +++ b/SmartDeviceLinkTests/RPCSpecs/StructSpecs/SDLRemoteControlCapabilitiesSpec.m @@ -16,7 +16,7 @@ #import "SDLRadioControlCapabilities.h" #import "SDLSeatControlCapabilities.h" #import "SDLButtonCapabilities.h" -#import "SDLNames.h" +#import "SDLRPCParameterNames.h" QuickSpecBegin(SDLRemoteControlCapabilitiesSpec) @@ -49,13 +49,13 @@ describe(@"Initialization tests", ^{ it(@"should properly initialize initWithDictionary", ^{ - NSMutableDictionary* dict = [@{SDLNameClimateControlCapabilities : [@[someClimateControlCapabilities] copy], - SDLNameRadioControlCapabilities :[@[someRadioControlCapabilities] copy], - SDLNameButtonCapabilities :[@[someButtonControlCapabilities] copy], - SDLNameSeatControlCapabilities:[@[someSeatControlCapabilities]copy], - SDLNameAudioControlCapabilities :[@[someAudioControlCapabilities] copy], - SDLNameLightControlCapabilities :[@[someLightControlCapabilities] copy], - SDLNameHmiSettingsControlCapabilities : [@[someHMISettingsControlCapabilities] copy] + NSMutableDictionary* dict = [@{SDLRPCParameterNameClimateControlCapabilities : [@[someClimateControlCapabilities] copy], + SDLRPCParameterNameRadioControlCapabilities :[@[someRadioControlCapabilities] copy], + SDLRPCParameterNameButtonCapabilities :[@[someButtonControlCapabilities] copy], + SDLRPCParameterNameSeatControlCapabilities:[@[someSeatControlCapabilities]copy], + SDLRPCParameterNameAudioControlCapabilities :[@[someAudioControlCapabilities] copy], + SDLRPCParameterNameLightControlCapabilities :[@[someLightControlCapabilities] copy], + SDLRPCParameterNameHmiSettingsControlCapabilities : [@[someHMISettingsControlCapabilities] copy] } mutableCopy]; SDLRemoteControlCapabilities* testStruct = [[SDLRemoteControlCapabilities alloc] initWithDictionary:dict]; diff --git a/SmartDeviceLinkTests/RPCSpecs/StructSpecs/SDLSISDataSpec.m b/SmartDeviceLinkTests/RPCSpecs/StructSpecs/SDLSISDataSpec.m index 3c20090aa..6803917cb 100644 --- a/SmartDeviceLinkTests/RPCSpecs/StructSpecs/SDLSISDataSpec.m +++ b/SmartDeviceLinkTests/RPCSpecs/StructSpecs/SDLSISDataSpec.m @@ -8,7 +8,7 @@ #import <Quick/Quick.h> #import <Nimble/Nimble.h> -#import "SDLNames.h" +#import "SDLRPCParameterNames.h" #import "SDLSISData.h" #import "SDLStationIDNumber.h" #import "SDLGPSData.h" @@ -48,11 +48,11 @@ describe(@"Getter/Setter Tests", ^ { }); it(@"Should get correctly when initialized", ^ { - NSMutableDictionary* dict = [@{SDLNameStationShortName:@"short", - SDLNameStationLongName:@"long", - SDLNameStationLocation:someLocation, - SDLNameStationIDNumber:someID, - SDLNameStationMessage:@"message" + NSMutableDictionary* dict = [@{SDLRPCParameterNameStationShortName:@"short", + SDLRPCParameterNameStationLongName:@"long", + SDLRPCParameterNameStationLocation:someLocation, + SDLRPCParameterNameStationIDNumber:someID, + SDLRPCParameterNameStationMessage:@"message" } mutableCopy]; SDLSISData* testStruct = [[SDLSISData alloc] initWithDictionary:dict]; diff --git a/SmartDeviceLinkTests/RPCSpecs/StructSpecs/SDLScreenParamsSpec.m b/SmartDeviceLinkTests/RPCSpecs/StructSpecs/SDLScreenParamsSpec.m index 6c574d040..421272ba4 100644 --- a/SmartDeviceLinkTests/RPCSpecs/StructSpecs/SDLScreenParamsSpec.m +++ b/SmartDeviceLinkTests/RPCSpecs/StructSpecs/SDLScreenParamsSpec.m @@ -9,7 +9,7 @@ #import <Nimble/Nimble.h> #import "SDLImageResolution.h" -#import "SDLNames.h" +#import "SDLRPCParameterNames.h" #import "SDLScreenParams.h" #import "SDLTouchEventCapabilities.h" @@ -31,8 +31,8 @@ describe(@"Getter/Setter Tests", ^ { }); it(@"Should get correctly when initialized", ^ { - NSMutableDictionary<NSString *, id> *dict = [@{SDLNameResolution:resolution, - SDLNameTouchEventAvailable:capabilities} mutableCopy]; + NSMutableDictionary<NSString *, id> *dict = [@{SDLRPCParameterNameResolution:resolution, + SDLRPCParameterNameTouchEventAvailable:capabilities} mutableCopy]; SDLScreenParams* testStruct = [[SDLScreenParams alloc] initWithDictionary:dict]; expect(testStruct.resolution).to(equal(resolution)); diff --git a/SmartDeviceLinkTests/RPCSpecs/StructSpecs/SDLSeatControlCapabilitiesSpec.m b/SmartDeviceLinkTests/RPCSpecs/StructSpecs/SDLSeatControlCapabilitiesSpec.m index 07f6b8c4a..ed1cb779b 100644 --- a/SmartDeviceLinkTests/RPCSpecs/StructSpecs/SDLSeatControlCapabilitiesSpec.m +++ b/SmartDeviceLinkTests/RPCSpecs/StructSpecs/SDLSeatControlCapabilitiesSpec.m @@ -9,7 +9,7 @@ #import <Quick/Quick.h> #import <Nimble/Nimble.h> -#import "SDLNames.h" +#import "SDLRPCParameterNames.h" #import "SDLSeatControlCapabilities.h" @@ -100,22 +100,22 @@ describe(@"Getter/Setter Tests", ^ { }); it(@"Should get correctly when initialized", ^ { - NSMutableDictionary* dict = [@{SDLNameModuleName:@"moduleName", - SDLNameHeatingEnabledAvailable:(@YES), - SDLNameCoolingEnabledAvailable:@YES, - SDLNameHeatingLevelAvailable:@YES, - SDLNameCoolingLevelAvailable:@NO, - SDLNameHorizontalPositionAvailable:@NO, - SDLNameVerticalPositionAvailable:@NO, - SDLNameFrontVerticalPositionAvailable:@NO, - SDLNameBackVerticalPositionAvailable:@NO, - SDLNameBackTiltAngleAvailable:@YES, - SDLNameHeadSupportHorizontalPositionAvailable:@NO, - SDLNameHeadSupportVerticalPositionAvailable:@YES, - SDLNameMassageEnabledAvailable:@NO, - SDLNameMassageModeAvailable:@YES, - SDLNameMassageCushionFirmnessAvailable:@NO, - SDLNameMemoryAvailable:@NO + NSMutableDictionary* dict = [@{SDLRPCParameterNameModuleName:@"moduleName", + SDLRPCParameterNameHeatingEnabledAvailable:(@YES), + SDLRPCParameterNameCoolingEnabledAvailable:@YES, + SDLRPCParameterNameHeatingLevelAvailable:@YES, + SDLRPCParameterNameCoolingLevelAvailable:@NO, + SDLRPCParameterNameHorizontalPositionAvailable:@NO, + SDLRPCParameterNameVerticalPositionAvailable:@NO, + SDLRPCParameterNameFrontVerticalPositionAvailable:@NO, + SDLRPCParameterNameBackVerticalPositionAvailable:@NO, + SDLRPCParameterNameBackTiltAngleAvailable:@YES, + SDLRPCParameterNameHeadSupportHorizontalPositionAvailable:@NO, + SDLRPCParameterNameHeadSupportVerticalPositionAvailable:@YES, + SDLRPCParameterNameMassageEnabledAvailable:@NO, + SDLRPCParameterNameMassageModeAvailable:@YES, + SDLRPCParameterNameMassageCushionFirmnessAvailable:@NO, + SDLRPCParameterNameMemoryAvailable:@NO } mutableCopy]; SDLSeatControlCapabilities *testStruct = [[SDLSeatControlCapabilities alloc] initWithDictionary:dict]; diff --git a/SmartDeviceLinkTests/RPCSpecs/StructSpecs/SDLSeatControlDataSpec.m b/SmartDeviceLinkTests/RPCSpecs/StructSpecs/SDLSeatControlDataSpec.m index 02dc0500f..f7b75b357 100644 --- a/SmartDeviceLinkTests/RPCSpecs/StructSpecs/SDLSeatControlDataSpec.m +++ b/SmartDeviceLinkTests/RPCSpecs/StructSpecs/SDLSeatControlDataSpec.m @@ -8,7 +8,7 @@ #import <Quick/Quick.h> #import <Nimble/Nimble.h> -#import "SDLNames.h" +#import "SDLRPCParameterNames.h" #import "SDLSeatControlData.h" #import "SDLMassageModeData.h" #import "SDLMassageCushionFirmness.h" @@ -109,22 +109,22 @@ describe(@"Getter/Setter Tests", ^ { }); it(@"Should get correctly when initialized", ^ { - NSMutableDictionary* dict = [@{SDLNameId:SDLSupportedSeatDriver, - SDLNameHeatingEnabled:@NO, - SDLNameCoolingEnabled:@YES, - SDLNameHeatingLevel:@25, - SDLNameCoolingLevel:@10, - SDLNameHorizontalPosition:@23, - SDLNameVerticalPosition:@25, - SDLNameFrontVerticalPosition:@12, - SDLNameBackVerticalPosition:@34, - SDLNameBackTiltAngle:@2, - SDLNameHeadSupportHorizontalPosition:@3, - SDLNameHeadSupportVerticalPosition:@43, - SDLNameMassageEnabled:@YES, - SDLNameMassageMode:[@[massageModeData] mutableCopy], - SDLNameMassageCushionFirmness:[@[massageCushionFirmness] mutableCopy], - SDLNameMemory:seatMemoryAction + NSMutableDictionary* dict = [@{SDLRPCParameterNameId:SDLSupportedSeatDriver, + SDLRPCParameterNameHeatingEnabled:@NO, + SDLRPCParameterNameCoolingEnabled:@YES, + SDLRPCParameterNameHeatingLevel:@25, + SDLRPCParameterNameCoolingLevel:@10, + SDLRPCParameterNameHorizontalPosition:@23, + SDLRPCParameterNameVerticalPosition:@25, + SDLRPCParameterNameFrontVerticalPosition:@12, + SDLRPCParameterNameBackVerticalPosition:@34, + SDLRPCParameterNameBackTiltAngle:@2, + SDLRPCParameterNameHeadSupportHorizontalPosition:@3, + SDLRPCParameterNameHeadSupportVerticalPosition:@43, + SDLRPCParameterNameMassageEnabled:@YES, + SDLRPCParameterNameMassageMode:[@[massageModeData] mutableCopy], + SDLRPCParameterNameMassageCushionFirmness:[@[massageCushionFirmness] mutableCopy], + SDLRPCParameterNameMemory:seatMemoryAction } mutableCopy]; SDLSeatControlData *testStruct = [[SDLSeatControlData alloc] initWithDictionary:dict]; diff --git a/SmartDeviceLinkTests/RPCSpecs/StructSpecs/SDLSeatMemoryActionSpec.m b/SmartDeviceLinkTests/RPCSpecs/StructSpecs/SDLSeatMemoryActionSpec.m index a256e50a8..aaeece688 100644 --- a/SmartDeviceLinkTests/RPCSpecs/StructSpecs/SDLSeatMemoryActionSpec.m +++ b/SmartDeviceLinkTests/RPCSpecs/StructSpecs/SDLSeatMemoryActionSpec.m @@ -8,7 +8,7 @@ #import <Quick/Quick.h> #import <Nimble/Nimble.h> -#import "SDLNames.h" +#import "SDLRPCParameterNames.h" #import "SDLSeatMemoryAction.h" QuickSpecBegin(SDLSeatMemoryActionSpec) @@ -37,9 +37,9 @@ describe(@"Getter/Setter Tests", ^ { }); it(@"Should get correctly when initialized", ^ { - NSMutableDictionary* dict = [@{SDLNameId:@54, - SDLNameLabel:@"none", - SDLNameAction: SDLSeatMemoryActionTypeNone + NSMutableDictionary* dict = [@{SDLRPCParameterNameId:@54, + SDLRPCParameterNameLabel:@"none", + SDLRPCParameterNameAction: SDLSeatMemoryActionTypeNone } mutableCopy]; SDLSeatMemoryAction *testStruct = [[SDLSeatMemoryAction alloc] initWithDictionary:dict]; diff --git a/SmartDeviceLinkTests/RPCSpecs/StructSpecs/SDLSingleTireStatusSpec.m b/SmartDeviceLinkTests/RPCSpecs/StructSpecs/SDLSingleTireStatusSpec.m index 1fc06535e..41b685e31 100644 --- a/SmartDeviceLinkTests/RPCSpecs/StructSpecs/SDLSingleTireStatusSpec.m +++ b/SmartDeviceLinkTests/RPCSpecs/StructSpecs/SDLSingleTireStatusSpec.m @@ -10,7 +10,7 @@ #import "SDLSingleTireStatus.h" #import "SDLComponentVolumeStatus.h" -#import "SDLNames.h" +#import "SDLRPCParameterNames.h" QuickSpecBegin(SDLSingleTireStatusSpec) @@ -29,9 +29,9 @@ describe(@"Getter/Setter Tests", ^ { it(@"Should get correctly when initialized", ^ { NSDictionary* dict = @{ - SDLNameStatus: SDLComponentVolumeStatusLow, - SDLNameTPMS: SDLTPMSLow, - SDLNamePressure: @67.78 + SDLRPCParameterNameStatus: SDLComponentVolumeStatusLow, + SDLRPCParameterNameTPMS: SDLTPMSLow, + SDLRPCParameterNamePressure: @67.78 }; SDLSingleTireStatus* testStruct = [[SDLSingleTireStatus alloc] initWithDictionary:dict]; diff --git a/SmartDeviceLinkTests/RPCSpecs/StructSpecs/SDLSoftButtonCapabilitiesSpec.m b/SmartDeviceLinkTests/RPCSpecs/StructSpecs/SDLSoftButtonCapabilitiesSpec.m index 4000f2764..131ddebf1 100644 --- a/SmartDeviceLinkTests/RPCSpecs/StructSpecs/SDLSoftButtonCapabilitiesSpec.m +++ b/SmartDeviceLinkTests/RPCSpecs/StructSpecs/SDLSoftButtonCapabilitiesSpec.m @@ -9,7 +9,7 @@ #import <Nimble/Nimble.h> #import "SDLSoftButtonCapabilities.h" -#import "SDLNames.h" +#import "SDLRPCParameterNames.h" QuickSpecBegin(SDLSoftButtonCapabilitiesSpec) @@ -29,10 +29,10 @@ describe(@"Getter/Setter Tests", ^ { }); it(@"Should get correctly when initialized", ^ { - NSMutableDictionary<NSString *, id> *dict = [@{SDLNameShortPressAvailable:@NO, - SDLNameLongPressAvailable:@YES, - SDLNameUpDownAvailable:@NO, - SDLNameImageSupported:@NO} mutableCopy]; + NSMutableDictionary<NSString *, id> *dict = [@{SDLRPCParameterNameShortPressAvailable:@NO, + SDLRPCParameterNameLongPressAvailable:@YES, + SDLRPCParameterNameUpDownAvailable:@NO, + SDLRPCParameterNameImageSupported:@NO} mutableCopy]; SDLSoftButtonCapabilities* testStruct = [[SDLSoftButtonCapabilities alloc] initWithDictionary:dict]; expect(testStruct.shortPressAvailable).to(equal(@NO)); diff --git a/SmartDeviceLinkTests/RPCSpecs/StructSpecs/SDLSoftButtonSpec.m b/SmartDeviceLinkTests/RPCSpecs/StructSpecs/SDLSoftButtonSpec.m index df938b7dc..6c637bc38 100644 --- a/SmartDeviceLinkTests/RPCSpecs/StructSpecs/SDLSoftButtonSpec.m +++ b/SmartDeviceLinkTests/RPCSpecs/StructSpecs/SDLSoftButtonSpec.m @@ -9,7 +9,7 @@ #import <Nimble/Nimble.h> #import "SDLImage.h" -#import "SDLNames.h" +#import "SDLRPCParameterNames.h" #import "SDLSoftButton.h" #import "SDLSoftButtonType.h" #import "SDLSystemAction.h" @@ -39,12 +39,12 @@ describe(@"Getter/Setter Tests", ^ { }); it(@"Should get correctly when initialized", ^ { - NSMutableDictionary* dict = [@{SDLNameType:SDLSoftButtonTypeImage, - SDLNameText:@"Button", - SDLNameImage:image, - SDLNameIsHighlighted:@YES, - SDLNameSoftButtonId:@5423, - SDLNameSystemAction:SDLSystemActionKeepContext} mutableCopy]; + NSMutableDictionary* dict = [@{SDLRPCParameterNameType:SDLSoftButtonTypeImage, + SDLRPCParameterNameText:@"Button", + SDLRPCParameterNameImage:image, + SDLRPCParameterNameIsHighlighted:@YES, + SDLRPCParameterNameSoftButtonId:@5423, + SDLRPCParameterNameSystemAction:SDLSystemActionKeepContext} mutableCopy]; SDLSoftButton* testStruct = [[SDLSoftButton alloc] initWithDictionary:dict]; expect(testStruct.type).to(equal(SDLSoftButtonTypeImage)); diff --git a/SmartDeviceLinkTests/RPCSpecs/StructSpecs/SDLStartTimeSpec.m b/SmartDeviceLinkTests/RPCSpecs/StructSpecs/SDLStartTimeSpec.m index 209b8d75d..f4ba0eacd 100644 --- a/SmartDeviceLinkTests/RPCSpecs/StructSpecs/SDLStartTimeSpec.m +++ b/SmartDeviceLinkTests/RPCSpecs/StructSpecs/SDLStartTimeSpec.m @@ -9,7 +9,7 @@ #import <Nimble/Nimble.h> #import "SDLStartTime.h" -#import "SDLNames.h" +#import "SDLRPCParameterNames.h" QuickSpecBegin(SDLStartTimeSpec) @@ -30,9 +30,9 @@ describe(@"StartTime Spec", ^ { }); it(@"should properly initialize with initWithDictionary:", ^{ - NSDictionary<NSString *, id> *dict = @{SDLNameHours:@(testHours), - SDLNameMinutes:@(testMinutes), - SDLNameSeconds:@(testSeconds)}; + NSDictionary<NSString *, id> *dict = @{SDLRPCParameterNameHours:@(testHours), + SDLRPCParameterNameMinutes:@(testMinutes), + SDLRPCParameterNameSeconds:@(testSeconds)}; SDLStartTime *testStruct = [[SDLStartTime alloc] initWithDictionary:dict]; expect(testStruct.hours).to(equal(@(testHours))); diff --git a/SmartDeviceLinkTests/RPCSpecs/StructSpecs/SDLStationIDNumberSpec.m b/SmartDeviceLinkTests/RPCSpecs/StructSpecs/SDLStationIDNumberSpec.m index 3cd543f80..92390aab4 100644 --- a/SmartDeviceLinkTests/RPCSpecs/StructSpecs/SDLStationIDNumberSpec.m +++ b/SmartDeviceLinkTests/RPCSpecs/StructSpecs/SDLStationIDNumberSpec.m @@ -8,7 +8,7 @@ #import <Quick/Quick.h> #import <Nimble/Nimble.h> -#import "SDLNames.h" +#import "SDLRPCParameterNames.h" #import "SDLStationIDNumber.h" QuickSpecBegin(SDLStationIDNumberSpec) @@ -33,8 +33,8 @@ describe(@"Getter/Setter Tests", ^ { }); it(@"Should get correctly when initialized", ^ { - NSMutableDictionary* dict = [@{SDLNameCountryCode:@91, - SDLNameFCCFacilityId:@23 + NSMutableDictionary* dict = [@{SDLRPCParameterNameCountryCode:@91, + SDLRPCParameterNameFCCFacilityId:@23 } mutableCopy]; SDLStationIDNumber* testStruct = [[SDLStationIDNumber alloc] initWithDictionary:dict]; diff --git a/SmartDeviceLinkTests/RPCSpecs/StructSpecs/SDLSyncMsgVersionSpec.m b/SmartDeviceLinkTests/RPCSpecs/StructSpecs/SDLSyncMsgVersionSpec.m index 598f04d2e..f8bc93df5 100644 --- a/SmartDeviceLinkTests/RPCSpecs/StructSpecs/SDLSyncMsgVersionSpec.m +++ b/SmartDeviceLinkTests/RPCSpecs/StructSpecs/SDLSyncMsgVersionSpec.m @@ -9,7 +9,7 @@ #import <Nimble/Nimble.h> #import "SDLSyncMsgVersion.h" -#import "SDLNames.h" +#import "SDLRPCParameterNames.h" QuickSpecBegin(SDLSyncMsgVersionSpec) @@ -27,9 +27,9 @@ describe(@"Getter/Setter Tests", ^ { }); it(@"Should get correctly when initialized", ^ { - NSMutableDictionary* dict = [@{SDLNameMajorVersion:@4, - SDLNameMinorVersion:@532, - SDLNamePatchVersion:@12} mutableCopy]; + NSMutableDictionary* dict = [@{SDLRPCParameterNameMajorVersion:@4, + SDLRPCParameterNameMinorVersion:@532, + SDLRPCParameterNamePatchVersion:@12} mutableCopy]; SDLSyncMsgVersion* testStruct = [[SDLSyncMsgVersion alloc] initWithDictionary:dict]; expect(testStruct.majorVersion).to(equal(@4)); diff --git a/SmartDeviceLinkTests/RPCSpecs/StructSpecs/SDLSystemCapabilitySpec.m b/SmartDeviceLinkTests/RPCSpecs/StructSpecs/SDLSystemCapabilitySpec.m index abfd13afb..c759058d8 100755 --- a/SmartDeviceLinkTests/RPCSpecs/StructSpecs/SDLSystemCapabilitySpec.m +++ b/SmartDeviceLinkTests/RPCSpecs/StructSpecs/SDLSystemCapabilitySpec.m @@ -5,69 +5,93 @@ #import "SDLSystemCapability.h" +#import "SDLAppServicesCapabilities.h" #import "SDLImageResolution.h" #import "SDLNavigationCapability.h" #import "SDLPhoneCapability.h" #import "SDLSystemCapabilityType.h" #import "SDLRemoteControlCapabilities.h" -#import "SDLNames.h" +#import "SDLRPCParameterNames.h" #import "SDLVideoStreamingCapability.h" #import "SDLVideoStreamingCodec.h" #import "SDLVideoStreamingFormat.h" #import "SDLVideoStreamingProtocol.h" -#import "SDLNames.h" +#import "SDLRPCParameterNames.h" QuickSpecBegin(SDLSystemCapabilitySpec) -SDLRemoteControlCapabilities *someRemoteControlCapabilities = [[SDLRemoteControlCapabilities alloc] init]; describe(@"Getter/Setter Tests", ^ { + __block SDLAppServicesCapabilities *testAppServicesCapabilities = nil; + __block SDLNavigationCapability *testNavigationCapability = nil; + __block SDLPhoneCapability *testPhoneCapability = nil; + __block SDLRemoteControlCapabilities *testRemoteControlCapabilities = nil; + __block SDLVideoStreamingCapability *testVideoStreamingCapability = nil; + + beforeEach(^{ + testAppServicesCapabilities = [[SDLAppServicesCapabilities alloc] initWithAppServices:nil]; + testNavigationCapability = [[SDLNavigationCapability alloc] initWithSendLocation:YES waypoints:NO]; + testPhoneCapability = [[SDLPhoneCapability alloc] initWithDialNumber:YES]; + testRemoteControlCapabilities = [[SDLRemoteControlCapabilities alloc] initWithClimateControlCapabilities:nil radioControlCapabilities:nil buttonCapabilities:nil seatControlCapabilities:nil audioControlCapabilities:nil hmiSettingsControlCapabilities:nil lightControlCapabilities:nil]; + testVideoStreamingCapability = [[SDLVideoStreamingCapability alloc] initWithPreferredResolution:[[SDLImageResolution alloc] initWithWidth:50 height:50] maxBitrate:5 supportedFormats:@[] hapticDataSupported:false]; + }); + it(@"Should set and get correctly", ^ { SDLSystemCapability *testStruct = [[SDLSystemCapability alloc] init]; - testStruct.systemCapabilityType = SDLSystemCapabilityTypeNavigation; - testStruct.navigationCapability = [[SDLNavigationCapability alloc] initWithSendLocation:YES waypoints:NO]; - testStruct.phoneCapability = [[SDLPhoneCapability alloc] initWithDialNumber:YES]; - testStruct.remoteControlCapability = someRemoteControlCapabilities; + testStruct.appServicesCapabilities = testAppServicesCapabilities; + testStruct.navigationCapability = testNavigationCapability; + testStruct.phoneCapability = testPhoneCapability; + testStruct.videoStreamingCapability = testVideoStreamingCapability; + testStruct.remoteControlCapability = testRemoteControlCapabilities; expect(testStruct.systemCapabilityType).to(equal(SDLSystemCapabilityTypeNavigation)); - expect(testStruct.navigationCapability.sendLocationEnabled).to(equal(YES)); - expect(testStruct.navigationCapability.getWayPointsEnabled).to(equal(NO)); - expect(testStruct.phoneCapability.dialNumberEnabled).to(equal(YES)); - - testStruct.systemCapabilityType = SDLSystemCapabilityTypeVideoStreaming; - - expect(testStruct.systemCapabilityType).to(equal(SDLSystemCapabilityTypeVideoStreaming)); - expect(testStruct.remoteControlCapability).to(equal(someRemoteControlCapabilities)); - + expect(testStruct.appServicesCapabilities).to(equal(testAppServicesCapabilities)); + expect(testStruct.navigationCapability).to(equal(testNavigationCapability)); + expect(testStruct.phoneCapability).to(equal(testPhoneCapability)); + expect(testStruct.videoStreamingCapability).to(equal(testVideoStreamingCapability)); + expect(testStruct.remoteControlCapability).to(equal(testRemoteControlCapabilities)); }); -}); -describe(@"Initialization tests", ^{ it(@"Should get correctly when initialized with a dictionary", ^ { - NSMutableDictionary* dict = [@{SDLNameSystemCapabilityType: @"NAVIGATION", - SDLNameNavigationCapability: @{SDLNameGetWayPointsEnabled: @(NO), - SDLNameSendLocationEnabled: @(YES)}, - SDLNamePhoneCapability: @{SDLNameDialNumberEnabled: @(YES)}, - SDLNameRemoteControlCapability: someRemoteControlCapabilities} mutableCopy]; + NSDictionary *dict = @{ + SDLRPCParameterNameSystemCapabilityType:SDLSystemCapabilityTypeNavigation, + SDLRPCParameterNameAppServicesCapabilities:testAppServicesCapabilities, + SDLRPCParameterNameNavigationCapability:testNavigationCapability, + SDLRPCParameterNamePhoneCapability:testPhoneCapability, + SDLRPCParameterNameRemoteControlCapability:testRemoteControlCapabilities, + SDLRPCParameterNameVideoStreamingCapability:testVideoStreamingCapability + }; SDLSystemCapability *testStruct = [[SDLSystemCapability alloc] initWithDictionary:dict]; expect(testStruct.systemCapabilityType).to(equal(SDLSystemCapabilityTypeNavigation)); - expect(testStruct.navigationCapability.sendLocationEnabled).to(equal(YES)); - expect(testStruct.navigationCapability.getWayPointsEnabled).to(equal(NO)); - expect(testStruct.phoneCapability.dialNumberEnabled).to(equal(YES)); - expect(testStruct.remoteControlCapability).to(equal(someRemoteControlCapabilities)); + expect(testStruct.appServicesCapabilities).to(equal(testAppServicesCapabilities)); + expect(testStruct.navigationCapability).to(equal(testNavigationCapability)); + expect(testStruct.phoneCapability).to(equal(testPhoneCapability)); + expect(testStruct.remoteControlCapability).to(equal(testRemoteControlCapabilities)); + expect(testStruct.videoStreamingCapability).to(equal(testVideoStreamingCapability)); }); it(@"Should return nil if not set", ^ { SDLSystemCapability *testStruct = [[SDLSystemCapability alloc] init]; expect(testStruct.systemCapabilityType).to(beNil()); + expect(testStruct.appServicesCapabilities).to(beNil()); expect(testStruct.navigationCapability).to(beNil()); expect(testStruct.phoneCapability).to(beNil()); expect(testStruct.videoStreamingCapability).to(beNil()); expect(testStruct.remoteControlCapability).to(beNil()); + }); + it(@"should initialize correctly with initWithAppServicesCapabilities:", ^{ + SDLSystemCapability *testStruct = [[SDLSystemCapability alloc] initWithAppServicesCapabilities:testAppServicesCapabilities]; + + expect(testStruct.systemCapabilityType).to(equal(SDLSystemCapabilityTypeAppServices)); + expect(testStruct.appServicesCapabilities).to(equal(testAppServicesCapabilities)); + expect(testStruct.navigationCapability).to(beNil()); + expect(testStruct.phoneCapability).to(beNil()); + expect(testStruct.remoteControlCapability).to(beNil()); + expect(testStruct.videoStreamingCapability).to(beNil()); }); it(@"should initialize correctly with initWithPhoneCapability:", ^{ @@ -75,10 +99,11 @@ describe(@"Initialization tests", ^{ SDLSystemCapability *testStruct = [[SDLSystemCapability alloc] initWithPhoneCapability:testPhoneStruct]; expect(testStruct.systemCapabilityType).to(equal(SDLSystemCapabilityTypePhoneCall)); - expect(testStruct.phoneCapability.dialNumberEnabled).to(equal(YES)); + expect(testStruct.appServicesCapabilities).to(beNil()); expect(testStruct.navigationCapability).to(beNil()); - expect(testStruct.videoStreamingCapability).to(beNil()); + expect(testStruct.phoneCapability).to(equal(testPhoneStruct)); expect(testStruct.remoteControlCapability).to(beNil()); + expect(testStruct.videoStreamingCapability).to(beNil()); }); it(@"should initialize correctly with initWithNavigationCapability:", ^{ @@ -86,11 +111,11 @@ describe(@"Initialization tests", ^{ SDLSystemCapability *testStruct = [[SDLSystemCapability alloc] initWithNavigationCapability:testNavStruct]; expect(testStruct.systemCapabilityType).to(equal(SDLSystemCapabilityTypeNavigation)); - expect(testStruct.navigationCapability.sendLocationEnabled).to(equal(YES)); - expect(testStruct.navigationCapability.getWayPointsEnabled).to(equal(YES)); + expect(testStruct.appServicesCapabilities).to(beNil()); + expect(testStruct.navigationCapability).to(equal(testNavStruct)); expect(testStruct.phoneCapability).to(beNil()); - expect(testStruct.videoStreamingCapability).to(beNil()); expect(testStruct.remoteControlCapability).to(beNil()); + expect(testStruct.videoStreamingCapability).to(beNil()); }); it(@"should initialize correctly with initWithVideoStreamingCapability:", ^{ @@ -115,19 +140,22 @@ describe(@"Initialization tests", ^{ SDLSystemCapability *testStruct = [[SDLSystemCapability alloc] initWithVideoStreamingCapability:testVidStruct]; expect(testStruct.systemCapabilityType).to(equal(SDLSystemCapabilityTypeVideoStreaming)); - expect(testStruct.navigationCapability.sendLocationEnabled).to(beNil()); - expect(testStruct.navigationCapability.getWayPointsEnabled).to(beNil()); + expect(testStruct.appServicesCapabilities).to(beNil()); + expect(testStruct.navigationCapability).to(beNil()); expect(testStruct.phoneCapability).to(beNil()); - + expect(testStruct.remoteControlCapability).to(beNil()); + expect(testStruct.videoStreamingCapability).to(equal(testVidStruct)); }); it(@"should initialize correctly with initWithRemoteControlCapability:", ^{ - SDLSystemCapability *testStruct = [[SDLSystemCapability alloc] initWithRemoteControlCapability:someRemoteControlCapabilities]; + SDLSystemCapability *testStruct = [[SDLSystemCapability alloc] initWithRemoteControlCapability:testRemoteControlCapabilities]; expect(testStruct.systemCapabilityType).to(equal(SDLSystemCapabilityTypeRemoteControl)); + expect(testStruct.appServicesCapabilities).to(beNil()); expect(testStruct.navigationCapability).to(beNil()); expect(testStruct.phoneCapability).to(beNil()); - expect(testStruct.remoteControlCapability).to(equal(someRemoteControlCapabilities)); + expect(testStruct.remoteControlCapability).to(equal(testRemoteControlCapabilities)); + expect(testStruct.videoStreamingCapability).to(beNil()); }); }); diff --git a/SmartDeviceLinkTests/RPCSpecs/StructSpecs/SDLTTSChunkSpec.m b/SmartDeviceLinkTests/RPCSpecs/StructSpecs/SDLTTSChunkSpec.m index ef4d741ec..3111d04a0 100644 --- a/SmartDeviceLinkTests/RPCSpecs/StructSpecs/SDLTTSChunkSpec.m +++ b/SmartDeviceLinkTests/RPCSpecs/StructSpecs/SDLTTSChunkSpec.m @@ -8,7 +8,7 @@ #import <Quick/Quick.h> #import <Nimble/Nimble.h> -#import "SDLNames.h" +#import "SDLRPCParameterNames.h" #import "SDLSpeechCapabilities.h" #import "SDLTTSChunk.h" @@ -30,8 +30,8 @@ describe(@"TTS Chunk Tests", ^{ }); it(@"should correctly initialize with initWithDictionary", ^{ - NSDictionary* dict = @{SDLNameText: testText, - SDLNameType: testCapabilities}; + NSDictionary* dict = @{SDLRPCParameterNameText: testText, + SDLRPCParameterNameType: testCapabilities}; testStruct = [[SDLTTSChunk alloc] initWithDictionary:dict]; expect(testStruct.text).to(equal(testText)); diff --git a/SmartDeviceLinkTests/RPCSpecs/StructSpecs/SDLTemperatureSpec.m b/SmartDeviceLinkTests/RPCSpecs/StructSpecs/SDLTemperatureSpec.m index 9151e0df5..3e234d098 100644 --- a/SmartDeviceLinkTests/RPCSpecs/StructSpecs/SDLTemperatureSpec.m +++ b/SmartDeviceLinkTests/RPCSpecs/StructSpecs/SDLTemperatureSpec.m @@ -10,7 +10,7 @@ #import "SDLTemperature.h" #import "SDLTemperatureUnit.h" -#import "SDLNames.h" +#import "SDLRPCParameterNames.h" QuickSpecBegin(SDLTemperatureSpec) @@ -25,20 +25,36 @@ describe(@"Initialization tests", ^{ it(@"should properly initialize initWithDictionary", ^{ - NSMutableDictionary* dict = [@{SDLNameUnit : SDLTemperatureUnitCelsius , - SDLNameValue:@30 } mutableCopy]; + NSMutableDictionary* dict = [@{SDLRPCParameterNameUnit : SDLTemperatureUnitCelsius , + SDLRPCParameterNameValue:@30 } mutableCopy]; SDLTemperature* testStruct = [[SDLTemperature alloc] initWithDictionary:dict]; expect(testStruct.unit).to(equal(SDLTemperatureUnitCelsius)); expect(testStruct.value).to(equal(@30)); }); - it(@"should initialize correctly with Unit and value", ^{ + it(@"should initialize correctly with initWithUnit:value:", ^{ SDLTemperature *testStruct = [[SDLTemperature alloc] initWithUnit:SDLTemperatureUnitCelsius value:30]; expect(testStruct.unit).to(equal(SDLTemperatureUnitCelsius)); expect(testStruct.value).to(equal(@30)); }); + + it(@"should initialize correctly with initWithFahrenheitValue:", ^{ + float fahrenheitValue = 22.121; + SDLTemperature *testStruct = [[SDLTemperature alloc] initWithFahrenheitValue:fahrenheitValue]; + + expect(testStruct.unit).to(equal(SDLTemperatureUnitFahrenheit)); + expect(testStruct.value).to(equal(fahrenheitValue)); + }); + + it(@"should initialize correctly with initWithCelsiusValue:", ^{ + float celsiusValue = -40.2; + SDLTemperature *testStruct = [[SDLTemperature alloc] initWithCelsiusValue:celsiusValue]; + + expect(testStruct.unit).to(equal(SDLTemperatureUnitCelsius)); + expect(testStruct.value).to(equal(celsiusValue)); + }); it(@"Should set and get correctly", ^{ SDLTemperature* testStruct = [[SDLTemperature alloc] init]; diff --git a/SmartDeviceLinkTests/RPCSpecs/StructSpecs/SDLTemplateColorSchemeSpec.m b/SmartDeviceLinkTests/RPCSpecs/StructSpecs/SDLTemplateColorSchemeSpec.m index 48112cf6f..f52354d7b 100644 --- a/SmartDeviceLinkTests/RPCSpecs/StructSpecs/SDLTemplateColorSchemeSpec.m +++ b/SmartDeviceLinkTests/RPCSpecs/StructSpecs/SDLTemplateColorSchemeSpec.m @@ -4,7 +4,7 @@ #import "SDLRGBColor.h" #import "SDLTemplateColorScheme.h" -#import "SDLNames.h" +#import "SDLRPCParameterNames.h" QuickSpecBegin(SDLTemplateColorSchemeSpec) @@ -51,9 +51,9 @@ describe(@"TemplateColor Tests", ^{ }); it(@"Should get correctly when initialized with a dict", ^{ - NSDictionary *dict = @{SDLNameRed: @0, - SDLNameGreen: @100, - SDLNameBlue: @255}; + NSDictionary *dict = @{SDLRPCParameterNameRed: @0, + SDLRPCParameterNameGreen: @100, + SDLRPCParameterNameBlue: @255}; SDLRGBColor *testStruct = [[SDLRGBColor alloc] initWithDictionary:dict]; expect(testStruct.red).to(equal(@0)); diff --git a/SmartDeviceLinkTests/RPCSpecs/StructSpecs/SDLTextFieldSpec.m b/SmartDeviceLinkTests/RPCSpecs/StructSpecs/SDLTextFieldSpec.m index 065945f48..983ec47a1 100644 --- a/SmartDeviceLinkTests/RPCSpecs/StructSpecs/SDLTextFieldSpec.m +++ b/SmartDeviceLinkTests/RPCSpecs/StructSpecs/SDLTextFieldSpec.m @@ -9,7 +9,7 @@ #import <Nimble/Nimble.h> #import "SDLCharacterSet.h" -#import "SDLNames.h" +#import "SDLRPCParameterNames.h" #import "SDLTextField.h" #import "SDLTextFieldName.h" @@ -32,10 +32,10 @@ describe(@"Getter/Setter Tests", ^ { }); it(@"Should get correctly when initialized", ^ { - NSMutableDictionary* dict = [@{SDLNameName:SDLTextFieldNameTertiaryText, - SDLNameCharacterSet:SDLCharacterSetType5, - SDLNameWidth:@111, - SDLNameRows:@4} mutableCopy]; + NSMutableDictionary* dict = [@{SDLRPCParameterNameName:SDLTextFieldNameTertiaryText, + SDLRPCParameterNameCharacterSet:SDLCharacterSetType5, + SDLRPCParameterNameWidth:@111, + SDLRPCParameterNameRows:@4} mutableCopy]; SDLTextField* testStruct = [[SDLTextField alloc] initWithDictionary:dict]; expect(testStruct.name).to(equal(SDLTextFieldNameTertiaryText)); diff --git a/SmartDeviceLinkTests/RPCSpecs/StructSpecs/SDLTireStatusSpec.m b/SmartDeviceLinkTests/RPCSpecs/StructSpecs/SDLTireStatusSpec.m index ebe9eb7e3..67243d863 100644 --- a/SmartDeviceLinkTests/RPCSpecs/StructSpecs/SDLTireStatusSpec.m +++ b/SmartDeviceLinkTests/RPCSpecs/StructSpecs/SDLTireStatusSpec.m @@ -11,7 +11,7 @@ #import "SDLTireStatus.h" #import "SDLSingleTireStatus.h" #import "SDLWarningLightStatus.h" -#import "SDLNames.h" +#import "SDLRPCParameterNames.h" QuickSpecBegin(SDLTireStatusSpec) @@ -44,13 +44,13 @@ describe(@"Getter/Setter Tests", ^ { }); it(@"Should get correctly when initialized", ^ { - NSMutableDictionary* dict = [@{SDLNamePressureTelltale:SDLWarningLightStatusOff, - SDLNameLeftFront:tire1, - SDLNameRightFront:tire2, - SDLNameLeftRear:tire3, - SDLNameRightRear:tire4, - SDLNameInnerLeftRear:tire5, - SDLNameInnerRightRear:tire6} mutableCopy]; + NSMutableDictionary* dict = [@{SDLRPCParameterNamePressureTelltale:SDLWarningLightStatusOff, + SDLRPCParameterNameLeftFront:tire1, + SDLRPCParameterNameRightFront:tire2, + SDLRPCParameterNameLeftRear:tire3, + SDLRPCParameterNameRightRear:tire4, + SDLRPCParameterNameInnerLeftRear:tire5, + SDLRPCParameterNameInnerRightRear:tire6} mutableCopy]; SDLTireStatus* testStruct = [[SDLTireStatus alloc] initWithDictionary:dict]; expect(testStruct.pressureTelltale).to(equal(SDLWarningLightStatusOff)); diff --git a/SmartDeviceLinkTests/RPCSpecs/StructSpecs/SDLTouchCoordSpec.m b/SmartDeviceLinkTests/RPCSpecs/StructSpecs/SDLTouchCoordSpec.m index bc9ab9495..c0dcee58a 100644 --- a/SmartDeviceLinkTests/RPCSpecs/StructSpecs/SDLTouchCoordSpec.m +++ b/SmartDeviceLinkTests/RPCSpecs/StructSpecs/SDLTouchCoordSpec.m @@ -9,7 +9,7 @@ #import <Nimble/Nimble.h> #import "SDLTouchCoord.h" -#import "SDLNames.h" +#import "SDLRPCParameterNames.h" QuickSpecBegin(SDLTouchCoordSpec) @@ -25,8 +25,8 @@ describe(@"Getter/Setter Tests", ^ { }); it(@"Should get correctly when initialized", ^ { - NSMutableDictionary<NSString *, id> *dict = [@{SDLNameX:@67, - SDLNameY:@362} mutableCopy]; + NSMutableDictionary<NSString *, id> *dict = [@{SDLRPCParameterNameX:@67, + SDLRPCParameterNameY:@362} mutableCopy]; SDLTouchCoord* testStruct = [[SDLTouchCoord alloc] initWithDictionary:dict]; expect(testStruct.x).to(equal(@67)); diff --git a/SmartDeviceLinkTests/RPCSpecs/StructSpecs/SDLTouchEventCapabilitiesSpec.m b/SmartDeviceLinkTests/RPCSpecs/StructSpecs/SDLTouchEventCapabilitiesSpec.m index 6df769068..e54ec7b26 100644 --- a/SmartDeviceLinkTests/RPCSpecs/StructSpecs/SDLTouchEventCapabilitiesSpec.m +++ b/SmartDeviceLinkTests/RPCSpecs/StructSpecs/SDLTouchEventCapabilitiesSpec.m @@ -9,7 +9,7 @@ #import <Nimble/Nimble.h> #import "SDLTouchEventCapabilities.h" -#import "SDLNames.h" +#import "SDLRPCParameterNames.h" QuickSpecBegin(SDLTouchEventCapabilitiesSpec) @@ -27,9 +27,9 @@ describe(@"Getter/Setter Tests", ^ { }); it(@"Should get correctly when initialized", ^ { - NSMutableDictionary<NSString *, id> *dict = [@{SDLNamePressAvailable:@YES, - SDLNameMultiTouchAvailable:@NO, - SDLNameDoublePressAvailable:@NO} mutableCopy]; + NSMutableDictionary<NSString *, id> *dict = [@{SDLRPCParameterNamePressAvailable:@YES, + SDLRPCParameterNameMultiTouchAvailable:@NO, + SDLRPCParameterNameDoublePressAvailable:@NO} mutableCopy]; SDLTouchEventCapabilities* testStruct = [[SDLTouchEventCapabilities alloc] initWithDictionary:dict]; expect(testStruct.pressAvailable).to(equal(@YES)); diff --git a/SmartDeviceLinkTests/RPCSpecs/StructSpecs/SDLTouchEventSpec.m b/SmartDeviceLinkTests/RPCSpecs/StructSpecs/SDLTouchEventSpec.m index 0419916e5..1939c356e 100644 --- a/SmartDeviceLinkTests/RPCSpecs/StructSpecs/SDLTouchEventSpec.m +++ b/SmartDeviceLinkTests/RPCSpecs/StructSpecs/SDLTouchEventSpec.m @@ -10,7 +10,7 @@ #import "SDLTouchEvent.h" #import "SDLTouchCoord.h" -#import "SDLNames.h" +#import "SDLRPCParameterNames.h" QuickSpecBegin(SDLTouchEventSpec) @@ -30,9 +30,9 @@ describe(@"Getter/Setter Tests", ^ { }); it(@"Should get correctly when initialized", ^ { - NSMutableDictionary<NSString *, id> *dict = [@{SDLNameId:@3, - SDLNameTimestamp:[@[@23, @52, @41345234] mutableCopy], - SDLNameCoordinate:[@[coord] mutableCopy]} mutableCopy]; + NSMutableDictionary<NSString *, id> *dict = [@{SDLRPCParameterNameId:@3, + SDLRPCParameterNameTS:[@[@23, @52, @41345234] mutableCopy], + SDLRPCParameterNameCoordinate:[@[coord] mutableCopy]} mutableCopy]; SDLTouchEvent* testStruct = [[SDLTouchEvent alloc] initWithDictionary:dict]; expect(testStruct.touchEventId).to(equal(@3)); diff --git a/SmartDeviceLinkTests/RPCSpecs/StructSpecs/SDLTurnSpec.m b/SmartDeviceLinkTests/RPCSpecs/StructSpecs/SDLTurnSpec.m index c445da76e..defce62e7 100644 --- a/SmartDeviceLinkTests/RPCSpecs/StructSpecs/SDLTurnSpec.m +++ b/SmartDeviceLinkTests/RPCSpecs/StructSpecs/SDLTurnSpec.m @@ -9,7 +9,7 @@ #import <Nimble/Nimble.h> #import "SDLTurn.h" -#import "SDLNames.h" +#import "SDLRPCParameterNames.h" #import "SDLImage.h" QuickSpecBegin(SDLTurnSpec) @@ -28,8 +28,8 @@ describe(@"Getter/Setter Tests", ^ { }); it(@"Should get correctly when initialized", ^ { - NSMutableDictionary<NSString *, id> *dict = [@{SDLNameNavigationText:@"NAVTEXT", - SDLNameTurnIcon:image} mutableCopy]; + NSMutableDictionary<NSString *, id> *dict = [@{SDLRPCParameterNameNavigationText:@"NAVTEXT", + SDLRPCParameterNameTurnIcon:image} mutableCopy]; SDLTurn* testStruct = [[SDLTurn alloc] initWithDictionary:dict]; expect(testStruct.navigationText).to(equal(@"NAVTEXT")); diff --git a/SmartDeviceLinkTests/RPCSpecs/StructSpecs/SDLVehicleDataResultSpec.m b/SmartDeviceLinkTests/RPCSpecs/StructSpecs/SDLVehicleDataResultSpec.m index fba4445bc..0c1c6c899 100644 --- a/SmartDeviceLinkTests/RPCSpecs/StructSpecs/SDLVehicleDataResultSpec.m +++ b/SmartDeviceLinkTests/RPCSpecs/StructSpecs/SDLVehicleDataResultSpec.m @@ -11,7 +11,7 @@ #import "SDLVehicleDataResult.h" #import "SDLVehicleDataResultCode.h" #import "SDLVehicleDataType.h" -#import "SDLNames.h" +#import "SDLRPCParameterNames.h" QuickSpecBegin(SDLVehicleDataResultSpec) @@ -27,8 +27,8 @@ describe(@"Getter/Setter Tests", ^ { }); it(@"Should get correctly when initialized", ^ { - NSMutableDictionary* dict = [@{SDLNameDataType:SDLVehicleDataTypeAirbagStatus, - SDLNameResultCode:SDLVehicleDataResultCodeDisallowed} mutableCopy]; + NSMutableDictionary* dict = [@{SDLRPCParameterNameDataType:SDLVehicleDataTypeAirbagStatus, + SDLRPCParameterNameResultCode:SDLVehicleDataResultCodeDisallowed} mutableCopy]; SDLVehicleDataResult* testStruct = [[SDLVehicleDataResult alloc] initWithDictionary:dict]; expect(testStruct.dataType).to(equal(SDLVehicleDataTypeAirbagStatus)); diff --git a/SmartDeviceLinkTests/RPCSpecs/StructSpecs/SDLVehicleTypeSpec.m b/SmartDeviceLinkTests/RPCSpecs/StructSpecs/SDLVehicleTypeSpec.m index eefc4618b..a4f3efa0d 100644 --- a/SmartDeviceLinkTests/RPCSpecs/StructSpecs/SDLVehicleTypeSpec.m +++ b/SmartDeviceLinkTests/RPCSpecs/StructSpecs/SDLVehicleTypeSpec.m @@ -9,7 +9,7 @@ #import <Nimble/Nimble.h> #import "SDLVehicleType.h" -#import "SDLNames.h" +#import "SDLRPCParameterNames.h" QuickSpecBegin(SDLVehicleTypeSpec) @@ -29,10 +29,10 @@ describe(@"Getter/Setter Tests", ^ { }); it(@"Should get correctly when initialized", ^ { - NSMutableDictionary<NSString *, id> *dict = [@{SDLNameMake:@"Make", - SDLNameModel:@"Model", - SDLNameModelYear:@"3.141*10^36", - SDLNameTrim:@"AE"} mutableCopy]; + NSMutableDictionary<NSString *, id> *dict = [@{SDLRPCParameterNameMake:@"Make", + SDLRPCParameterNameModel:@"Model", + SDLRPCParameterNameModelYear:@"3.141*10^36", + SDLRPCParameterNameTrim:@"AE"} mutableCopy]; SDLVehicleType* testStruct = [[SDLVehicleType alloc] initWithDictionary:dict]; expect(testStruct.make).to(equal(@"Make")); diff --git a/SmartDeviceLinkTests/RPCSpecs/StructSpecs/SDLVideoStreamingCapabilitySpec.m b/SmartDeviceLinkTests/RPCSpecs/StructSpecs/SDLVideoStreamingCapabilitySpec.m index ce42ce9d2..274d625d5 100644 --- a/SmartDeviceLinkTests/RPCSpecs/StructSpecs/SDLVideoStreamingCapabilitySpec.m +++ b/SmartDeviceLinkTests/RPCSpecs/StructSpecs/SDLVideoStreamingCapabilitySpec.m @@ -11,7 +11,7 @@ #import <Quick/Quick.h> #import <Nimble/Nimble.h> -#import "SDLNames.h" +#import "SDLRPCParameterNames.h" #import "SDLImageResolution.h" #import "SDLVideoStreamingCapability.h" #import "SDLVideoStreamingCodec.h" @@ -39,10 +39,10 @@ describe(@"Initialization tests", ^{ NSArray<SDLVideoStreamingFormat *> *formatArray = @[format1, format2]; - NSMutableDictionary* dict = [@{SDLNamePreferredResolution: resolution, - SDLNameMaxBitrate: maxBitrate, - SDLNameSupportedFormats: formatArray, - SDLNameHapticSpatialDataSupported: hapticDataSupported} mutableCopy]; + NSMutableDictionary* dict = [@{SDLRPCParameterNamePreferredResolution: resolution, + SDLRPCParameterNameMaxBitrate: maxBitrate, + SDLRPCParameterNameSupportedFormats: formatArray, + SDLRPCParameterNameHapticSpatialDataSupported: hapticDataSupported} mutableCopy]; SDLVideoStreamingCapability* testStruct = [[SDLVideoStreamingCapability alloc] initWithDictionary:dict]; diff --git a/SmartDeviceLinkTests/RPCSpecs/StructSpecs/SDLVideoStreamingFormatSpec.m b/SmartDeviceLinkTests/RPCSpecs/StructSpecs/SDLVideoStreamingFormatSpec.m index 551110ee8..a6b386738 100644 --- a/SmartDeviceLinkTests/RPCSpecs/StructSpecs/SDLVideoStreamingFormatSpec.m +++ b/SmartDeviceLinkTests/RPCSpecs/StructSpecs/SDLVideoStreamingFormatSpec.m @@ -11,7 +11,7 @@ #import <Quick/Quick.h> #import <Nimble/Nimble.h> -#import "SDLNames.h" +#import "SDLRPCParameterNames.h" #import "SDLVideoStreamingCodec.h" #import "SDLVideoStreamingFormat.h" #import "SDLVideoStreamingProtocol.h" @@ -20,8 +20,8 @@ QuickSpecBegin(SDLVideoStreamingFormatSpec) describe(@"Initialization tests", ^{ it(@"Should get correctly when initialized with a dictionary", ^ { - NSMutableDictionary* dict = [@{SDLNameVideoProtocol: SDLVideoStreamingProtocolRAW, - SDLNameVideoCodec: SDLVideoStreamingCodecH264} mutableCopy]; + NSMutableDictionary* dict = [@{SDLRPCParameterNameVideoProtocol: SDLVideoStreamingProtocolRAW, + SDLRPCParameterNameVideoCodec: SDLVideoStreamingCodecH264} mutableCopy]; SDLVideoStreamingFormat* testStruct = [[SDLVideoStreamingFormat alloc] initWithDictionary:dict]; expect(testStruct.protocol).to(equal(SDLVideoStreamingProtocolRAW)); diff --git a/SmartDeviceLinkTests/RPCSpecs/StructSpecs/SDLVrHelpItemSpec.m b/SmartDeviceLinkTests/RPCSpecs/StructSpecs/SDLVrHelpItemSpec.m index 307d92621..ea2153359 100644 --- a/SmartDeviceLinkTests/RPCSpecs/StructSpecs/SDLVrHelpItemSpec.m +++ b/SmartDeviceLinkTests/RPCSpecs/StructSpecs/SDLVrHelpItemSpec.m @@ -9,7 +9,7 @@ #import <Nimble/Nimble.h> #import "SDLImage.h" -#import "SDLNames.h" +#import "SDLRPCParameterNames.h" #import "SDLVrHelpItem.h" @@ -31,9 +31,9 @@ describe(@"Getter/Setter Tests", ^ { }); it(@"Should get correctly when initialized", ^ { - NSMutableDictionary<NSString *, id> *dict = [@{SDLNameText:@"DON'T PANIC", - SDLNameImage:image, - SDLNamePosition:@42} mutableCopy]; + NSMutableDictionary<NSString *, id> *dict = [@{SDLRPCParameterNameText:@"DON'T PANIC", + SDLRPCParameterNameImage:image, + SDLRPCParameterNamePosition:@42} mutableCopy]; SDLVRHelpItem* testStruct = [[SDLVRHelpItem alloc] initWithDictionary:dict]; expect(testStruct.text).to(equal(@"DON'T PANIC")); diff --git a/SmartDeviceLinkTests/RPCSpecs/StructSpecs/SDLWeatherAlertSpec.m b/SmartDeviceLinkTests/RPCSpecs/StructSpecs/SDLWeatherAlertSpec.m new file mode 100644 index 000000000..e4c34b529 --- /dev/null +++ b/SmartDeviceLinkTests/RPCSpecs/StructSpecs/SDLWeatherAlertSpec.m @@ -0,0 +1,94 @@ +// +// SDLWeatherAlertSpec.m +// SmartDeviceLinkTests +// +// Created by Nicole on 2/7/19. +// Copyright © 2019 smartdevicelink. All rights reserved. +// + +#import <Quick/Quick.h> +#import <Nimble/Nimble.h> + +#import "SDLDateTime.h" +#import "SDLRPCParameterNames.h" +#import "SDLWeatherAlert.h" + +QuickSpecBegin(SDLWeatherAlertSpec) + +describe(@"Getter/Setter Tests", ^{ + __block NSString *testTitle = nil; + __block NSString *testSummary = nil; + __block SDLDateTime *testExpires = nil; + __block NSArray<NSString *> *testRegions = nil; + __block NSString *testSeverity = nil; + __block SDLDateTime *testTimeIssued = nil; + + beforeEach(^{ + testTitle = @"testTitle"; + testSummary = @"testSummary"; + testExpires = [[SDLDateTime alloc] initWithHour:5 minute:1 second:2 millisecond:2]; + testRegions = @[@"testRegion1" , @"testRegion2"]; + testSeverity = @"testSeverity"; + testTimeIssued = [[SDLDateTime alloc] initWithHour:3 minute:1 second:1 millisecond:23 day:1 month:2 year:1223]; + }); + + it(@"Should set and get correctly", ^{ + SDLWeatherAlert *testStruct = [[SDLWeatherAlert alloc] init]; + testStruct.title = testTitle; + testStruct.summary = testSummary; + testStruct.expires = testExpires; + testStruct.regions = testRegions; + testStruct.severity = testSeverity; + testStruct.timeIssued = testTimeIssued; + + expect(testStruct.title).to(equal(testTitle)); + expect(testStruct.summary).to(equal(testSummary)); + expect(testStruct.expires).to(equal(testExpires)); + expect(testStruct.regions).to(equal(testRegions)); + expect(testStruct.severity).to(equal(testSeverity)); + expect(testStruct.timeIssued).to(equal(testTimeIssued)); + }); + + it(@"Should get correctly when initialized with a dictionary", ^{ + NSDictionary *dict = @{SDLRPCParameterNameTitle:testTitle, + SDLRPCParameterNameSummary:testSummary, + SDLRPCParameterNameExpires:testExpires, + SDLRPCParameterNameRegions:testRegions, + SDLRPCParameterNameSeverity:testSeverity, + SDLRPCParameterNameTimeIssued:testTimeIssued + }; + SDLWeatherAlert *testStruct = [[SDLWeatherAlert alloc] initWithDictionary:dict]; + + expect(testStruct.title).to(equal(testTitle)); + expect(testStruct.summary).to(equal(testSummary)); + expect(testStruct.expires).to(equal(testExpires)); + expect(testStruct.regions).to(equal(testRegions)); + expect(testStruct.severity).to(equal(testSeverity)); + expect(testStruct.timeIssued).to(equal(testTimeIssued)); + }); + + it(@"Should get correctly when initialized with a convenience init", ^{ + SDLWeatherAlert *testStruct = [[SDLWeatherAlert alloc] initWithTitle:testTitle summary:testSummary expires:testExpires regions:testRegions severity:testSeverity timeIssued:testTimeIssued]; + + expect(testStruct.title).to(equal(testTitle)); + expect(testStruct.summary).to(equal(testSummary)); + expect(testStruct.expires).to(equal(testExpires)); + expect(testStruct.regions).to(equal(testRegions)); + expect(testStruct.severity).to(equal(testSeverity)); + expect(testStruct.timeIssued).to(equal(testTimeIssued)); + }); + + it(@"Should return nil if not set", ^{ + SDLWeatherAlert *testStruct = [[SDLWeatherAlert alloc] init]; + + expect(testStruct.title).to(beNil()); + expect(testStruct.summary).to(beNil()); + expect(testStruct.expires).to(beNil()); + expect(testStruct.regions).to(beNil()); + expect(testStruct.severity).to(beNil()); + expect(testStruct.timeIssued).to(beNil()); + }); +}); + +QuickSpecEnd + diff --git a/SmartDeviceLinkTests/RPCSpecs/StructSpecs/SDLWeatherDataSpec.m b/SmartDeviceLinkTests/RPCSpecs/StructSpecs/SDLWeatherDataSpec.m new file mode 100644 index 000000000..757162aab --- /dev/null +++ b/SmartDeviceLinkTests/RPCSpecs/StructSpecs/SDLWeatherDataSpec.m @@ -0,0 +1,212 @@ +// +// SDLWeatherDataSpec.m +// SmartDeviceLinkTests +// +// Created by Nicole on 2/7/19. +// Copyright © 2019 smartdevicelink. All rights reserved. +// + +#import <Quick/Quick.h> +#import <Nimble/Nimble.h> + +#import "SDLDateTime.h" +#import "SDLRPCParameterNames.h" +#import "SDLTemperature.h" +#import "SDLWeatherData.h" + +QuickSpecBegin(SDLWeatherDataSpec) + +describe(@"Getter/Setter Tests", ^{ + __block SDLTemperature *testCurrentTemp = nil; + __block SDLTemperature *testTempHigh = nil; + __block SDLTemperature *testTempLow = nil; + __block SDLTemperature *testApparentTemp = nil; + __block SDLTemperature *testApparentTempHigh = nil; + __block SDLTemperature *testApparentTempLow = nil; + __block NSString *testWeatherSummary = nil; + __block SDLDateTime *testTime = nil; + __block float testHumidity = 0.175; + __block float testCloudCover = 0.2; + __block float testMoonPhase = 0.1; + __block int testWindBearing = 1.65; + __block float testWindGust = 34.2; + __block float testWindSpeed = 12.01; + __block int testNearestStormBearing = 1; + __block int testNearestStormDistance = 45; + __block float testPrecipAccumulation = 2.34; + __block float testPrecipIntensity = 4.55; + __block float testPrecipProbability = 0.45; + __block NSString *testPrecipType = nil; + __block float testVisibility = 0.1; + __block NSString *testWeatherIconImageName = nil; + + beforeEach(^{ + testCurrentTemp = [[SDLTemperature alloc] initWithUnit:SDLTemperatureUnitFahrenheit value:2]; + testTempHigh = [[SDLTemperature alloc] initWithUnit:SDLTemperatureUnitFahrenheit value:3]; + testTempLow = [[SDLTemperature alloc] initWithUnit:SDLTemperatureUnitFahrenheit value:4]; + testApparentTemp = [[SDLTemperature alloc] initWithUnit:SDLTemperatureUnitFahrenheit value:5]; + testApparentTempHigh = [[SDLTemperature alloc] initWithUnit:SDLTemperatureUnitFahrenheit value:6]; + testApparentTempLow = [[SDLTemperature alloc] initWithUnit:SDLTemperatureUnitFahrenheit value:7]; + testWeatherSummary = @"testWeatherSummary"; + testTime = [[SDLDateTime alloc] initWithHour:4 minute:5]; + testPrecipType = @"testPrecipType"; + testWeatherIconImageName = @"testWeatherIconImageName"; + }); + + it(@"Should set and get correctly", ^{ + SDLWeatherData *testStruct = [[SDLWeatherData alloc] init]; + testStruct.currentTemperature = testCurrentTemp; + testStruct.temperatureHigh = testTempHigh; + testStruct.temperatureLow = testTempLow; + testStruct.apparentTemperature = testApparentTemp; + testStruct.apparentTemperatureHigh = testApparentTempHigh; + testStruct.apparentTemperatureLow = testApparentTempLow; + testStruct.weatherSummary = testWeatherSummary; + testStruct.time = testTime; + testStruct.humidity = @(testHumidity); + testStruct.cloudCover = @(testCloudCover); + testStruct.moonPhase = @(testMoonPhase); + testStruct.windBearing = @(testWindBearing); + testStruct.windGust = @(testWindGust); + testStruct.windSpeed = @(testWindSpeed); + testStruct.nearestStormBearing = @(testNearestStormBearing); + testStruct.nearestStormDistance = @(testNearestStormDistance); + testStruct.precipAccumulation = @(testPrecipAccumulation); + testStruct.precipIntensity = @(testPrecipIntensity); + testStruct.precipProbability = @(testPrecipProbability); + testStruct.precipType = testPrecipType; + testStruct.visibility = @(testVisibility); + testStruct.weatherIconImageName = testWeatherIconImageName; + + expect(testStruct.currentTemperature).to(equal(testCurrentTemp)); + expect(testStruct.temperatureHigh).to(equal(testTempHigh)); + expect(testStruct.temperatureLow).to(equal(testTempLow)); + expect(testStruct.apparentTemperature).to(equal(testApparentTemp)); + expect(testStruct.apparentTemperatureHigh).to(equal(testApparentTempHigh)); + expect(testStruct.apparentTemperatureLow).to(equal(testApparentTempLow)); + expect(testStruct.weatherSummary).to(equal(testWeatherSummary)); + expect(testStruct.time).to(equal(testTime)); + expect(testStruct.humidity).to(equal(testHumidity)); + expect(testStruct.cloudCover).to(equal(testCloudCover)); + expect(testStruct.moonPhase).to(equal(testMoonPhase)); + expect(testStruct.windBearing).to(equal(testWindBearing)); + expect(testStruct.windGust).to(equal(testWindGust)); + expect(testStruct.windSpeed).to(equal(testWindSpeed)); + expect(testStruct.nearestStormBearing).to(equal(testNearestStormBearing)); + expect(testStruct.nearestStormDistance).to(equal(testNearestStormDistance)); + expect(testStruct.precipAccumulation).to(equal(testPrecipAccumulation)); + expect(testStruct.precipIntensity).to(equal(testPrecipIntensity)); + expect(testStruct.precipProbability).to(equal(testPrecipProbability)); + expect(testStruct.precipType).to(equal(testPrecipType)); + expect(testStruct.visibility).to(equal(testVisibility)); + expect(testStruct.weatherIconImageName).to(equal(testWeatherIconImageName)); + }); + + it(@"Should get correctly when initialized with a dictionary", ^{ + NSDictionary *dict = @{SDLRPCParameterNameCurrentTemperature:testCurrentTemp, + SDLRPCParameterNameTemperatureHigh:testTempHigh, + SDLRPCParameterNameTemperatureLow:testTempLow, + SDLRPCParameterNameApparentTemperature:testApparentTemp, + SDLRPCParameterNameApparentTemperatureHigh:testApparentTempHigh, + SDLRPCParameterNameApparentTemperatureLow:testApparentTempLow, + SDLRPCParameterNameWeatherSummary:testWeatherSummary, + SDLRPCParameterNameTime:testTime, + SDLRPCParameterNameHumidity:@(testHumidity), + SDLRPCParameterNameCloudCover:@(testCloudCover), + SDLRPCParameterNameMoonPhase:@(testMoonPhase), + SDLRPCParameterNameWindBearing:@(testWindBearing), + SDLRPCParameterNameWindGust:@(testWindGust), + SDLRPCParameterNameWindSpeed:@(testWindSpeed), + SDLRPCParameterNameNearestStormBearing:@(testNearestStormBearing), + SDLRPCParameterNameNearestStormDistance:@(testNearestStormDistance), + SDLRPCParameterNamePrecipAccumulation:@(testPrecipAccumulation), + SDLRPCParameterNamePrecipIntensity:@(testPrecipIntensity), + SDLRPCParameterNamePrecipProbability:@(testPrecipProbability), + SDLRPCParameterNamePrecipType:testPrecipType, + SDLRPCParameterNameVisibility:@(testVisibility), + SDLRPCParameterNameWeatherIconImageName:testWeatherIconImageName + }; + SDLWeatherData *testStruct = [[SDLWeatherData alloc] initWithDictionary:dict]; + + expect(testStruct.currentTemperature).to(equal(testCurrentTemp)); + expect(testStruct.temperatureHigh).to(equal(testTempHigh)); + expect(testStruct.temperatureLow).to(equal(testTempLow)); + expect(testStruct.apparentTemperature).to(equal(testApparentTemp)); + expect(testStruct.apparentTemperatureHigh).to(equal(testApparentTempHigh)); + expect(testStruct.apparentTemperatureLow).to(equal(testApparentTempLow)); + expect(testStruct.weatherSummary).to(equal(testWeatherSummary)); + expect(testStruct.time).to(equal(testTime)); + expect(testStruct.humidity).to(equal(testHumidity)); + expect(testStruct.cloudCover).to(equal(testCloudCover)); + expect(testStruct.moonPhase).to(equal(testMoonPhase)); + expect(testStruct.windBearing).to(equal(testWindBearing)); + expect(testStruct.windGust).to(equal(testWindGust)); + expect(testStruct.windSpeed).to(equal(testWindSpeed)); + expect(testStruct.nearestStormBearing).to(equal(testNearestStormBearing)); + expect(testStruct.nearestStormDistance).to(equal(testNearestStormDistance)); + expect(testStruct.precipAccumulation).to(equal(testPrecipAccumulation)); + expect(testStruct.precipIntensity).to(equal(testPrecipIntensity)); + expect(testStruct.precipProbability).to(equal(testPrecipProbability)); + expect(testStruct.precipType).to(equal(testPrecipType)); + expect(testStruct.visibility).to(equal(testVisibility)); + expect(testStruct.weatherIconImageName).to(equal(testWeatherIconImageName)); + }); + + it(@"Should get correctly when initialized with a convenience init", ^{ + SDLWeatherData *testStruct = [[SDLWeatherData alloc] initWithCurrentTemperature:testCurrentTemp temperatureHigh:testTempHigh temperatureLow:testTempLow apparentTemperature:testApparentTemp apparentTemperatureHigh:testApparentTempHigh apparentTemperatureLow:testApparentTempLow weatherSummary:testWeatherSummary time:testTime humidity:@(testHumidity) cloudCover:@(testCloudCover) moonPhase:@(testMoonPhase) windBearing:@(testWindBearing) windGust:@(testWindGust) windSpeed:@(testWindSpeed) nearestStormBearing:@(testNearestStormBearing) nearestStormDistance:@(testNearestStormDistance) precipAccumulation:@(testPrecipAccumulation) precipIntensity:@(testPrecipIntensity) precipProbability:@(testPrecipProbability) precipType:testPrecipType visibility:@(testVisibility) weatherIconImageName:testWeatherIconImageName]; + + expect(testStruct.currentTemperature).to(equal(testCurrentTemp)); + expect(testStruct.temperatureHigh).to(equal(testTempHigh)); + expect(testStruct.temperatureLow).to(equal(testTempLow)); + expect(testStruct.apparentTemperature).to(equal(testApparentTemp)); + expect(testStruct.apparentTemperatureHigh).to(equal(testApparentTempHigh)); + expect(testStruct.apparentTemperatureLow).to(equal(testApparentTempLow)); + expect(testStruct.weatherSummary).to(equal(testWeatherSummary)); + expect(testStruct.time).to(equal(testTime)); + expect(testStruct.humidity).to(equal(testHumidity)); + expect(testStruct.cloudCover).to(equal(testCloudCover)); + expect(testStruct.moonPhase).to(equal(testMoonPhase)); + expect(testStruct.windBearing).to(equal(testWindBearing)); + expect(testStruct.windGust).to(equal(testWindGust)); + expect(testStruct.windSpeed).to(equal(testWindSpeed)); + expect(testStruct.nearestStormBearing).to(equal(testNearestStormBearing)); + expect(testStruct.nearestStormDistance).to(equal(testNearestStormDistance)); + expect(testStruct.precipAccumulation).to(equal(testPrecipAccumulation)); + expect(testStruct.precipIntensity).to(equal(testPrecipIntensity)); + expect(testStruct.precipProbability).to(equal(testPrecipProbability)); + expect(testStruct.precipType).to(equal(testPrecipType)); + expect(testStruct.visibility).to(equal(testVisibility)); + expect(testStruct.weatherIconImageName).to(equal(testWeatherIconImageName)); + }); + + + it(@"Should return nil if not set", ^{ + SDLWeatherData *testStruct = [[SDLWeatherData alloc] init]; + + expect(testStruct.currentTemperature).to(beNil()); + expect(testStruct.temperatureHigh).to(beNil()); + expect(testStruct.temperatureLow).to(beNil()); + expect(testStruct.apparentTemperature).to(beNil()); + expect(testStruct.apparentTemperatureHigh).to(beNil()); + expect(testStruct.apparentTemperatureLow).to(beNil()); + expect(testStruct.weatherSummary).to(beNil()); + expect(testStruct.time).to(beNil()); + expect(testStruct.humidity).to(beNil()); + expect(testStruct.cloudCover).to(beNil()); + expect(testStruct.moonPhase).to(beNil()); + expect(testStruct.windBearing).to(beNil()); + expect(testStruct.windGust).to(beNil()); + expect(testStruct.windSpeed).to(beNil()); + expect(testStruct.nearestStormBearing).to(beNil()); + expect(testStruct.nearestStormDistance).to(beNil()); + expect(testStruct.precipAccumulation).to(beNil()); + expect(testStruct.precipIntensity).to(beNil()); + expect(testStruct.precipProbability).to(beNil()); + expect(testStruct.precipType).to(beNil()); + expect(testStruct.visibility).to(beNil()); + expect(testStruct.weatherIconImageName).to(beNil()); + }); +}); + +QuickSpecEnd + diff --git a/SmartDeviceLinkTests/RPCSpecs/StructSpecs/SDLWeatherServiceDataSpec.m b/SmartDeviceLinkTests/RPCSpecs/StructSpecs/SDLWeatherServiceDataSpec.m new file mode 100644 index 000000000..dadf888a4 --- /dev/null +++ b/SmartDeviceLinkTests/RPCSpecs/StructSpecs/SDLWeatherServiceDataSpec.m @@ -0,0 +1,115 @@ +// +// SDLWeatherServiceDataSpec.m +// SmartDeviceLinkTests +// +// Created by Nicole on 2/8/19. +// Copyright © 2019 smartdevicelink. All rights reserved. +// + +#import <Quick/Quick.h> +#import <Nimble/Nimble.h> + +#import "SDLLocationDetails.h" +#import "SDLRPCParameterNames.h" +#import "SDLWeatherData.h" +#import "SDLWeatherAlert.h" +#import "SDLWeatherServiceData.h" + +QuickSpecBegin(SDLWeatherServiceDataSpec) + +describe(@"Getter/Setter Tests", ^{ + __block SDLLocationDetails *testLocation = nil; + __block SDLWeatherData *testCurrentForecast = nil; + __block NSArray<SDLWeatherData *> *testMinuteForecast = nil; + __block NSArray<SDLWeatherData *> *testHourlyForecast = nil; + __block NSArray<SDLWeatherData *> *testMultidayForecast = nil; + __block NSArray<SDLWeatherAlert *> *testAlerts = nil; + + beforeEach(^{ + testLocation = [[SDLLocationDetails alloc] init]; + testLocation.locationName = @"testLocationName"; + + SDLWeatherData *testWeatherDataA = [[SDLWeatherData alloc] initWithDictionary:@{SDLRPCParameterNameWeatherSummary:@"testWeatherDataA"}]; + SDLWeatherData *testWeatherDataB = [[SDLWeatherData alloc] initWithDictionary:@{SDLRPCParameterNameWeatherSummary:@"testWeatherDataB"}]; + SDLWeatherData *testWeatherDataC = [[SDLWeatherData alloc] initWithDictionary:@{SDLRPCParameterNameWeatherSummary:@"testWeatherDataC"}]; + testCurrentForecast = testWeatherDataA; + testMinuteForecast = @[testWeatherDataA]; + testHourlyForecast = @[testWeatherDataB, testWeatherDataA]; + testMultidayForecast = @[testWeatherDataA, testWeatherDataC]; + + SDLWeatherAlert *testWeatherAlertA = [[SDLWeatherAlert alloc] initWithDictionary:@{SDLRPCParameterNameTitle:@"testWeatherAlertA"}]; + testAlerts = @[testWeatherAlertA]; + }); + + it(@"Should set and get correctly", ^{ + SDLWeatherServiceData *testStruct = [[SDLWeatherServiceData alloc] init]; + testStruct.location = testLocation; + testStruct.currentForecast = testCurrentForecast; + testStruct.minuteForecast = testMinuteForecast; + testStruct.hourlyForecast = testHourlyForecast; + testStruct.multidayForecast = testMultidayForecast; + testStruct.alerts = testAlerts; + + expect(testStruct.location).to(equal(testLocation)); + expect(testStruct.currentForecast).to(equal(testCurrentForecast)); + expect(testStruct.minuteForecast).to(equal(testMinuteForecast)); + expect(testStruct.hourlyForecast).to(equal(testHourlyForecast)); + expect(testStruct.multidayForecast).to(equal(testMultidayForecast)); + expect(testStruct.alerts).to(equal(testAlerts)); + }); + + it(@"Should get correctly when initialized with a dictionary", ^{ + NSDictionary *dict = @{SDLRPCParameterNameLocation:testLocation, + SDLRPCParameterNameCurrentForecast:testCurrentForecast, + SDLRPCParameterNameMinuteForecast:testMinuteForecast, + SDLRPCParameterNameHourlyForecast:testHourlyForecast, + SDLRPCParameterNameMultidayForecast:testMultidayForecast, + SDLRPCParameterNameAlerts:testAlerts + }; + SDLWeatherServiceData *testStruct = [[SDLWeatherServiceData alloc] initWithDictionary:dict]; + + expect(testStruct.location).to(equal(testLocation)); + expect(testStruct.currentForecast).to(equal(testCurrentForecast)); + expect(testStruct.minuteForecast).to(equal(testMinuteForecast)); + expect(testStruct.hourlyForecast).to(equal(testHourlyForecast)); + expect(testStruct.multidayForecast).to(equal(testMultidayForecast)); + expect(testStruct.alerts).to(equal(testAlerts)); + }); + + it(@"Should get correctly when initialized with initWithLocation:", ^{ + SDLWeatherServiceData *testStruct = [[SDLWeatherServiceData alloc] initWithLocation:testLocation]; + + expect(testStruct.location).to(equal(testLocation)); + expect(testStruct.currentForecast).to(beNil()); + expect(testStruct.minuteForecast).to(beNil()); + expect(testStruct.hourlyForecast).to(beNil()); + expect(testStruct.multidayForecast).to(beNil()); + expect(testStruct.alerts).to(beNil()); + }); + + it(@"Should get correctly when initialized with initWithLocation:currentForecast:currentForecast minuteForecast:hourlyForecast:multidayForecast:alerts:", ^{ + SDLWeatherServiceData *testStruct = [[SDLWeatherServiceData alloc] initWithLocation:testLocation currentForecast:testCurrentForecast minuteForecast:testMinuteForecast hourlyForecast:testHourlyForecast multidayForecast:testMultidayForecast alerts:testAlerts]; + + expect(testStruct.location).to(equal(testLocation)); + expect(testStruct.currentForecast).to(equal(testCurrentForecast)); + expect(testStruct.minuteForecast).to(equal(testMinuteForecast)); + expect(testStruct.hourlyForecast).to(equal(testHourlyForecast)); + expect(testStruct.multidayForecast).to(equal(testMultidayForecast)); + expect(testStruct.alerts).to(equal(testAlerts)); + }); + + it(@"Should return nil if not set", ^{ + SDLWeatherServiceData *testStruct = [[SDLWeatherServiceData alloc] init]; + + expect(testStruct.location).to(beNil()); + expect(testStruct.currentForecast).to(beNil()); + expect(testStruct.minuteForecast).to(beNil()); + expect(testStruct.hourlyForecast).to(beNil()); + expect(testStruct.multidayForecast).to(beNil()); + expect(testStruct.alerts).to(beNil()); + }); +}); + +QuickSpecEnd + + diff --git a/SmartDeviceLinkTests/RPCSpecs/StructSpecs/SDLWeatherServiceManifestSpec.m b/SmartDeviceLinkTests/RPCSpecs/StructSpecs/SDLWeatherServiceManifestSpec.m new file mode 100644 index 000000000..1a495d633 --- /dev/null +++ b/SmartDeviceLinkTests/RPCSpecs/StructSpecs/SDLWeatherServiceManifestSpec.m @@ -0,0 +1,82 @@ +// +// SDLWeatherServiceManifestSpec.m +// SmartDeviceLinkTests +// +// Created by Nicole on 2/8/19. +// Copyright © 2019 smartdevicelink. All rights reserved. +// + +#import <Quick/Quick.h> +#import <Nimble/Nimble.h> + +#import "SDLRPCParameterNames.h" +#import "SDLWeatherServiceManifest.h" + +QuickSpecBegin(SDLWeatherServiceManifestSpec) + +describe(@"Getter/Setter Tests", ^{ + __block BOOL testCurrentForecastSupported = nil; + __block int testMaxMultidayForecastAmount = 3; + __block int testMaxHourlyForecastAmount = 78; + __block int testMaxMinutelyForecastAmount = 13; + __block BOOL testWeatherForLocationSupported = nil; + + beforeEach(^{ + testCurrentForecastSupported = false; + testCurrentForecastSupported = true; + }); + + it(@"Should set and get correctly", ^{ + SDLWeatherServiceManifest *testStruct = [[SDLWeatherServiceManifest alloc] init]; + testStruct.currentForecastSupported = @(testCurrentForecastSupported); + testStruct.maxMultidayForecastAmount = @(testMaxMultidayForecastAmount); + testStruct.maxHourlyForecastAmount = @(testMaxHourlyForecastAmount); + testStruct.maxMinutelyForecastAmount = @(testMaxMinutelyForecastAmount); + testStruct.weatherForLocationSupported = @(testWeatherForLocationSupported); + + expect(testStruct.currentForecastSupported).to(equal(testCurrentForecastSupported)); + expect(testStruct.maxMultidayForecastAmount).to(equal(testMaxMultidayForecastAmount)); + expect(testStruct.maxHourlyForecastAmount).to(equal(testMaxHourlyForecastAmount)); + expect(testStruct.maxMinutelyForecastAmount).to(equal(testMaxMinutelyForecastAmount)); + expect(testStruct.weatherForLocationSupported).to(equal(testWeatherForLocationSupported)); + }); + + it(@"Should get correctly when initialized with a dictionary", ^{ + NSDictionary *dict = @{SDLRPCParameterNameCurrentForecastSupported:@(testCurrentForecastSupported), + SDLRPCParameterNameMaxMultidayForecastAmount:@(testMaxMultidayForecastAmount), + SDLRPCParameterNameMaxHourlyForecastAmount:@(testMaxHourlyForecastAmount), + SDLRPCParameterNameMaxMinutelyForecastAmount:@(testMaxMinutelyForecastAmount), + SDLRPCParameterNameWeatherForLocationSupported:@(testWeatherForLocationSupported) + }; + SDLWeatherServiceManifest *testStruct = [[SDLWeatherServiceManifest alloc] initWithDictionary:dict]; + + expect(testStruct.currentForecastSupported).to(equal(testCurrentForecastSupported)); + expect(testStruct.maxMultidayForecastAmount).to(equal(testMaxMultidayForecastAmount)); + expect(testStruct.maxHourlyForecastAmount).to(equal(testMaxHourlyForecastAmount)); + expect(testStruct.maxMinutelyForecastAmount).to(equal(testMaxMinutelyForecastAmount)); + expect(testStruct.weatherForLocationSupported).to(equal(testWeatherForLocationSupported)); + }); + + it(@"Should initialize correctly with initWithCurrentForecastSupported:maxMultidayForecastAmount:maxHourlyForecastAmount:maxMinutelyForecastAmount:weatherForLocationSupported:", ^{ + SDLWeatherServiceManifest *testStruct = [[SDLWeatherServiceManifest alloc] initWithCurrentForecastSupported:testCurrentForecastSupported maxMultidayForecastAmount:testMaxMultidayForecastAmount maxHourlyForecastAmount:testMaxHourlyForecastAmount maxMinutelyForecastAmount:testMaxMinutelyForecastAmount weatherForLocationSupported:testWeatherForLocationSupported]; + + expect(testStruct.currentForecastSupported).to(equal(testCurrentForecastSupported)); + expect(testStruct.maxMultidayForecastAmount).to(equal(testMaxMultidayForecastAmount)); + expect(testStruct.maxHourlyForecastAmount).to(equal(testMaxHourlyForecastAmount)); + expect(testStruct.maxMinutelyForecastAmount).to(equal(testMaxMinutelyForecastAmount)); + expect(testStruct.weatherForLocationSupported).to(equal(testWeatherForLocationSupported)); + }); + + it(@"Should return nil if not set", ^{ + SDLWeatherServiceManifest *testStruct = [[SDLWeatherServiceManifest alloc] init]; + + expect(testStruct.currentForecastSupported).to(beNil()); + expect(testStruct.maxMultidayForecastAmount).to(beNil()); + expect(testStruct.maxHourlyForecastAmount).to(beNil()); + expect(testStruct.maxMinutelyForecastAmount).to(beNil()); + expect(testStruct.weatherForLocationSupported).to(beNil()); + }); +}); + +QuickSpecEnd + diff --git a/SmartDeviceLinkTests/RPCSpecs/SuperclassSpecs/SDLRPCMessageSpec.m b/SmartDeviceLinkTests/RPCSpecs/SuperclassSpecs/SDLRPCMessageSpec.m index 57dbd3513..0ace806a0 100644 --- a/SmartDeviceLinkTests/RPCSpecs/SuperclassSpecs/SDLRPCMessageSpec.m +++ b/SmartDeviceLinkTests/RPCSpecs/SuperclassSpecs/SDLRPCMessageSpec.m @@ -9,7 +9,7 @@ #import <Nimble/Nimble.h> #import "SDLRPCMessage.h" -#import "SDLNames.h" +#import "SDLRPCParameterNames.h" QuickSpecBegin(SDLRPCMessageSpec) @@ -21,13 +21,13 @@ describe(@"Readonly Property Tests", ^ { }); it(@"Should get correctly when initialized with dictionary", ^ { - SDLRPCMessage* testMessage = [[SDLRPCMessage alloc] initWithDictionary:[@{SDLNameNotification: - @{SDLNameParameters: + SDLRPCMessage* testMessage = [[SDLRPCMessage alloc] initWithDictionary:[@{SDLRPCParameterNameNotification: + @{SDLRPCParameterNameParameters: @{@"name":@"George"}, - SDLNameOperationName:@"Poorly Named"}} mutableCopy]]; + SDLRPCParameterNameOperationName:@"Poorly Named"}} mutableCopy]]; expect(testMessage.name).to(equal(@"Poorly Named")); - expect(testMessage.messageType).to(equal(SDLNameNotification)); + expect(testMessage.messageType).to(equal(SDLRPCParameterNameNotification)); }); }); @@ -41,10 +41,10 @@ describe(@"Parameter Tests", ^ { }); it(@"Should get correctly when initialized", ^ { - SDLRPCMessage* testMessage = [[SDLRPCMessage alloc] initWithDictionary:[@{SDLNameResponse: - @{SDLNameParameters: + SDLRPCMessage* testMessage = [[SDLRPCMessage alloc] initWithDictionary:[@{SDLRPCParameterNameResponse: + @{SDLRPCParameterNameParameters: @{@"age":@25}, - SDLNameOperationName:@"Nameless"}} mutableCopy]]; + SDLRPCParameterNameOperationName:@"Nameless"}} mutableCopy]]; expect([testMessage getParameters:@"age"]).to(equal(@25)); }); @@ -66,10 +66,10 @@ describe(@"FunctionName Tests", ^ { }); it(@"Should get correctly when initialized", ^ { - SDLRPCMessage* testMessage = [[SDLRPCMessage alloc] initWithDictionary:[@{SDLNameRequest: - @{SDLNameParameters: + SDLRPCMessage* testMessage = [[SDLRPCMessage alloc] initWithDictionary:[@{SDLRPCParameterNameRequest: + @{SDLRPCParameterNameParameters: @{@"age":@25}, - SDLNameOperationName:@"DoNothing"}} mutableCopy]]; + SDLRPCParameterNameOperationName:@"DoNothing"}} mutableCopy]]; expect([testMessage getFunctionName]).to(equal(@"DoNothing")); @@ -79,8 +79,8 @@ describe(@"FunctionName Tests", ^ { }); it(@"Should be nil if not set", ^ { - SDLRPCMessage* testMessage = [[SDLRPCMessage alloc] initWithDictionary:[@{SDLNameNotification: - @{SDLNameParameters: + SDLRPCMessage* testMessage = [[SDLRPCMessage alloc] initWithDictionary:[@{SDLRPCParameterNameNotification: + @{SDLRPCParameterNameParameters: @{}}} mutableCopy]]; expect([testMessage getFunctionName]).to(beNil()); }); @@ -97,10 +97,10 @@ describe(@"BulkDataTests", ^ { }); it(@"Should get correctly when initialized", ^ { - SDLRPCMessage* testMessage = [[SDLRPCMessage alloc] initWithDictionary:[@{SDLNameNotification: - @{SDLNameParameters: + SDLRPCMessage* testMessage = [[SDLRPCMessage alloc] initWithDictionary:[@{SDLRPCParameterNameNotification: + @{SDLRPCParameterNameParameters: @{}}, - SDLNameBulkData:[NSData dataWithBytes:"ImageData" length:strlen("ImageData")]} mutableCopy]]; + SDLRPCParameterNameBulkData:[NSData dataWithBytes:"ImageData" length:strlen("ImageData")]} mutableCopy]]; expect(testMessage.bulkData).to(equal([NSData dataWithBytes:"ImageData" length:strlen("ImageData")])); }); diff --git a/SmartDeviceLinkTests/RPCSpecs/SuperclassSpecs/SDLRPCResponseSpec.m b/SmartDeviceLinkTests/RPCSpecs/SuperclassSpecs/SDLRPCResponseSpec.m index 073135985..edb1a3cab 100644 --- a/SmartDeviceLinkTests/RPCSpecs/SuperclassSpecs/SDLRPCResponseSpec.m +++ b/SmartDeviceLinkTests/RPCSpecs/SuperclassSpecs/SDLRPCResponseSpec.m @@ -8,7 +8,7 @@ #import <Quick/Quick.h> #import <Nimble/Nimble.h> -#import "SDLNames.h" +#import "SDLRPCParameterNames.h" #import "SDLResult.h" #import "SDLRPCResponse.h" @@ -31,19 +31,19 @@ describe(@"Getter/Setter Tests", ^ { }); it(@"Should get correctly when initialized", ^ { - NSMutableDictionary* dict = [@{SDLNameResponse: - @{SDLNameParameters: - @{SDLNameSuccess:@YES, - SDLNameResultCode:SDLNameSuccess, - SDLNameInfo:@"Test Info"}, - SDLNameCorrelationId:@1004, - SDLNameOperationName:SDLNameResponse}} mutableCopy]; + NSMutableDictionary* dict = [@{SDLRPCParameterNameResponse: + @{SDLRPCParameterNameParameters: + @{SDLRPCParameterNameSuccess:@YES, + SDLRPCParameterNameResultCode:SDLRPCParameterNameSuccess, + SDLRPCParameterNameInfo:@"Test Info"}, + SDLRPCParameterNameCorrelationId:@1004, + SDLRPCParameterNameOperationName:SDLRPCParameterNameResponse}} mutableCopy]; SDLRPCResponse* testResponse = [[SDLRPCResponse alloc] initWithDictionary:dict]; - expect(testResponse.getFunctionName).to(equal(SDLNameResponse)); + expect(testResponse.getFunctionName).to(equal(SDLRPCParameterNameResponse)); expect(testResponse.correlationID).to(equal(@1004)); expect(testResponse.success).to(equal(@YES)); - expect(testResponse.resultCode).to(equal(SDLNameSuccess)); + expect(testResponse.resultCode).to(equal(SDLRPCParameterNameSuccess)); expect(testResponse.info).to(equal(@"Test Info")); }); diff --git a/SmartDeviceLinkTests/SDLAsynchronousRPCOperationSpec.m b/SmartDeviceLinkTests/SDLAsynchronousRPCOperationSpec.m new file mode 100644 index 000000000..40fff1d7a --- /dev/null +++ b/SmartDeviceLinkTests/SDLAsynchronousRPCOperationSpec.m @@ -0,0 +1,95 @@ +// +// SDLAsynchronousRPCOperationSpec.m +// SmartDeviceLinkTests +// +// Created by Nicole on 2/20/19. +// Copyright © 2019 smartdevicelink. All rights reserved. +// + +#import <Quick/Quick.h> +#import <Nimble/Nimble.h> + +#import "SDLAppServiceData.h" +#import "SDLGetAppServiceDataResponse.h" +#import "SDLAsynchronousRPCOperation.h" +#import "TestConnectionManager.h" + +QuickSpecBegin(SDLAsynchronousRPCOperationSpec) + +describe(@"sending responses and notifications", ^{ + __block TestConnectionManager *testConnectionManager = nil; + __block SDLAsynchronousRPCOperation *testOperation = nil; + __block NSOperationQueue *testOperationQueue = nil; + + beforeEach(^{ + testOperation = nil; + testConnectionManager = [[TestConnectionManager alloc] init]; + + testOperationQueue = [[NSOperationQueue alloc] init]; + testOperationQueue.name = @"com.sdl.RPCResponse.testqueue"; + testOperationQueue.maxConcurrentOperationCount = 3; + }); + + context(@"when a single request succeeds", ^{ + __block __kindof SDLRPCMessage *sendRPC = nil; + + beforeEach(^{ + sendRPC = [[SDLGetAppServiceDataResponse alloc] initWithAppServiceData:[[SDLAppServiceData alloc] init]]; + }); + + it(@"should correctly send the rpc", ^{ + testOperation = [[SDLAsynchronousRPCOperation alloc] initWithConnectionManager:testConnectionManager rpc:sendRPC]; + + [testOperationQueue addOperation:testOperation]; + [NSThread sleepForTimeInterval:0.1]; + + expect(testConnectionManager.receivedRequests).toEventually(contain(sendRPC)); + }); + }); + + context(@"when multiple request succeed", ^{ + __block NSMutableArray< __kindof SDLRPCMessage *> *sendRPCs = nil; + __block int rpcCount = (int)testOperationQueue.maxConcurrentOperationCount + 3; + + beforeEach(^{ + sendRPCs = [NSMutableArray array]; + for (int i = 0; i < rpcCount; i += 1) { + [sendRPCs addObject:[[SDLGetAppServiceDataResponse alloc] initWithAppServiceData:[[SDLAppServiceData alloc] init]]]; + } + }); + + it(@"should correctly send all of the rpcs", ^{ + for (int i = 0; i < rpcCount; i += 1) { + testOperation = [[SDLAsynchronousRPCOperation alloc] initWithConnectionManager:testConnectionManager rpc:sendRPCs[i]]; + [testOperationQueue addOperation:testOperation]; + } + + [NSThread sleepForTimeInterval:0.5]; + + expect(testConnectionManager.receivedRequests.count).toEventually(equal(rpcCount)); + expect(testConnectionManager.receivedRequests).toEventually(equal(sendRPCs)); + }); + }); + + context(@"when a requst is cancelled", ^{ + __block __kindof SDLRPCMessage *sendRPC = nil; + + beforeEach(^{ + sendRPC = [[SDLGetAppServiceDataResponse alloc] initWithAppServiceData:[[SDLAppServiceData alloc] init]]; + }); + + it(@"should not send the rpc", ^{ + testOperation = [[SDLAsynchronousRPCOperation alloc] initWithConnectionManager:testConnectionManager rpc:sendRPC]; + + [testOperationQueue addOperation:testOperation]; + [testOperationQueue cancelAllOperations]; + + [NSThread sleepForTimeInterval:0.1]; + + expect(testConnectionManager.receivedRequests).toEventually(beEmpty()); + }); + }); +}); + +QuickSpecEnd + diff --git a/SmartDeviceLinkTests/SDLRPCFunctionNamesSpec.m b/SmartDeviceLinkTests/SDLRPCFunctionNamesSpec.m new file mode 100644 index 000000000..dc28ebf28 --- /dev/null +++ b/SmartDeviceLinkTests/SDLRPCFunctionNamesSpec.m @@ -0,0 +1,97 @@ +// +// SDLRPCFunctionNamesSpec.m +// SmartDeviceLinkTests +// +// Created by Nicole on 3/5/19. +// Copyright © 2019 smartdevicelink. All rights reserved. +// + +#import <Quick/Quick.h> +#import <Nimble/Nimble.h> + +#import "SDLRPCFunctionNames.h" + +QuickSpecBegin(SDLRPCFunctionNamesSpec) + +describe(@"Individual Enum Value Tests", ^ { + it(@"Should match internal values", ^ { + expect(SDLRPCFunctionNameAddSubMenu).to(equal(@"AddSubMenu")); + expect(SDLRPCFunctionNameAlert).to(equal(@"Alert")); + expect(SDLRPCFunctionNameAlertManeuver).to(equal(@"AlertManeuver")); + expect(SDLRPCFunctionNameButtonPress).to(equal(@"ButtonPress")); + expect(SDLRPCFunctionNameChangeRegistration).to(equal(@"ChangeRegistration")); + expect(SDLRPCFunctionNameCreateInteractionChoiceSet).to(equal(@"CreateInteractionChoiceSet")); + expect(SDLRPCFunctionNameDeleteCommand).to(equal(@"DeleteCommand")); + expect(SDLRPCFunctionNameDeleteFile).to(equal(@"DeleteFile")); + expect(SDLRPCFunctionNameDeleteInteractionChoiceSet).to(equal(@"DeleteInteractionChoiceSet")); + expect(SDLRPCFunctionNameDeleteSubMenu).to(equal(@"DeleteSubMenu")); + expect(SDLRPCFunctionNameDiagnosticMessage).to(equal(@"DiagnosticMessage")); + expect(SDLRPCFunctionNameDialNumber).to(equal(@"DialNumber")); + expect(SDLRPCFunctionNameEncodedSyncPData).to(equal(@"EncodedSyncPData")); + expect(SDLRPCFunctionNameEndAudioPassThru).to(equal(@"EndAudioPassThru")); + expect(SDLRPCFunctionNameGenericResponse).to(equal(@"GenericResponse")); + expect(SDLRPCFunctionNameGetAppServiceData).to(equal(@"GetAppServiceData")); + expect(SDLRPCFunctionNameGetDTCs).to(equal(@"GetDTCs")); + expect(SDLRPCFunctionNameGetFile).to(equal(@"GetFile")); + expect(SDLRPCFunctionNameGetInteriorVehicleData).to(equal(@"GetInteriorVehicleData")); + expect(SDLRPCFunctionNameGetSystemCapability).to(equal(@"GetSystemCapability")); + expect(SDLRPCFunctionNameGetVehicleData).to(equal(@"GetVehicleData")); + expect(SDLRPCFunctionNameGetWayPoints).to(equal(@"GetWayPoints")); + expect(SDLRPCFunctionNameListFiles).to(equal(@"ListFiles")); + expect(SDLRPCFunctionNameOnAppInterfaceUnregistered).to(equal(@"OnAppInterfaceUnregistered")); + expect(SDLRPCFunctionNameOnAppServiceData).to(equal(@"OnAppServiceData")); + expect(SDLRPCFunctionNameOnAudioPassThru).to(equal(@"OnAudioPassThru")); + expect(SDLRPCFunctionNameOnButtonEvent).to(equal(@"OnButtonEvent")); + expect(SDLRPCFunctionNameOnButtonPress).to(equal(@"OnButtonPress")); + expect(SDLRPCFunctionNameOnCommand).to(equal(@"OnCommand")); + expect(SDLRPCFunctionNameOnDriverDistraction).to(equal(@"OnDriverDistraction")); + expect(SDLRPCFunctionNameOnEncodedSyncPData).to(equal(@"OnEncodedSyncPData")); + expect(SDLRPCFunctionNameOnHashChange).to(equal(@"OnHashChange")); + expect(SDLRPCFunctionNameOnHMIStatus).to(equal(@"OnHMIStatus")); + expect(SDLRPCFunctionNameOnInteriorVehicleData).to(equal(@"OnInteriorVehicleData")); + expect(SDLRPCFunctionNameOnKeyboardInput).to(equal(@"OnKeyboardInput")); + expect(SDLRPCFunctionNameOnLanguageChange).to(equal(@"OnLanguageChange")); + expect(SDLRPCFunctionNameOnPermissionsChange).to(equal(@"OnPermissionsChange")); + expect(SDLRPCFunctionNameOnRCStatus).to(equal(@"OnRCStatus")); + expect(SDLRPCFunctionNameOnSyncPData).to(equal(@"OnSyncPData")); + expect(SDLRPCFunctionNameOnSystemCapabilityUpdated).to(equal(@"OnSystemCapabilityUpdated")); + expect(SDLRPCFunctionNameOnSystemRequest).to(equal(@"OnSystemRequest")); + expect(SDLRPCFunctionNameOnTBTClientState).to(equal(@"OnTBTClientState")); + expect(SDLRPCFunctionNameOnTouchEvent).to(equal(@"OnTouchEvent")); + expect(SDLRPCFunctionNameOnVehicleData).to(equal(@"OnVehicleData")); + expect(SDLRPCFunctionNameOnWayPointChange).to(equal(@"OnWayPointChange")); + expect(SDLRPCFunctionNamePerformAppServiceInteraction).to(equal(@"PerformAppServiceInteraction")); + expect(SDLRPCFunctionNamePerformAudioPassThru).to(equal(@"PerformAudioPassThru")); + expect(SDLRPCFunctionNamePerformInteraction).to(equal(@"PerformInteraction")); + expect(SDLRPCFunctionNamePublishAppService).to(equal(@"PublishAppService")); + expect(SDLRPCFunctionNamePutFile).to(equal(@"PutFile")); + expect(SDLRPCFunctionNameReadDID).to(equal(@"ReadDID")); + expect(SDLRPCFunctionNameRegisterAppInterface).to(equal(@"RegisterAppInterface")); + expect(SDLRPCFunctionNameReserved).to(equal(@"reserved")); + expect(SDLRPCFunctionNameResetGlobalProperties).to(equal(@"ResetGlobalProperties")); + expect(SDLRPCFunctionNameScrollableMessage).to(equal(@"ScrollableMessage")); + expect(SDLRPCFunctionNameSendHapticData).to(equal(@"SendHapticData")); + expect(SDLRPCFunctionNameSendLocation).to(equal(@"SendLocation")); + expect(SDLRPCFunctionNameSetAppIcon).to(equal(@"SetAppIcon")); + expect(SDLRPCFunctionNameSetDisplayLayout).to(equal(@"SetDisplayLayout")); + expect(SDLRPCFunctionNameSetGlobalProperties).to(equal(@"SetGlobalProperties")); + expect(SDLRPCFunctionNameSetInteriorVehicleData).to(equal(@"SetInteriorVehicleData")); + expect(SDLRPCFunctionNameSetMediaClockTimer).to(equal(@"SetMediaClockTimer")); + expect(SDLRPCFunctionNameShow).to(equal(@"Show")); + expect(SDLRPCFunctionNameShowConstantTBT).to(equal(@"ShowConstantTBT")); + expect(SDLRPCFunctionNameSlider).to(equal(@"Slider")); + expect(SDLRPCFunctionNameSpeak).to(equal(@"Speak")); + expect(SDLRPCFunctionNameSubscribeButton).to(equal(@"SubscribeButton")); + expect(SDLRPCFunctionNameSubscribeVehicleData).to(equal(@"SubscribeVehicleData")); + expect(SDLRPCFunctionNameSubscribeWayPoints).to(equal(@"SubscribeWayPoints")); + expect(SDLRPCFunctionNameSyncPData).to(equal(@"SyncPData")); + expect(SDLRPCFunctionNameSystemRequest).to(equal(@"SystemRequest")); + expect(SDLRPCFunctionNameUnregisterAppInterface).to(equal(@"UnregisterAppInterface")); + expect(SDLRPCFunctionNameUnsubscribeButton).to(equal(@"UnsubscribeButton")); + expect(SDLRPCFunctionNameUnsubscribeVehicleData).to(equal(@"UnsubscribeVehicleData")); + expect(SDLRPCFunctionNameUnsubscribeWayPoints).to(equal(@"UnsubscribeWayPoints")); + expect(SDLRPCFunctionNameUpdateTurnList).to(equal(@"UpdateTurnList")); + }); +}); + +QuickSpecEnd diff --git a/SmartDeviceLinkTests/SDLSystemCapabilityManagerSpec.m b/SmartDeviceLinkTests/SDLSystemCapabilityManagerSpec.m index ee395a545..a3bb55c58 100644 --- a/SmartDeviceLinkTests/SDLSystemCapabilityManagerSpec.m +++ b/SmartDeviceLinkTests/SDLSystemCapabilityManagerSpec.m @@ -51,6 +51,7 @@ describe(@"System capability manager", ^{ expect(testSystemCapabilityManager.navigationCapability).to(beNil()); expect(testSystemCapabilityManager.videoStreamingCapability).to(beNil()); expect(testSystemCapabilityManager.remoteControlCapability).to(beNil()); + expect(testSystemCapabilityManager.appServicesCapabilities).to(beNil()); }); context(@"When notified of a register app interface response", ^{ @@ -169,6 +170,7 @@ describe(@"System capability manager", ^{ expect(testSystemCapabilityManager.navigationCapability).to(beNil()); expect(testSystemCapabilityManager.videoStreamingCapability).to(beNil()); expect(testSystemCapabilityManager.remoteControlCapability).to(beNil()); + expect(testSystemCapabilityManager.appServicesCapabilities).to(beNil()); }); }); @@ -250,6 +252,7 @@ describe(@"System capability manager", ^{ expect(testSystemCapabilityManager.navigationCapability).to(beNil()); expect(testSystemCapabilityManager.videoStreamingCapability).to(beNil()); expect(testSystemCapabilityManager.remoteControlCapability).to(beNil()); + expect(testSystemCapabilityManager.appServicesCapabilities).to(beNil()); }); }); @@ -349,6 +352,7 @@ describe(@"System capability manager", ^{ expect(testSystemCapabilityManager.navigationCapability).to(beNil()); expect(testSystemCapabilityManager.videoStreamingCapability).to(beNil()); expect(testSystemCapabilityManager.remoteControlCapability).to(beNil()); + expect(testSystemCapabilityManager.appServicesCapabilities).to(beNil()); }); }); @@ -388,6 +392,7 @@ describe(@"System capability manager", ^{ expect(testSystemCapabilityManager.navigationCapability).to(beNil()); expect(testSystemCapabilityManager.videoStreamingCapability).to(beNil()); expect(testSystemCapabilityManager.remoteControlCapability).to(beNil()); + expect(testSystemCapabilityManager.appServicesCapabilities).to(beNil()); }); }); }); diff --git a/SmartDeviceLinkTests/TestMultipleFilesConnectionManager.m b/SmartDeviceLinkTests/TestMultipleFilesConnectionManager.m index 7eb43733f..ef4756bda 100644 --- a/SmartDeviceLinkTests/TestMultipleFilesConnectionManager.m +++ b/SmartDeviceLinkTests/TestMultipleFilesConnectionManager.m @@ -11,7 +11,8 @@ #import "SDLRPCRequest.h" #import "SDLPutFile.h" #import "SDLPutFileResponse.h" -#import "SDLNames.h" +#import "SDLRPCParameterNames.h" +#import "SDLRPCFunctionNames.h" #import "TestResponse.h" NS_ASSUME_NONNULL_BEGIN @@ -21,13 +22,13 @@ NS_ASSUME_NONNULL_BEGIN - (void)sendConnectionRequest:(__kindof SDLRPCRequest *)request withResponseHandler:(nullable SDLResponseHandler)handler { [super sendConnectionRequest:request withResponseHandler:handler]; - if ([[request name] isEqualToString:SDLNamePutFile]) { + if ([[request name] isEqualToString:SDLRPCFunctionNamePutFile]) { SDLPutFile *putfileRequest = (SDLPutFile *)request; TestResponse *response = self.responses[putfileRequest.syncFileName]; if (response == nil || handler == nil) { return; } handler(request, response.testResponse, response.testError); - } else if ([[request name] isEqualToString:SDLNameDeleteFile]) { + } else if ([[request name] isEqualToString:SDLRPCFunctionNameDeleteFile]) { SDLDeleteFile *deleteFileRequest = (SDLDeleteFile *)request; TestResponse *response = self.responses[deleteFileRequest.syncFileName]; diff --git a/SmartDeviceLinkTests/TestUtilities/TestConnectionManager.h b/SmartDeviceLinkTests/TestUtilities/TestConnectionManager.h index e1a24418b..b538249b0 100644 --- a/SmartDeviceLinkTests/TestUtilities/TestConnectionManager.h +++ b/SmartDeviceLinkTests/TestUtilities/TestConnectionManager.h @@ -20,7 +20,7 @@ NS_ASSUME_NONNULL_BEGIN /** * All received requests. Chronological order. The 0th element will be the first request received; the nth request will be the n+1th request received. */ -@property (copy, nonatomic, readonly) NSMutableArray<__kindof SDLRPCRequest *> *receivedRequests; +@property (copy, nonatomic, readonly) NSMutableArray<__kindof SDLRPCMessage *> *receivedRequests; /** * The block passed for the last request send with sendRequest:withCompletionHandler: diff --git a/SmartDeviceLinkTests/TestUtilities/TestConnectionManager.m b/SmartDeviceLinkTests/TestUtilities/TestConnectionManager.m index 4c8ea3a50..5ba813171 100644 --- a/SmartDeviceLinkTests/TestUtilities/TestConnectionManager.m +++ b/SmartDeviceLinkTests/TestUtilities/TestConnectionManager.m @@ -21,15 +21,20 @@ NS_ASSUME_NONNULL_BEGIN return nil; } - _receivedRequests = [NSMutableArray<__kindof SDLRPCRequest *> array]; + _receivedRequests = [NSMutableArray<__kindof SDLRPCMessage *> array]; return self; } +- (void)sendConnectionRPC:(__kindof SDLRPCMessage *)rpc { + [self.receivedRequests addObject:rpc]; +} + - (void)sendConnectionRequest:(__kindof SDLRPCRequest *)request withResponseHandler:(nullable SDLResponseHandler)handler { self.lastRequestBlock = handler; - request.correlationID = [self test_nextCorrelationID]; - [self.receivedRequests addObject:request]; + SDLRPCRequest *requestRPC = (SDLRPCRequest *)request; + requestRPC.correlationID = [self test_nextCorrelationID]; + [self.receivedRequests addObject:requestRPC]; } - (void)sendConnectionManagerRequest:(__kindof SDLRPCRequest *)request withResponseHandler:(nullable SDLResponseHandler)handler { @@ -98,7 +103,7 @@ NS_ASSUME_NONNULL_BEGIN } - (void)reset { - _receivedRequests = [NSMutableArray<__kindof SDLRPCRequest *> array]; + _receivedRequests = [NSMutableArray<__kindof SDLRPCMessage *> array]; _lastRequestBlock = nil; } diff --git a/SmartDeviceLinkTests/TestUtilities/TestMultipleRequestsConnectionManager.m b/SmartDeviceLinkTests/TestUtilities/TestMultipleRequestsConnectionManager.m index 8c6cc8b06..b1935a8ab 100644 --- a/SmartDeviceLinkTests/TestUtilities/TestMultipleRequestsConnectionManager.m +++ b/SmartDeviceLinkTests/TestUtilities/TestMultipleRequestsConnectionManager.m @@ -10,7 +10,7 @@ #import "SDLAddCommand.h" #import "SDLAddCommandResponse.h" -#import "SDLNames.h" +#import "SDLRPCFunctionNames.h" #import "TestResponse.h" @implementation TestMultipleRequestsConnectionManager @@ -24,10 +24,14 @@ return self; } -- (void)sendConnectionRequest:(__kindof SDLRPCRequest *)request withResponseHandler:(SDLResponseHandler)handler { +- (void)sendConnectionRPC:(__kindof SDLRPCMessage *)rpc { + [super sendConnectionRPC:rpc]; +} + +- (void)sendConnectionRequest:(__kindof SDLRPCRequest *)request withResponseHandler:(nullable SDLResponseHandler)handler { [super sendConnectionRequest:request withResponseHandler:handler]; - NSAssert([request.name isEqualToString:SDLNameAddCommand], @"The TestMultipleRequestsConnectionManager is only setup for SDLAddCommand"); + NSAssert([request.name isEqualToString:SDLRPCFunctionNameAddCommand], @"The TestMultipleRequestsConnectionManager is only setup for SDLAddCommand"); SDLAddCommand *addCommand = (SDLAddCommand *)request; TestResponse *response = self.responses[addCommand.correlationID]; |