diff options
author | Joel Fischer <joeljfischer@gmail.com> | 2016-05-25 08:44:23 -0400 |
---|---|---|
committer | Joel Fischer <joeljfischer@gmail.com> | 2016-05-25 08:44:23 -0400 |
commit | fb8e9903a323acaf5fc78819bb3c203567542ab2 (patch) | |
tree | e40665103ac7db492e0a40e34cd92f3390defa55 /SmartDeviceLinkTests/RPCSpecs/RequestSpecs/SDLUnsubscribeButtonSpec.m | |
parent | f7540a02262832e34c67b0953dd8a1804a046fea (diff) | |
download | sdl_ios-fb8e9903a323acaf5fc78819bb3c203567542ab2.tar.gz |
Shift files into root directory
Diffstat (limited to 'SmartDeviceLinkTests/RPCSpecs/RequestSpecs/SDLUnsubscribeButtonSpec.m')
-rw-r--r-- | SmartDeviceLinkTests/RPCSpecs/RequestSpecs/SDLUnsubscribeButtonSpec.m | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/SmartDeviceLinkTests/RPCSpecs/RequestSpecs/SDLUnsubscribeButtonSpec.m b/SmartDeviceLinkTests/RPCSpecs/RequestSpecs/SDLUnsubscribeButtonSpec.m new file mode 100644 index 000000000..4c0bfc3f1 --- /dev/null +++ b/SmartDeviceLinkTests/RPCSpecs/RequestSpecs/SDLUnsubscribeButtonSpec.m @@ -0,0 +1,44 @@ +// +// SDLUnsubscribeButtonSpec.m +// SmartDeviceLink + + +#import <Foundation/Foundation.h> + +#import <Quick/Quick.h> +#import <Nimble/Nimble.h> + +#import "SDLButtonName.h" +#import "SDLNames.h" +#import "SDLUnsubscribeButton.h" + + +QuickSpecBegin(SDLUnsubscribeButtonSpec) + +describe(@"Getter/Setter Tests", ^ { + it(@"Should set and get correctly", ^ { + SDLUnsubscribeButton* testRequest = [[SDLUnsubscribeButton alloc] init]; + + testRequest.buttonName = [SDLButtonName PRESET_0]; + + expect(testRequest.buttonName).to(equal([SDLButtonName PRESET_0])); + }); + + it(@"Should get correctly when initialized", ^ { + NSMutableDictionary* dict = [@{NAMES_request: + @{NAMES_parameters: + @{NAMES_buttonName:[SDLButtonName PRESET_0]}, + NAMES_operation_name:NAMES_UnsubscribeButton}} mutableCopy]; + SDLUnsubscribeButton* testRequest = [[SDLUnsubscribeButton alloc] initWithDictionary:dict]; + + expect(testRequest.buttonName).to(equal([SDLButtonName PRESET_0])); + }); + + it(@"Should return nil if not set", ^ { + SDLUnsubscribeButton* testRequest = [[SDLUnsubscribeButton alloc] init]; + + expect(testRequest.buttonName).to(beNil()); + }); +}); + +QuickSpecEnd
\ No newline at end of file |