summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFrank Elias <francois.elias@livio.io>2020-10-20 11:12:27 -0400
committerFrank Elias <francois.elias@livio.io>2020-10-20 11:12:27 -0400
commit7b9481fd7b868b0049ec2cfdf58b54fff650e7bf (patch)
tree65c0d7acbe42e14c18ad2022ce60befd39b3f8fb
parentd16e40ebaf8e8e91144dc41d8eb9e11696157923 (diff)
downloadsdl_ios-7b9481fd7b868b0049ec2cfdf58b54fff650e7bf.tar.gz
Add missing tests for lockScreenDismissalWarning
Add missing tests for lockScreenDismissalWarning
-rw-r--r--SmartDeviceLinkTests/RPCSpecs/NotificationSpecs/SDLOnDriverDistractionSpec.m14
1 files changed, 12 insertions, 2 deletions
diff --git a/SmartDeviceLinkTests/RPCSpecs/NotificationSpecs/SDLOnDriverDistractionSpec.m b/SmartDeviceLinkTests/RPCSpecs/NotificationSpecs/SDLOnDriverDistractionSpec.m
index 280e596a7..9d519d4a7 100644
--- a/SmartDeviceLinkTests/RPCSpecs/NotificationSpecs/SDLOnDriverDistractionSpec.m
+++ b/SmartDeviceLinkTests/RPCSpecs/NotificationSpecs/SDLOnDriverDistractionSpec.m
@@ -15,25 +15,33 @@
QuickSpecBegin(SDLOnDriverDistractionSpec)
+NSString *testDismissalWarning = @"I got an apple.";
+
describe(@"Getter/Setter Tests", ^ {
it(@"Should set and get correctly", ^ {
SDLOnDriverDistraction *testNotification = [[SDLOnDriverDistraction alloc] init];
testNotification.state = SDLDriverDistractionStateOn;
testNotification.lockScreenDismissalEnabled = @1;
-
+ testNotification.lockScreenDismissalWarning = testDismissalWarning;
+
expect(testNotification.state).to(equal(SDLDriverDistractionStateOn));
expect(testNotification.lockScreenDismissalEnabled).to(beTrue());
+ expect(testNotification.lockScreenDismissalWarning).to(equal(testDismissalWarning));
testNotification.lockScreenDismissalEnabled = @0;
expect(testNotification.lockScreenDismissalEnabled).to(beFalse());
+
+ testNotification.lockScreenDismissalWarning = nil;
+ expect(testNotification.lockScreenDismissalWarning).to(beNil());
});
it(@"Should get correctly when initialized", ^ {
NSMutableDictionary *dictOn = [@{SDLRPCParameterNameNotification:
@{SDLRPCParameterNameParameters:
@{SDLRPCParameterNameState:SDLDriverDistractionStateOn,
- SDLRPCParameterNameLockScreenDismissalEnabled: @1},
+ SDLRPCParameterNameLockScreenDismissalEnabled: @1,
+ SDLRPCParameterNameLockScreenDismissalWarning: testDismissalWarning},
SDLRPCParameterNameOperationName:SDLRPCFunctionNameOnDriverDistraction}} mutableCopy];
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wdeprecated-declarations"
@@ -42,6 +50,7 @@ describe(@"Getter/Setter Tests", ^ {
expect(testNotificationOn.state).to(equal(SDLDriverDistractionStateOn));
expect(testNotificationOn.lockScreenDismissalEnabled).to(beTrue());
+ expect(testNotificationOn.lockScreenDismissalWarning).to(equal(testDismissalWarning));
NSMutableDictionary *dictOff = [@{SDLRPCParameterNameNotification:
@{SDLRPCParameterNameParameters:
@@ -61,6 +70,7 @@ describe(@"Getter/Setter Tests", ^ {
SDLOnDriverDistraction *testNotification = [[SDLOnDriverDistraction alloc] init];
expect(testNotification.state).to(beNil());
+ expect(testNotification.lockScreenDismissalWarning).to(beNil());
expect(testNotification.lockScreenDismissalEnabled).to(beNil());
expect(testNotification.lockScreenDismissalEnabled).to(beFalsy());
});