diff options
author | Frank Elias <francois.elias@livio.io> | 2021-01-05 14:44:04 -0500 |
---|---|---|
committer | Frank Elias <francois.elias@livio.io> | 2021-01-05 14:44:04 -0500 |
commit | e2c6d0f713adc32f79d9d4f0056454914557757b (patch) | |
tree | f69a155859c153d399424839b80a686439913218 | |
parent | 96ed063acf78044e2d300520a608da66e3b7439d (diff) | |
download | sdl_ios-feature/issue-1024-SDL-0180-broaden-choice-uniqueness.tar.gz |
Update Spec files to support the changesfeature/issue-1024-SDL-0180-broaden-choice-uniqueness
3 files changed, 22 insertions, 22 deletions
diff --git a/SmartDeviceLinkTests/DevAPISpecs/SDLChoiceSetManagerSpec.m b/SmartDeviceLinkTests/DevAPISpecs/SDLChoiceSetManagerSpec.m index 3e4bac2ef..331b51930 100644 --- a/SmartDeviceLinkTests/DevAPISpecs/SDLChoiceSetManagerSpec.m +++ b/SmartDeviceLinkTests/DevAPISpecs/SDLChoiceSetManagerSpec.m @@ -233,7 +233,7 @@ describe(@"choice set manager tests", ^{ describe(@"preloading choices", ^{ context(@"when some choices are already uploaded", ^{ beforeEach(^{ - testManager.preloadedMutableChoices = [NSMutableSet setWithArray:@[testCell1]]; + testManager.preloadedMutableChoices = [NSMutableArray arrayWithObject:testCell1]; [testManager preloadChoices:@[testCell1, testCell2, testCell3] withCompletionHandler:^(NSError * _Nullable error) { }]; @@ -257,7 +257,7 @@ describe(@"choice set manager tests", ^{ context(@"when some choices are already pending", ^{ beforeEach(^{ - testManager.pendingMutablePreloadChoices = [NSMutableSet setWithArray:@[testCell1]]; + testManager.pendingMutablePreloadChoices = [NSMutableArray arrayWithObject:testCell1]; [testManager preloadChoices:@[testCell1, testCell2, testCell3] withCompletionHandler:^(NSError * _Nullable error) { }]; @@ -281,7 +281,7 @@ describe(@"choice set manager tests", ^{ context(@"when the manager shuts down during preloading", ^{ beforeEach(^{ - testManager.pendingMutablePreloadChoices = [NSMutableArray setWithArray:@[testCell1]]; + testManager.pendingMutablePreloadChoices = [NSMutableArray arrayWithObject:testCell1]; [testManager preloadChoices:@[testCell1, testCell2, testCell3] withCompletionHandler:^(NSError * _Nullable error) { }]; @@ -316,11 +316,11 @@ describe(@"choice set manager tests", ^{ beforeEach(^{ choiceDelegate = OCMProtocolMock(@protocol(SDLChoiceSetDelegate)); pendingPresentOp = OCMClassMock([SDLPresentChoiceSetOperation class]); - OCMStub(pendingPresentOp.choiceSet.choices).andReturn([NSArray setWithArray:@[testCell1]]); + OCMStub(pendingPresentOp.choiceSet.choices).andReturn(@[testCell1]); testManager.pendingPresentOperation = pendingPresentOp; testManager.pendingPresentationSet = [[SDLChoiceSet alloc] initWithTitle:@"Test" delegate:choiceDelegate choices:@[testCell1]]; - testManager.preloadedMutableChoices = [NSMutableSet setWithObject:testCell1]; + testManager.preloadedMutableChoices = [NSMutableArray arrayWithObject:testCell1]; [testManager deleteChoices:@[testCell1, testCell2, testCell3]]; }); @@ -344,7 +344,7 @@ describe(@"choice set manager tests", ^{ [testManager.transactionQueue addOperation:pendingPreloadOp]; - testManager.pendingMutablePreloadChoices = [NSMutableSet setWithObject:testCell1]; + testManager.pendingMutablePreloadChoices = [NSMutableArray arrayWithObject:testCell1]; [testManager deleteChoices:@[testCell1, testCell2, testCell3]]; }); @@ -362,10 +362,10 @@ describe(@"choice set manager tests", ^{ beforeEach(^{ choiceDelegate = OCMProtocolMock(@protocol(SDLChoiceSetDelegate)); pendingPresentOp = OCMClassMock([SDLPresentChoiceSetOperation class]); - OCMStub(pendingPresentOp.choiceSet.choices).andReturn([NSSet setWithArray:@[testCell1]]); + OCMStub(pendingPresentOp.choiceSet.choices).andReturn(@[testCell1]); testManager.pendingPresentOperation = pendingPresentOp; testManager.pendingPresentationSet = [[SDLChoiceSet alloc] initWithTitle:@"Test" delegate:choiceDelegate choices:@[testCell1]]; - testManager.preloadedMutableChoices = [NSMutableSet setWithObject:testCell1]; + testManager.preloadedMutableChoices = [NSMutableArray arrayWithObject:testCell1]; [testManager deleteChoices:@[testCell1, testCell2, testCell3]]; }); @@ -377,8 +377,8 @@ describe(@"choice set manager tests", ^{ OCMVerify([choiceDelegate choiceSet:[OCMArg any] didReceiveError:[OCMArg any]]); [testManager.stateMachine setToState:SDLChoiceManagerStateShutdown fromOldState:nil callEnterTransition:NO]; - testManager.pendingMutablePreloadChoices = [NSMutableSet set]; - testManager.preloadedMutableChoices = [NSMutableSet set]; + testManager.pendingMutablePreloadChoices = [NSMutableArray array]; + testManager.preloadedMutableChoices = [NSMutableArray array]; testManager.transactionQueue.operations.lastObject.completionBlock(); @@ -480,8 +480,8 @@ describe(@"choice set manager tests", ^{ expect(testManager.transactionQueue.operations.lastObject).to(beAnInstanceOf([SDLPresentChoiceSetOperation class])); [testManager.stateMachine setToState:SDLChoiceManagerStateShutdown fromOldState:nil callEnterTransition:NO]; - testManager.pendingMutablePreloadChoices = [NSMutableSet set]; - testManager.preloadedMutableChoices = [NSMutableSet set]; + testManager.pendingMutablePreloadChoices = [NSMutableArray array]; + testManager.preloadedMutableChoices = [NSMutableArray array]; testManager.transactionQueue.operations.lastObject.completionBlock(); diff --git a/SmartDeviceLinkTests/DevAPISpecs/SDLDeleteChoicesOperationSpec.m b/SmartDeviceLinkTests/DevAPISpecs/SDLDeleteChoicesOperationSpec.m index 2996da282..0971795b2 100644 --- a/SmartDeviceLinkTests/DevAPISpecs/SDLDeleteChoicesOperationSpec.m +++ b/SmartDeviceLinkTests/DevAPISpecs/SDLDeleteChoicesOperationSpec.m @@ -13,7 +13,7 @@ QuickSpecBegin(SDLDeleteChoicesOperationSpec) describe(@"delete choices operation", ^{ __block TestConnectionManager *testConnectionManager = nil; __block SDLDeleteChoicesOperation *testOp = nil; - __block NSSet<SDLChoiceCell *> *testCellsToDelete = nil; + __block NSArray<SDLChoiceCell *> *testCellsToDelete = nil; __block BOOL hasCalledOperationCompletionHandler = NO; __block NSError *resultError = nil; @@ -22,7 +22,7 @@ describe(@"delete choices operation", ^{ hasCalledOperationCompletionHandler = NO; testConnectionManager = [[TestConnectionManager alloc] init]; - testCellsToDelete = [NSSet setWithArray:@[[[SDLChoiceCell alloc] initWithText:@"Text"], [[SDLChoiceCell alloc] initWithText:@"Text 2"]]]; + testCellsToDelete = @[[[SDLChoiceCell alloc] initWithText:@"Text"], [[SDLChoiceCell alloc] initWithText:@"Text 2"]]; testOp = [[SDLDeleteChoicesOperation alloc] initWithConnectionManager:testConnectionManager cellsToDelete:testCellsToDelete]; testOp.completionBlock = ^{ hasCalledOperationCompletionHandler = YES; diff --git a/SmartDeviceLinkTests/DevAPISpecs/SDLPreloadChoicesOperationSpec.m b/SmartDeviceLinkTests/DevAPISpecs/SDLPreloadChoicesOperationSpec.m index 144f54e3d..152d82458 100644 --- a/SmartDeviceLinkTests/DevAPISpecs/SDLPreloadChoicesOperationSpec.m +++ b/SmartDeviceLinkTests/DevAPISpecs/SDLPreloadChoicesOperationSpec.m @@ -58,8 +58,8 @@ describe(@"a preload choices operation", ^{ }); context(@"with artworks", ^{ - __block NSSet<SDLChoiceCell *> *cellsWithArtwork = nil; - __block NSSet<SDLChoiceCell *> *cellsWithStaticIcon = nil; + __block NSArray<SDLChoiceCell *> *cellsWithArtwork = nil; + __block NSArray<SDLChoiceCell *> *cellsWithStaticIcon = nil; __block NSString *art1Name = @"Art1Name"; __block NSString *art2Name = @"Art2Name"; __block SDLArtwork *cell1Art2 = [[SDLArtwork alloc] initWithData:cellArtData2 name:art1Name fileExtension:@"png" persistent:NO]; @@ -74,8 +74,8 @@ describe(@"a preload choices operation", ^{ SDLArtwork *staticIconArt = [SDLArtwork artworkWithStaticIcon:SDLStaticIconNameDate]; SDLChoiceCell *cellWithStaticIcon = [[SDLChoiceCell alloc] initWithText:@"Static Icon" secondaryText:nil tertiaryText:nil voiceCommands:nil artwork:staticIconArt secondaryArtwork:nil]; - cellsWithArtwork = [NSSet setWithArray:@[cell1WithArt, cell2WithArtAndSecondary]]; - cellsWithStaticIcon = [NSSet setWithArray:@[cellWithStaticIcon]]; + cellsWithArtwork = @[cell1WithArt, cell2WithArtAndSecondary]; + cellsWithStaticIcon = @[cellWithStaticIcon]; }); context(@"if the menuName is not set", ^{ @@ -159,8 +159,8 @@ describe(@"a preload choices operation", ^{ SDLArtwork *staticIconArt = [SDLArtwork artworkWithStaticIcon:SDLStaticIconNameDate]; SDLChoiceCell *cellWithStaticIcon = [[SDLChoiceCell alloc] initWithText:@"Static Icon" secondaryText:nil tertiaryText:nil voiceCommands:nil artwork:staticIconArt secondaryArtwork:nil]; - cellsWithArtwork = [NSSet setWithArray:@[cell1WithArt, cell2WithArtAndSecondary]]; - cellsWithStaticIcon = [NSSet setWithArray:@[cellWithStaticIcon]]; + cellsWithArtwork = @[cell1WithArt, cell2WithArtAndSecondary]; + cellsWithStaticIcon = @[cellWithStaticIcon]; testOp = [[SDLPreloadChoicesOperation alloc] initWithConnectionManager:testConnectionManager fileManager:testFileManager displayName:testDisplayName windowCapability:windowCapability isVROptional:NO cellsToPreload:cellsWithArtwork]; [testOp start]; @@ -200,12 +200,12 @@ describe(@"a preload choices operation", ^{ }); context(@"without artworks", ^{ - __block NSSet<SDLChoiceCell *> *cellsWithoutArtwork = nil; + __block NSArray<SDLChoiceCell *> *cellsWithoutArtwork = nil; beforeEach(^{ SDLChoiceCell *cellBasic = [[SDLChoiceCell alloc] initWithText:@"Cell1" artwork:nil voiceCommands:nil]; SDLChoiceCell *cellWithVR = [[SDLChoiceCell alloc] initWithText:@"Cell2" secondaryText:nil tertiaryText:nil voiceCommands:@[@"Cell2"] artwork:nil secondaryArtwork:nil]; SDLChoiceCell *cellWithAllText = [[SDLChoiceCell alloc] initWithText:@"Cell2" secondaryText:@"Cell2" tertiaryText:@"Cell2" voiceCommands:nil artwork:nil secondaryArtwork:nil]; - cellsWithoutArtwork = [NSSet setWithArray:@[cellBasic, cellWithVR, cellWithAllText]]; + cellsWithoutArtwork = @[cellBasic, cellWithVR, cellWithAllText]; }); it(@"should skip to preloading cells", ^{ |