summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSatbir Tanda <satbirtanda@gmail.com>2019-06-07 18:35:14 -0700
committerSatbir Tanda <satbirtanda@gmail.com>2019-06-07 18:35:14 -0700
commitfe9fa9801a2d218f88f47bc5fd50ec893065f132 (patch)
tree53a8b0a7e8daa5c29c951a6555c78e8730cfbd00
parent1c5fb44403d3438d195a97193e38534085818466 (diff)
downloadsdl_ios-fe9fa9801a2d218f88f47bc5fd50ec893065f132.tar.gz
Update SDLOnDriverDistractionSpec.m
Test getter and setter of lockScreenDismissalEnabled Update pointer syntax
-rw-r--r--SmartDeviceLinkTests/RPCSpecs/NotificationSpecs/SDLOnDriverDistractionSpec.m31
1 files changed, 25 insertions, 6 deletions
diff --git a/SmartDeviceLinkTests/RPCSpecs/NotificationSpecs/SDLOnDriverDistractionSpec.m b/SmartDeviceLinkTests/RPCSpecs/NotificationSpecs/SDLOnDriverDistractionSpec.m
index b03394532..c7709256e 100644
--- a/SmartDeviceLinkTests/RPCSpecs/NotificationSpecs/SDLOnDriverDistractionSpec.m
+++ b/SmartDeviceLinkTests/RPCSpecs/NotificationSpecs/SDLOnDriverDistractionSpec.m
@@ -17,27 +17,46 @@ QuickSpecBegin(SDLOnDriverDistractionSpec)
describe(@"Getter/Setter Tests", ^ {
it(@"Should set and get correctly", ^ {
- SDLOnDriverDistraction* testNotification = [[SDLOnDriverDistraction alloc] init];
+ SDLOnDriverDistraction *testNotification = [[SDLOnDriverDistraction alloc] init];
testNotification.state = SDLDriverDistractionStateOn;
+ testNotification.lockScreenDismissalEnabled = @1;
expect(testNotification.state).to(equal(SDLDriverDistractionStateOn));
+ expect(testNotification.lockScreenDismissalEnabled).to(beTrue());
+
+ testNotification.lockScreenDismissalEnabled = @0;
+ expect(testNotification.lockScreenDismissalEnabled).to(beFalse());
});
it(@"Should get correctly when initialized", ^ {
- NSMutableDictionary* dict = [@{SDLRPCParameterNameNotification:
+ NSMutableDictionary *dictOn = [@{SDLRPCParameterNameNotification:
@{SDLRPCParameterNameParameters:
- @{SDLRPCParameterNameState:SDLDriverDistractionStateOn},
+ @{SDLRPCParameterNameState:SDLDriverDistractionStateOn,
+ SDLRPCParameterNameLockScreenDismissalEnabled: @1},
SDLRPCParameterNameOperationName:SDLRPCFunctionNameOnDriverDistraction}} mutableCopy];
- SDLOnDriverDistraction* testNotification = [[SDLOnDriverDistraction alloc] initWithDictionary:dict];
+ SDLOnDriverDistraction* testNotificationOn = [[SDLOnDriverDistraction alloc] initWithDictionary:dictOn];
- expect(testNotification.state).to(equal(SDLDriverDistractionStateOn));
+ expect(testNotificationOn.state).to(equal(SDLDriverDistractionStateOn));
+ expect(testNotificationOn.lockScreenDismissalEnabled).to(beTrue());
+
+ NSMutableDictionary *dictOff = [@{SDLRPCParameterNameNotification:
+ @{SDLRPCParameterNameParameters:
+ @{SDLRPCParameterNameState:SDLDriverDistractionStateOff,
+ SDLRPCParameterNameLockScreenDismissalEnabled: @0},
+ SDLRPCParameterNameOperationName:SDLRPCFunctionNameOnDriverDistraction}} mutableCopy];
+ SDLOnDriverDistraction *testNotificationOff = [[SDLOnDriverDistraction alloc] initWithDictionary:dictOff];
+
+ expect(testNotificationOff.state).to(equal(SDLDriverDistractionStateOff));
+ expect(testNotificationOff.lockScreenDismissalEnabled).to(beFalse());
});
it(@"Should return nil if not set", ^ {
- SDLOnDriverDistraction* testNotification = [[SDLOnDriverDistraction alloc] init];
+ SDLOnDriverDistraction *testNotification = [[SDLOnDriverDistraction alloc] init];
expect(testNotification.state).to(beNil());
+ expect(testNotification.lockScreenDismissalEnabled).to(beNil());
+ expect(testNotification.lockScreenDismissalEnabled).to(beFalsy());
});
});