diff options
Diffstat (limited to 'SmartDeviceLinkTests/DevAPISpecs/SDLPermissionsManagerSpec.m')
-rw-r--r-- | SmartDeviceLinkTests/DevAPISpecs/SDLPermissionsManagerSpec.m | 48 |
1 files changed, 24 insertions, 24 deletions
diff --git a/SmartDeviceLinkTests/DevAPISpecs/SDLPermissionsManagerSpec.m b/SmartDeviceLinkTests/DevAPISpecs/SDLPermissionsManagerSpec.m index 95ebc515e..27f99df7b 100644 --- a/SmartDeviceLinkTests/DevAPISpecs/SDLPermissionsManagerSpec.m +++ b/SmartDeviceLinkTests/DevAPISpecs/SDLPermissionsManagerSpec.m @@ -223,7 +223,7 @@ describe(@"SDLPermissionsManager", ^{ }); describe(@"checking the status of RPCs", ^{ - __block NSDictionary<SDLPermissionRPCName *, NSNumber<SDLBool> *> *testResultPermissionStatusDict = nil; + __block NSDictionary<SDLPermissionRPCName, NSNumber<SDLBool> *> *testResultPermissionStatusDict = nil; context(@"with no permissions data", ^{ beforeEach(^{ @@ -256,14 +256,14 @@ describe(@"SDLPermissionsManager", ^{ context(@"when no data is present", ^{ __block BOOL testObserverCalled = NO; __block SDLPermissionGroupStatus testObserverStatus = SDLPermissionGroupStatusUnknown; - __block NSDictionary<SDLPermissionRPCName *,NSNumber<SDLBool> *> *testObserverChangeDict = nil; + __block NSDictionary<SDLPermissionRPCName,NSNumber<SDLBool> *> *testObserverChangeDict = nil; beforeEach(^{ testObserverCalled = NO; testObserverStatus = SDLPermissionGroupStatusUnknown; testObserverChangeDict = nil; - [testPermissionsManager addObserverForRPCs:@[testRPCNameAllAllowed, testRPCNameAllDisallowed] groupType:SDLPermissionGroupTypeAny withHandler:^(NSDictionary<SDLPermissionRPCName *,NSNumber<SDLBool> *> * _Nonnull change, SDLPermissionGroupStatus status) { + [testPermissionsManager addObserverForRPCs:@[testRPCNameAllAllowed, testRPCNameAllDisallowed] groupType:SDLPermissionGroupTypeAny withHandler:^(NSDictionary<SDLPermissionRPCName,NSNumber<SDLBool> *> * _Nonnull change, SDLPermissionGroupStatus status) { testObserverChangeDict = change; testObserverStatus = status; testObserverCalled = YES; @@ -280,7 +280,7 @@ describe(@"SDLPermissionsManager", ^{ context(@"when data is already present", ^{ __block NSInteger numberOfTimesObserverCalled = 0; - __block NSDictionary<SDLPermissionRPCName *,NSNumber<SDLBool> *> *testObserverBlockChangedDict = nil; + __block NSDictionary<SDLPermissionRPCName,NSNumber<SDLBool> *> *testObserverBlockChangedDict = nil; __block SDLPermissionGroupStatus testObserverReturnStatus = SDLPermissionGroupStatusUnknown; context(@"to match an ANY observer", ^{ @@ -294,7 +294,7 @@ describe(@"SDLPermissionsManager", ^{ [[NSNotificationCenter defaultCenter] postNotification:testPermissionsNotification]; // This should be called twice, once for each RPC being observed. It should be called immediately since data should already be present - [testPermissionsManager addObserverForRPCs:@[testRPCNameAllAllowed, testRPCNameAllDisallowed] groupType:SDLPermissionGroupTypeAny withHandler:^(NSDictionary<SDLPermissionRPCName *,NSNumber<SDLBool> *> * _Nonnull changedDict, SDLPermissionGroupStatus status) { + [testPermissionsManager addObserverForRPCs:@[testRPCNameAllAllowed, testRPCNameAllDisallowed] groupType:SDLPermissionGroupTypeAny withHandler:^(NSDictionary<SDLPermissionRPCName,NSNumber<SDLBool> *> * _Nonnull changedDict, SDLPermissionGroupStatus status) { numberOfTimesObserverCalled++; testObserverBlockChangedDict = changedDict; testObserverReturnStatus = status; @@ -321,7 +321,7 @@ describe(@"SDLPermissionsManager", ^{ [[NSNotificationCenter defaultCenter] postNotification:testPermissionsNotification]; // This should be called twice, once for each RPC being observed. It should be called immediately since data should already be present - [testPermissionsManager addObserverForRPCs:@[testRPCNameAllAllowed, testRPCNameFullLimitedAllowed] groupType:SDLPermissionGroupTypeAllAllowed withHandler:^(NSDictionary<SDLPermissionRPCName *,NSNumber<SDLBool> *> * _Nonnull change, SDLPermissionGroupStatus status) { + [testPermissionsManager addObserverForRPCs:@[testRPCNameAllAllowed, testRPCNameFullLimitedAllowed] groupType:SDLPermissionGroupTypeAllAllowed withHandler:^(NSDictionary<SDLPermissionRPCName,NSNumber<SDLBool> *> * _Nonnull change, SDLPermissionGroupStatus status) { numberOfTimesObserverCalled++; testObserverBlockChangedDict = change; testObserverReturnStatus = status; @@ -348,7 +348,7 @@ describe(@"SDLPermissionsManager", ^{ [[NSNotificationCenter defaultCenter] postNotification:testPermissionsNotification]; // This should be called twice, once for each RPC being observed. It should be called immediately since data should already be present - [testPermissionsManager addObserverForRPCs:@[testRPCNameAllDisallowed, testRPCNameFullLimitedAllowed] groupType:SDLPermissionGroupTypeAllAllowed withHandler:^(NSDictionary<SDLPermissionRPCName *,NSNumber<SDLBool> *> * _Nonnull change, SDLPermissionGroupStatus status) { + [testPermissionsManager addObserverForRPCs:@[testRPCNameAllDisallowed, testRPCNameFullLimitedAllowed] groupType:SDLPermissionGroupTypeAllAllowed withHandler:^(NSDictionary<SDLPermissionRPCName,NSNumber<SDLBool> *> * _Nonnull change, SDLPermissionGroupStatus status) { numberOfTimesObserverCalled++; testObserverReturnStatus = status; }]; @@ -367,7 +367,7 @@ describe(@"SDLPermissionsManager", ^{ __block SDLOnPermissionsChange *testPermissionChangeUpdate = nil; __block SDLPermissionItem *testPermissionUpdated = nil; - __block NSMutableArray<NSDictionary<SDLPermissionRPCName *,NSNumber<SDLBool> *> *> *changeDicts = nil; + __block NSMutableArray<NSDictionary<SDLPermissionRPCName,NSNumber<SDLBool> *> *> *changeDicts = nil; __block NSMutableArray<NSNumber<SDLUInt> *> *testStatuses = nil; context(@"to match an ANY observer", ^{ @@ -383,7 +383,7 @@ describe(@"SDLPermissionsManager", ^{ [[NSNotificationCenter defaultCenter] postNotification:testPermissionsNotification]; // Set an observer that should be called immediately for the preexisting data, then called again when new data is sent - [testPermissionsManager addObserverForRPCs:@[testRPCNameAllAllowed, testRPCNameAllDisallowed] groupType:SDLPermissionGroupTypeAny withHandler:^(NSDictionary<SDLPermissionRPCName *,NSNumber<SDLBool> *> * _Nonnull changedDict, SDLPermissionGroupStatus status) { + [testPermissionsManager addObserverForRPCs:@[testRPCNameAllAllowed, testRPCNameAllDisallowed] groupType:SDLPermissionGroupTypeAny withHandler:^(NSDictionary<SDLPermissionRPCName,NSNumber<SDLBool> *> * _Nonnull changedDict, SDLPermissionGroupStatus status) { numberOfTimesObserverCalled++; [changeDicts addObject:changedDict]; }]; @@ -450,7 +450,7 @@ describe(@"SDLPermissionsManager", ^{ context(@"so that it becomes All Allowed", ^{ beforeEach(^{ // Set an observer that should be called immediately for the preexisting data, then called again when new data is sent - [testPermissionsManager addObserverForRPCs:@[testRPCNameAllDisallowed, testRPCNameFullLimitedBackgroundAllowed] groupType:SDLPermissionGroupTypeAllAllowed withHandler:^(NSDictionary<SDLPermissionRPCName *,NSNumber<SDLBool> *> * _Nonnull change, SDLPermissionGroupStatus status) { + [testPermissionsManager addObserverForRPCs:@[testRPCNameAllDisallowed, testRPCNameFullLimitedBackgroundAllowed] groupType:SDLPermissionGroupTypeAllAllowed withHandler:^(NSDictionary<SDLPermissionRPCName,NSNumber<SDLBool> *> * _Nonnull change, SDLPermissionGroupStatus status) { numberOfTimesObserverCalled++; [changeDicts addObject:change]; [testStatuses addObject:@(status)]; @@ -493,7 +493,7 @@ describe(@"SDLPermissionsManager", ^{ context(@"so that it goes from All Allowed to mixed", ^{ beforeEach(^{ // Set an observer that should be called immediately for the preexisting data, then called again when new data is sent - [testPermissionsManager addObserverForRPCs:@[testRPCNameAllAllowed] groupType:SDLPermissionGroupTypeAllAllowed withHandler:^(NSDictionary<SDLPermissionRPCName *,NSNumber<SDLBool> *> * _Nonnull change, SDLPermissionGroupStatus status) { + [testPermissionsManager addObserverForRPCs:@[testRPCNameAllAllowed] groupType:SDLPermissionGroupTypeAllAllowed withHandler:^(NSDictionary<SDLPermissionRPCName,NSNumber<SDLBool> *> * _Nonnull change, SDLPermissionGroupStatus status) { numberOfTimesObserverCalled++; [changeDicts addObject:change]; [testStatuses addObject:@(status)]; @@ -556,7 +556,7 @@ describe(@"SDLPermissionsManager", ^{ context(@"from mixed to disallowed", ^{ beforeEach(^{ // Set an observer that should be called immediately for the preexisting data, then called again when new data is sent - [testPermissionsManager addObserverForRPCs:@[testRPCNameAllAllowed, testRPCNameAllDisallowed] groupType:SDLPermissionGroupTypeAllAllowed withHandler:^(NSDictionary<SDLPermissionRPCName *,NSNumber<SDLBool> *> * _Nonnull change, SDLPermissionGroupStatus status) { + [testPermissionsManager addObserverForRPCs:@[testRPCNameAllAllowed, testRPCNameAllDisallowed] groupType:SDLPermissionGroupTypeAllAllowed withHandler:^(NSDictionary<SDLPermissionRPCName,NSNumber<SDLBool> *> * _Nonnull change, SDLPermissionGroupStatus status) { numberOfTimesObserverCalled++; [changeDicts addObject:change]; [testStatuses addObject:@(status)]; @@ -590,7 +590,7 @@ describe(@"SDLPermissionsManager", ^{ context(@"from disallowed to mixed", ^{ beforeEach(^{ // Set an observer that should be called immediately for the preexisting data, then called again when new data is sent - [testPermissionsManager addObserverForRPCs:@[testRPCNameFullLimitedAllowed, testRPCNameAllDisallowed] groupType:SDLPermissionGroupTypeAllAllowed withHandler:^(NSDictionary<SDLPermissionRPCName *,NSNumber<SDLBool> *> * _Nonnull change, SDLPermissionGroupStatus status) { + [testPermissionsManager addObserverForRPCs:@[testRPCNameFullLimitedAllowed, testRPCNameAllDisallowed] groupType:SDLPermissionGroupTypeAllAllowed withHandler:^(NSDictionary<SDLPermissionRPCName,NSNumber<SDLBool> *> * _Nonnull change, SDLPermissionGroupStatus status) { numberOfTimesObserverCalled++; [changeDicts addObject:change]; [testStatuses addObject:@(status)]; @@ -625,7 +625,7 @@ describe(@"SDLPermissionsManager", ^{ context(@"updating an observer with a new HMI level", ^{ __block NSInteger numberOfTimesObserverCalled = 0; - __block NSMutableArray<NSDictionary<SDLPermissionRPCName *,NSNumber<SDLBool> *> *> *changeDicts = nil; + __block NSMutableArray<NSDictionary<SDLPermissionRPCName,NSNumber<SDLBool> *> *> *changeDicts = nil; __block NSMutableArray<NSNumber<SDLUInt> *> *testStatuses = nil; context(@"to match an ANY observer", ^{ @@ -641,7 +641,7 @@ describe(@"SDLPermissionsManager", ^{ [[NSNotificationCenter defaultCenter] postNotification:testPermissionsNotification]; // Set an observer that should be called immediately for the preexisting data, then called again when new data is sent - [testPermissionsManager addObserverForRPCs:@[testRPCNameAllAllowed, testRPCNameFullLimitedAllowed] groupType:SDLPermissionGroupTypeAny withHandler:^(NSDictionary<SDLPermissionRPCName *,NSNumber<SDLBool> *> * _Nonnull changedDict, SDLPermissionGroupStatus status) { + [testPermissionsManager addObserverForRPCs:@[testRPCNameAllAllowed, testRPCNameFullLimitedAllowed] groupType:SDLPermissionGroupTypeAny withHandler:^(NSDictionary<SDLPermissionRPCName,NSNumber<SDLBool> *> * _Nonnull changedDict, SDLPermissionGroupStatus status) { numberOfTimesObserverCalled++; [changeDicts addObject:changedDict]; [testStatuses addObject:@(status)]; @@ -692,7 +692,7 @@ describe(@"SDLPermissionsManager", ^{ context(@"so that it becomes All Allowed", ^{ beforeEach(^{ // Set an observer that should be called immediately for the preexisting data, then called again when new data is sent - [testPermissionsManager addObserverForRPCs:@[testRPCNameFullLimitedAllowed] groupType:SDLPermissionGroupTypeAllAllowed withHandler:^(NSDictionary<SDLPermissionRPCName *,NSNumber<SDLBool> *> * _Nonnull changedDict, SDLPermissionGroupStatus status) { + [testPermissionsManager addObserverForRPCs:@[testRPCNameFullLimitedAllowed] groupType:SDLPermissionGroupTypeAllAllowed withHandler:^(NSDictionary<SDLPermissionRPCName,NSNumber<SDLBool> *> * _Nonnull changedDict, SDLPermissionGroupStatus status) { numberOfTimesObserverCalled++; [changeDicts addObject:changedDict]; [testStatuses addObject:@(status)]; @@ -712,7 +712,7 @@ describe(@"SDLPermissionsManager", ^{ context(@"so that it goes from All Allowed to at least some disallowed", ^{ beforeEach(^{ // Set an observer that should be called immediately for the preexisting data, then called again when new data is sent - [testPermissionsManager addObserverForRPCs:@[testRPCNameFullLimitedBackgroundAllowed] groupType:SDLPermissionGroupTypeAllAllowed withHandler:^(NSDictionary<SDLPermissionRPCName *,NSNumber<SDLBool> *> * _Nonnull changedDict, SDLPermissionGroupStatus status) { + [testPermissionsManager addObserverForRPCs:@[testRPCNameFullLimitedBackgroundAllowed] groupType:SDLPermissionGroupTypeAllAllowed withHandler:^(NSDictionary<SDLPermissionRPCName,NSNumber<SDLBool> *> * _Nonnull changedDict, SDLPermissionGroupStatus status) { numberOfTimesObserverCalled++; [changeDicts addObject:changedDict]; [testStatuses addObject:@(status)]; @@ -761,7 +761,7 @@ describe(@"SDLPermissionsManager", ^{ context(@"that goes from disallowed to mixed", ^{ beforeEach(^{ // Set an observer that should be called immediately for the preexisting data, then called again when new data is sent - [testPermissionsManager addObserverForRPCs:@[testRPCNameFullLimitedAllowed, testRPCNameAllDisallowed] groupType:SDLPermissionGroupTypeAllAllowed withHandler:^(NSDictionary<SDLPermissionRPCName *,NSNumber<SDLBool> *> * _Nonnull changedDict, SDLPermissionGroupStatus status) { + [testPermissionsManager addObserverForRPCs:@[testRPCNameFullLimitedAllowed, testRPCNameAllDisallowed] groupType:SDLPermissionGroupTypeAllAllowed withHandler:^(NSDictionary<SDLPermissionRPCName,NSNumber<SDLBool> *> * _Nonnull changedDict, SDLPermissionGroupStatus status) { numberOfTimesObserverCalled++; [changeDicts addObject:changedDict]; [testStatuses addObject:@(status)]; @@ -780,7 +780,7 @@ describe(@"SDLPermissionsManager", ^{ context(@"that goes from mixed to disallowed", ^{ beforeEach(^{ // Set an observer that should be called immediately for the preexisting data, then called again when new data is sent - [testPermissionsManager addObserverForRPCs:@[testRPCNameFullLimitedAllowed, testRPCNameFullLimitedBackgroundAllowed] groupType:SDLPermissionGroupTypeAllAllowed withHandler:^(NSDictionary<SDLPermissionRPCName *,NSNumber<SDLBool> *> * _Nonnull changedDict, SDLPermissionGroupStatus status) { + [testPermissionsManager addObserverForRPCs:@[testRPCNameFullLimitedAllowed, testRPCNameFullLimitedBackgroundAllowed] groupType:SDLPermissionGroupTypeAllAllowed withHandler:^(NSDictionary<SDLPermissionRPCName,NSNumber<SDLBool> *> * _Nonnull changedDict, SDLPermissionGroupStatus status) { numberOfTimesObserverCalled++; [changeDicts addObject:changedDict]; [testStatuses addObject:@(status)]; @@ -807,7 +807,7 @@ describe(@"SDLPermissionsManager", ^{ numberOfTimesObserverCalled = 0; // Add two observers - NSUUID *observerId = [testPermissionsManager addObserverForRPCs:@[testRPCNameAllAllowed, testRPCNameFullLimitedAllowed] groupType:SDLPermissionGroupTypeAny withHandler:^(NSDictionary<SDLPermissionRPCName *,NSNumber<SDLBool> *> * _Nonnull changedDict, SDLPermissionGroupStatus status) { + NSUUID *observerId = [testPermissionsManager addObserverForRPCs:@[testRPCNameAllAllowed, testRPCNameFullLimitedAllowed] groupType:SDLPermissionGroupTypeAny withHandler:^(NSDictionary<SDLPermissionRPCName,NSNumber<SDLBool> *> * _Nonnull changedDict, SDLPermissionGroupStatus status) { numberOfTimesObserverCalled++; }]; @@ -832,11 +832,11 @@ describe(@"SDLPermissionsManager", ^{ numberOfTimesObserverCalled = 0; // Add two observers - NSUUID *testRemovedObserverId = [testPermissionsManager addObserverForRPCs:@[testRPCNameAllAllowed, testRPCNameFullLimitedAllowed] groupType:SDLPermissionGroupTypeAny withHandler:^(NSDictionary<SDLPermissionRPCName *,NSNumber<SDLBool> *> * _Nonnull changedDict, SDLPermissionGroupStatus status) { + NSUUID *testRemovedObserverId = [testPermissionsManager addObserverForRPCs:@[testRPCNameAllAllowed, testRPCNameFullLimitedAllowed] groupType:SDLPermissionGroupTypeAny withHandler:^(NSDictionary<SDLPermissionRPCName,NSNumber<SDLBool> *> * _Nonnull changedDict, SDLPermissionGroupStatus status) { numberOfTimesObserverCalled++; }]; - [testPermissionsManager addObserverForRPCs:@[testRPCNameAllAllowed, testRPCNameFullLimitedAllowed] groupType:SDLPermissionGroupTypeAny withHandler:^(NSDictionary<SDLPermissionRPCName *,NSNumber<SDLBool> *> * _Nonnull changedDict, SDLPermissionGroupStatus status) { + [testPermissionsManager addObserverForRPCs:@[testRPCNameAllAllowed, testRPCNameFullLimitedAllowed] groupType:SDLPermissionGroupTypeAny withHandler:^(NSDictionary<SDLPermissionRPCName,NSNumber<SDLBool> *> * _Nonnull changedDict, SDLPermissionGroupStatus status) { numberOfTimesObserverCalled++; }]; @@ -861,11 +861,11 @@ describe(@"SDLPermissionsManager", ^{ numberOfTimesObserverCalled = 0; // Add two observers - [testPermissionsManager addObserverForRPCs:@[testRPCNameAllAllowed, testRPCNameAllDisallowed] groupType:SDLPermissionGroupTypeAny withHandler:^(NSDictionary<SDLPermissionRPCName *,NSNumber<SDLBool> *> * _Nonnull changedDict, SDLPermissionGroupStatus status) { + [testPermissionsManager addObserverForRPCs:@[testRPCNameAllAllowed, testRPCNameAllDisallowed] groupType:SDLPermissionGroupTypeAny withHandler:^(NSDictionary<SDLPermissionRPCName,NSNumber<SDLBool> *> * _Nonnull changedDict, SDLPermissionGroupStatus status) { numberOfTimesObserverCalled++; }]; - [testPermissionsManager addObserverForRPCs:@[testRPCNameAllAllowed, testRPCNameAllDisallowed] groupType:SDLPermissionGroupTypeAny withHandler:^(NSDictionary<SDLPermissionRPCName *,NSNumber<SDLBool> *> * _Nonnull changedDict, SDLPermissionGroupStatus status) { + [testPermissionsManager addObserverForRPCs:@[testRPCNameAllAllowed, testRPCNameAllDisallowed] groupType:SDLPermissionGroupTypeAny withHandler:^(NSDictionary<SDLPermissionRPCName,NSNumber<SDLBool> *> * _Nonnull changedDict, SDLPermissionGroupStatus status) { numberOfTimesObserverCalled++; }]; |