summaryrefslogtreecommitdiff
path: root/SmartDeviceLinkTests/RPCSpecs
diff options
context:
space:
mode:
authorJoel Fischer <joeljfischer@gmail.com>2018-07-26 14:00:19 -0400
committerGitHub <noreply@github.com>2018-07-26 14:00:19 -0400
commitec28e9f9ed16f843af86dbfacd59ef43972764ca (patch)
treed2bbad9572b910b3ce12babeee7f1c32df31f964 /SmartDeviceLinkTests/RPCSpecs
parent471748ea47c1eff1a0cd48a549edf8d6c0ac4cfc (diff)
parente2e7aefa1e8fab5b145ef798c5e6bda9c22dc8ed (diff)
downloadsdl_ios-ec28e9f9ed16f843af86dbfacd59ef43972764ca.tar.gz
Merge pull request #1037 from mrapitis/feature/SDL-0160-rc-radio-param-update
Implement SDL 0160 Remote Control Radio Parameter Update
Diffstat (limited to 'SmartDeviceLinkTests/RPCSpecs')
-rw-r--r--SmartDeviceLinkTests/RPCSpecs/StructSpecs/SDLRadioControlCapabilitiesSpec.m34
-rw-r--r--SmartDeviceLinkTests/RPCSpecs/StructSpecs/SDLRadioControlDataSpec.m8
2 files changed, 39 insertions, 3 deletions
diff --git a/SmartDeviceLinkTests/RPCSpecs/StructSpecs/SDLRadioControlCapabilitiesSpec.m b/SmartDeviceLinkTests/RPCSpecs/StructSpecs/SDLRadioControlCapabilitiesSpec.m
index d6e07fe11..78a640dae 100644
--- a/SmartDeviceLinkTests/RPCSpecs/StructSpecs/SDLRadioControlCapabilitiesSpec.m
+++ b/SmartDeviceLinkTests/RPCSpecs/StructSpecs/SDLRadioControlCapabilitiesSpec.m
@@ -28,6 +28,8 @@ describe(@"Initialization tests", ^{
expect(testStruct.stateAvailable).to(beNil());
expect(testStruct.signalStrengthAvailable).to(beNil());
expect(testStruct.signalChangeThresholdAvailable).to(beNil());
+ expect(testStruct.hdRadioEnableAvailable).to(beNil());
+ expect(testStruct.siriusXMRadioAvailable).to(beNil());
});
it(@"should properly initialize initWithDictionary", ^{
@@ -41,7 +43,10 @@ describe(@"Initialization tests", ^{
SDLNameAvailableHDsAvailable : @NO,
SDLNameStateAvailable : @YES,
SDLNameSignalStrengthAvailable : @YES,
- SDLNameSignalChangeThresholdAvailable : @NO} mutableCopy];
+ SDLNameSignalChangeThresholdAvailable : @NO,
+ SDLNameHDRadioEnableAvailable : @YES,
+ SDLNameSiriusXMRadioAvailable : @NO
+ } mutableCopy];
SDLRadioControlCapabilities* testStruct = [[SDLRadioControlCapabilities alloc] initWithDictionary:dict];
expect(testStruct.moduleName).to(equal(@"someName"));
@@ -54,6 +59,8 @@ describe(@"Initialization tests", ^{
expect(testStruct.stateAvailable).to(equal(@YES));
expect(testStruct.signalStrengthAvailable).to(equal(@YES));
expect(testStruct.signalChangeThresholdAvailable).to(equal(@NO));
+ expect(testStruct.hdRadioEnableAvailable).to(equal(@YES));
+ expect(testStruct.siriusXMRadioAvailable).to(equal(@NO));
});
it(@"Should set and get correctly", ^{
@@ -69,6 +76,8 @@ describe(@"Initialization tests", ^{
testStruct.stateAvailable = @YES;
testStruct.signalStrengthAvailable = @YES;
testStruct.signalChangeThresholdAvailable = @NO;
+ testStruct.hdRadioEnableAvailable = @YES;
+ testStruct.siriusXMRadioAvailable = @YES;
expect(testStruct.moduleName).to(equal(@"someName"));
expect(testStruct.radioEnableAvailable).to(equal(@YES));
@@ -80,8 +89,10 @@ describe(@"Initialization tests", ^{
expect(testStruct.stateAvailable).to(equal(@YES));
expect(testStruct.signalStrengthAvailable).to(equal(@YES));
expect(testStruct.signalChangeThresholdAvailable).to(equal(@NO));
+ expect(testStruct.hdRadioEnableAvailable).to(equal(@YES));
+ expect(testStruct.siriusXMRadioAvailable).to(equal(@YES));
});
-
+
it(@"Should get correctly when initialized with Module Name and other radio control capabilite's parameters", ^ {
SDLRadioControlCapabilities* testStruct = [[SDLRadioControlCapabilities alloc] initWithModuleName:@"someName" radioEnableAvailable:YES radioBandAvailable:NO radioFrequencyAvailable:YES hdChannelAvailable:NO rdsDataAvailable:NO availableHDsAvailable:NO stateAvailable:YES signalStrengthAvailable:YES signalChangeThresholdAvailable:NO];
@@ -95,6 +106,25 @@ describe(@"Initialization tests", ^{
expect(testStruct.stateAvailable).to(equal(@YES));
expect(testStruct.signalStrengthAvailable).to(equal(@YES));
expect(testStruct.signalChangeThresholdAvailable).to(equal(@NO));
+ expect(testStruct.hdRadioEnableAvailable).to(equal(@NO));
+ expect(testStruct.siriusXMRadioAvailable).to(equal(@NO));
+ });
+
+ it(@"Should get correctly when initialized with Module Name and other radio control capabilite's parameters", ^ {
+ SDLRadioControlCapabilities* testStruct = [[SDLRadioControlCapabilities alloc] initWithModuleName:@"someName" radioEnableAvailable:YES radioBandAvailable:NO radioFrequencyAvailable:YES hdChannelAvailable:NO rdsDataAvailable:NO availableHDsAvailable:NO stateAvailable:YES signalStrengthAvailable:YES signalChangeThresholdAvailable:NO hdRadioEnableAvailable:NO siriusXMRadioAvailable:YES];
+
+ expect(testStruct.moduleName).to(equal(@"someName"));
+ expect(testStruct.radioEnableAvailable).to(equal(@YES));
+ expect(testStruct.radioBandAvailable).to(equal(@NO));
+ expect(testStruct.radioFrequencyAvailable).to(equal(@YES));
+ expect(testStruct.hdChannelAvailable).to(equal(@NO));
+ expect(testStruct.rdsDataAvailable).to(equal(@NO));
+ expect(testStruct.availableHDsAvailable).to(equal(@NO));
+ expect(testStruct.stateAvailable).to(equal(@YES));
+ expect(testStruct.signalStrengthAvailable).to(equal(@YES));
+ expect(testStruct.signalChangeThresholdAvailable).to(equal(@NO));
+ expect(testStruct.hdRadioEnableAvailable).to(equal(@NO));
+ expect(testStruct.siriusXMRadioAvailable).to(equal(@YES));
});
});
diff --git a/SmartDeviceLinkTests/RPCSpecs/StructSpecs/SDLRadioControlDataSpec.m b/SmartDeviceLinkTests/RPCSpecs/StructSpecs/SDLRadioControlDataSpec.m
index 4a5ebee64..11a16f83e 100644
--- a/SmartDeviceLinkTests/RPCSpecs/StructSpecs/SDLRadioControlDataSpec.m
+++ b/SmartDeviceLinkTests/RPCSpecs/StructSpecs/SDLRadioControlDataSpec.m
@@ -32,6 +32,7 @@ describe(@"Initialization tests", ^{
expect(testStruct.signalChangeThreshold).to(beNil());
expect(testStruct.radioEnable).to(beNil());
expect(testStruct.state).to(beNil());
+ expect(testStruct.hdRadioEnable).to(beNil());
});
it(@"should properly initialize initWithDictionary", ^{
@@ -45,7 +46,9 @@ describe(@"Initialization tests", ^{
SDLNameSignalStrength : @54,
SDLNameSignalChangeThreshold : @76,
SDLNameRadioEnable : @YES,
- SDLNameState : SDLRadioStateNotFound} mutableCopy];
+ SDLNameState : SDLRadioStateNotFound,
+ SDLNameHDRadioEnable : @NO
+ } mutableCopy];
SDLRadioControlData* testStruct = [[SDLRadioControlData alloc] initWithDictionary:dict];
expect(testStruct.frequencyInteger).to(equal(@101));
@@ -58,6 +61,7 @@ describe(@"Initialization tests", ^{
expect(testStruct.signalChangeThreshold).to(equal(@76));
expect(testStruct.radioEnable).to(equal(@YES));
expect(testStruct.state).to(equal(SDLRadioStateNotFound));
+ expect(testStruct.hdRadioEnable).to(equal(@NO));
});
it(@"Should set and get correctly", ^{
@@ -72,6 +76,7 @@ describe(@"Initialization tests", ^{
testStruct.signalChangeThreshold = @76;
testStruct.radioEnable = @YES;
testStruct.state = SDLRadioStateNotFound;
+ testStruct.hdRadioEnable = @YES;
expect(testStruct.frequencyInteger).to(equal(@101));
expect(testStruct.frequencyFraction).to(equal(@7));
@@ -83,6 +88,7 @@ describe(@"Initialization tests", ^{
expect(testStruct.signalChangeThreshold).to(equal(@76));
expect(testStruct.radioEnable).to(equal(@YES));
expect(testStruct.state).to(equal(SDLRadioStateNotFound));
+ expect(testStruct.hdRadioEnable).to(equal(@YES));
});
it(@"Should get correctly when initialized with Module Name and other radio control capabilite's parameters", ^ {