diff --git a/SmartDeviceLink/SDLRadioControlData.h b/SmartDeviceLink/SDLRadioControlData.h index bea276856..8a940e96f 100644 --- a/SmartDeviceLink/SDLRadioControlData.h +++ b/SmartDeviceLink/SDLRadioControlData.h @@ -41,7 +41,6 @@ NS_ASSUME_NONNULL_BEGIN */ - (instancetype)initWithFrequencyInteger:(nullable NSNumber *)frequencyInteger frequencyFraction:(nullable NSNumber *)frequencyFraction band:(nullable SDLRadioBand)band hdChannel:(nullable NSNumber *)hdChannel radioEnable:(nullable NSNumber *)radioEnable hdRadioEnable:(nullable NSNumber *)hdRadioEnable; - /// Constructs a newly allocated SDLRadioControlCapabilities object with given parameters. /// /// @param frequencyInteger Must be between 875 and 1080 diff --git a/SmartDeviceLink/SDLRadioControlData.m b/SmartDeviceLink/SDLRadioControlData.m index 5d40ca372..cc4c37154 100644 --- a/SmartDeviceLink/SDLRadioControlData.m +++ b/SmartDeviceLink/SDLRadioControlData.m @@ -48,7 +48,7 @@ - (instancetype)initFMWithFrequencyInteger:(nullable NSNumber *)frequenc if(!self) { return nil; } - + self.band = SDLRadioBandFM; self.frequencyInteger = frequencyInteger; self.frequencyFraction = frequencyFraction; diff --git a/SmartDeviceLinkTests/RPCSpecs/StructSpecs/SDLRadioControlDataSpec.m b/SmartDeviceLinkTests/RPCSpecs/StructSpecs/SDLRadioControlDataSpec.m index fd74e0f38..d6e56fb3d 100644 --- a/SmartDeviceLinkTests/RPCSpecs/StructSpecs/SDLRadioControlDataSpec.m +++ b/SmartDeviceLinkTests/RPCSpecs/StructSpecs/SDLRadioControlDataSpec.m @@ -155,6 +155,44 @@ expect(testStruct.hdRadioEnable).to(equal(@YES)); }); + it(@"Should get correctly when initialized FM radio control capabilities parameters", ^ { + SDLRadioControlData* testStruct = [[SDLRadioControlData alloc] initFMWithFrequencyInteger:@101 frequencyFraction:@7]; + + expect(testStruct.frequencyInteger).to(equal(@101)); + expect(testStruct.frequencyFraction).to(equal(@7)); + expect(testStruct.band).to(equal(SDLRadioBandFM)); + }); + + it(@"Should get correctly when initialized FM radio control capabilities parameters", ^ { + SDLRadioControlData* testStruct = [[SDLRadioControlData alloc] initFMWithHdChannel:@5]; + + expect(testStruct.hdChannel).to(equal(@5)); + expect(testStruct.band).to(equal(SDLRadioBandFM)); + }); + + it(@"Should get correctly when initialized AM radio control capabilities parameters", ^ { + SDLRadioControlData* testStruct = [[SDLRadioControlData alloc] initAMWithFrequencyInteger:@101]; + + expect(testStruct.frequencyInteger).to(equal(@101)); + expect(testStruct.band).to(equal(SDLRadioBandAM)); + }); + + it(@"Should get correctly when initialized AM radio control capabilities parameters", ^ { + SDLRadioControlData* testStruct = [[SDLRadioControlData alloc] initAMWithHdChannel:@5]; + + expect(testStruct.hdChannel).to(equal(@5)); + expect(testStruct.band).to(equal(SDLRadioBandAM)); + }); + + it(@"Should get correctly when initialized XM radio control capabilities parameters", ^ { + SDLRadioControlData* testStruct = [[SDLRadioControlData alloc] initXMWithFrequencyInteger:@101]; + + expect(testStruct.frequencyInteger).to(equal(@101)); + expect(testStruct.band).to(equal(SDLRadioBandXM)); + }); + + + }); QuickSpecEnd