summaryrefslogtreecommitdiff
path: root/SmartDeviceLinkTests/RPCSpecs/StructSpecs/SDLRoofStatusSpec.m
diff options
context:
space:
mode:
Diffstat (limited to 'SmartDeviceLinkTests/RPCSpecs/StructSpecs/SDLRoofStatusSpec.m')
-rw-r--r--SmartDeviceLinkTests/RPCSpecs/StructSpecs/SDLRoofStatusSpec.m114
1 files changed, 114 insertions, 0 deletions
diff --git a/SmartDeviceLinkTests/RPCSpecs/StructSpecs/SDLRoofStatusSpec.m b/SmartDeviceLinkTests/RPCSpecs/StructSpecs/SDLRoofStatusSpec.m
new file mode 100644
index 000000000..933ad1d0c
--- /dev/null
+++ b/SmartDeviceLinkTests/RPCSpecs/StructSpecs/SDLRoofStatusSpec.m
@@ -0,0 +1,114 @@
+//
+// SDLRoofStatusSpec.m
+// SmartDeviceLink
+
+
+#import <Foundation/Foundation.h>
+
+#import <Quick/Quick.h>
+#import <Nimble/Nimble.h>
+
+#import "SDLDoorStatusType.h"
+#import "SDLGrid.h"
+#import "SDLRoofStatus.h"
+#import "SDLRPCParameterNames.h"
+#import "SDLWindowState.h"
+
+QuickSpecBegin(SDLRoofStatusSpec)
+
+SDLGrid *location = [[SDLGrid alloc] init];
+SDLDoorStatusType status = SDLDoorStatusTypeAjar;
+SDLWindowState *state = [[SDLWindowState alloc] init];
+__block SDLRoofStatus *testStruct = nil;
+
+describe(@"getter/setter tests", ^{
+ context(@"init and assign", ^{
+ beforeEach(^{
+ testStruct = [[SDLRoofStatus alloc] init];
+ testStruct.location = location;
+ testStruct.status = status;
+ testStruct.state = state;
+ });
+
+ it(@"expect struct is not nil", ^{
+ expect(testStruct).notTo(beNil());
+ });
+
+ it(@"expect all properties to be set correctly", ^{
+ expect(testStruct.location).to(equal(location));
+ expect(testStruct.status).to(equal(status));
+ expect(testStruct.state).to(equal(state));
+ });
+ });
+
+ context(@"initWithDictionary:", ^{
+ beforeEach(^{
+ NSDictionary *dict = @{
+ SDLRPCParameterNameLocation:location,
+ SDLRPCParameterNameStatus:status,
+ SDLRPCParameterNameState:state,
+ };
+ testStruct = [[SDLRoofStatus alloc] initWithDictionary:dict];
+ });
+
+ it(@"expect struct is not nil", ^{
+ expect(testStruct).notTo(beNil());
+ });
+
+ it(@"expect all properties to be set correctly", ^{
+ expect(testStruct.location).to(equal(location));
+ expect(testStruct.status).to(equal(status));
+ expect(testStruct.state).to(equal(state));
+ });
+ });
+
+ context(@"init", ^{
+ beforeEach(^{
+ testStruct = [[SDLRoofStatus alloc] init];
+ });
+
+ it(@"expect struct is not nil", ^{
+ expect(testStruct).notTo(beNil());
+ });
+
+ it(@"expect all properties to be nil", ^{
+ expect(testStruct.location).to(beNil());
+ expect(testStruct.status).to(beNil());
+ expect(testStruct.state).to(beNil());
+ });
+ });
+
+ context(@"initWithLocation:status:", ^{
+ beforeEach(^{
+ testStruct = [[SDLRoofStatus alloc] initWithLocation:location status:status];
+ });
+
+ it(@"expect struct is not nil", ^{
+ expect(testStruct).notTo(beNil());
+ });
+
+ it(@"expect all properties to be set correctly", ^{
+ expect(testStruct.location).to(equal(location));
+ expect(testStruct.status).to(equal(status));
+ expect(testStruct.state).to(beNil());
+ });
+ });
+
+ context(@"initWithLocation:status:state:", ^{
+ beforeEach(^{
+ testStruct = [[SDLRoofStatus alloc] initWithLocation:location status:status state:state];
+ });
+
+ it(@"expect struct is not nil", ^{
+ expect(testStruct).notTo(beNil());
+ });
+
+ it(@"expect all properties to be set correctly", ^{
+ expect(testStruct.location).to(equal(location));
+ expect(testStruct.status).to(equal(status));
+ expect(testStruct.state).to(equal(state));
+ });
+ });
+});
+
+QuickSpecEnd