diff options
Diffstat (limited to 'SmartDeviceLinkTests/RPCSpecs/RequestSpecs/SDLCreateInteractionChoiceSetSpec.m')
-rw-r--r-- | SmartDeviceLinkTests/RPCSpecs/RequestSpecs/SDLCreateInteractionChoiceSetSpec.m | 50 |
1 files changed, 50 insertions, 0 deletions
diff --git a/SmartDeviceLinkTests/RPCSpecs/RequestSpecs/SDLCreateInteractionChoiceSetSpec.m b/SmartDeviceLinkTests/RPCSpecs/RequestSpecs/SDLCreateInteractionChoiceSetSpec.m new file mode 100644 index 000000000..39cadb2d6 --- /dev/null +++ b/SmartDeviceLinkTests/RPCSpecs/RequestSpecs/SDLCreateInteractionChoiceSetSpec.m @@ -0,0 +1,50 @@ +// +// SDLCreateInteractionChoiceSetSpec.m +// SmartDeviceLink + + +#import <Foundation/Foundation.h> + +#import <Quick/Quick.h> +#import <Nimble/Nimble.h> + +#import "SDLCreateInteractionChoiceSet.h" +#import "SDLChoice.h" +#import "SDLNames.h" + +QuickSpecBegin(SDLCreateInteractionChoiceSetSpec) + +SDLChoice* choice = [[SDLChoice alloc] init]; + +describe(@"Getter/Setter Tests", ^ { + it(@"Should set and get correctly", ^ { + SDLCreateInteractionChoiceSet* testRequest = [[SDLCreateInteractionChoiceSet alloc] init]; + + testRequest.interactionChoiceSetID = @141414; + testRequest.choiceSet = [@[choice] mutableCopy]; + + expect(testRequest.interactionChoiceSetID).to(equal(@141414)); + expect(testRequest.choiceSet).to(equal([@[choice] mutableCopy])); + }); + + it(@"Should get correctly when initialized", ^ { + NSMutableDictionary* dict = [@{NAMES_request: + @{NAMES_parameters: + @{NAMES_interactionChoiceSetID:@141414, + NAMES_choiceSet:[@[choice] mutableCopy]}, + NAMES_operation_name:NAMES_CreateInteractionChoiceSet}} mutableCopy]; + SDLCreateInteractionChoiceSet* testRequest = [[SDLCreateInteractionChoiceSet alloc] initWithDictionary:dict]; + + expect(testRequest.interactionChoiceSetID).to(equal(@141414)); + expect(testRequest.choiceSet).to(equal([@[choice] mutableCopy])); + }); + + it(@"Should return nil if not set", ^ { + SDLCreateInteractionChoiceSet* testRequest = [[SDLCreateInteractionChoiceSet alloc] init]; + + expect(testRequest.interactionChoiceSetID).to(beNil()); + expect(testRequest.choiceSet).to(beNil()); + }); +}); + +QuickSpecEnd
\ No newline at end of file |