diff options
author | Justin Beharry <justin.beharry@livio.io> | 2022-08-30 13:50:44 -0400 |
---|---|---|
committer | Justin Beharry <justin.beharry@livio.io> | 2022-08-30 13:50:44 -0400 |
commit | 3bf1448dddaaacc5d32612b3b06ab66a64e7b576 (patch) | |
tree | 2708c40f755cbbc400a41a79c05814ab2698737b /SmartDeviceLinkTests | |
parent | 494784242cc4b8422785cee59e49b0f3ee805990 (diff) | |
download | sdl_ios-3bf1448dddaaacc5d32612b3b06ab66a64e7b576.tar.gz |
Refactor and rename from revisions
Diffstat (limited to 'SmartDeviceLinkTests')
-rw-r--r-- | SmartDeviceLinkTests/DevAPISpecs/SDLTextAndGraphicManagerSpec.m | 8 | ||||
-rw-r--r-- | SmartDeviceLinkTests/DevAPISpecs/SDLTextAndGraphicUpdateOperationSpec.m | 68 |
2 files changed, 40 insertions, 36 deletions
diff --git a/SmartDeviceLinkTests/DevAPISpecs/SDLTextAndGraphicManagerSpec.m b/SmartDeviceLinkTests/DevAPISpecs/SDLTextAndGraphicManagerSpec.m index 89aec0e09..18ac8e32f 100644 --- a/SmartDeviceLinkTests/DevAPISpecs/SDLTextAndGraphicManagerSpec.m +++ b/SmartDeviceLinkTests/DevAPISpecs/SDLTextAndGraphicManagerSpec.m @@ -466,7 +466,7 @@ describe(@"text and graphic manager", ^{ // with good data context(@"with good data", ^{ beforeEach(^{ - testOperation.currentDataUpdatedHandler(testOperation.updatedState, nil, nil); + testOperation.currentDataUpdatedHandler(testOperation.updatedState, nil); }); it(@"should update the manager's and pending operations' current screen data", ^{ @@ -486,7 +486,11 @@ describe(@"text and graphic manager", ^{ testManager.textField1 = errorState.textField1; testManager.textField4 = @"Good Data"; testOperation3 = testManager.transactionQueue.operations[3]; - testOperation.currentDataUpdatedHandler(nil, [NSError errorWithDomain:@"any" code:1 userInfo:nil], errorState); + + NSDictionary *userInfo = @{ + @"failedScreenState": errorState + }; + testOperation.currentDataUpdatedHandler(nil, [NSError errorWithDomain:@"any" code:1 userInfo:userInfo]); }); it(@"should reset the manager's data and update other operations updated state", ^{ diff --git a/SmartDeviceLinkTests/DevAPISpecs/SDLTextAndGraphicUpdateOperationSpec.m b/SmartDeviceLinkTests/DevAPISpecs/SDLTextAndGraphicUpdateOperationSpec.m index 81bca428e..4a3ace47d 100644 --- a/SmartDeviceLinkTests/DevAPISpecs/SDLTextAndGraphicUpdateOperationSpec.m +++ b/SmartDeviceLinkTests/DevAPISpecs/SDLTextAndGraphicUpdateOperationSpec.m @@ -120,7 +120,7 @@ describe(@"the text and graphic operation", ^{ updatedState.textField3 = field3String; updatedState.textField4 = field4String; - testOp = [[SDLTextAndGraphicUpdateOperation alloc] initWithConnectionManager:testConnectionManager fileManager:mockFileManager currentCapabilities:windowCapability currentScreenData:emptyCurrentData newState:updatedState currentScreenDataUpdatedHandler:^(SDLTextAndGraphicState * _Nullable newScreenData, NSError * _Nullable error, SDLTextAndGraphicState *_Nullable errorScreenData) {} updateCompletionHandler:nil]; + testOp = [[SDLTextAndGraphicUpdateOperation alloc] initWithConnectionManager:testConnectionManager fileManager:mockFileManager currentCapabilities:windowCapability currentScreenData:emptyCurrentData newState:updatedState currentScreenDataUpdatedHandler:^(SDLTextAndGraphicState * _Nullable newScreenData, NSError * _Nullable error) {} updateCompletionHandler:nil]; [testOp start]; [testConnectionManager respondToLastRequestWithResponse:successShowResponse]; @@ -163,7 +163,7 @@ describe(@"the text and graphic operation", ^{ }); it(@"should send the media track and title", ^{ - testOp = [[SDLTextAndGraphicUpdateOperation alloc] initWithConnectionManager:testConnectionManager fileManager:mockFileManager currentCapabilities:windowCapability currentScreenData:emptyCurrentData newState:updatedState currentScreenDataUpdatedHandler:^(SDLTextAndGraphicState * _Nullable newScreenData, NSError * _Nullable error, SDLTextAndGraphicState *_Nullable errorScreenData) {} updateCompletionHandler:nil]; + testOp = [[SDLTextAndGraphicUpdateOperation alloc] initWithConnectionManager:testConnectionManager fileManager:mockFileManager currentCapabilities:windowCapability currentScreenData:emptyCurrentData newState:updatedState currentScreenDataUpdatedHandler:^(SDLTextAndGraphicState * _Nullable newScreenData, NSError * _Nullable error) {} updateCompletionHandler:nil]; [testOp start]; SDLShow *sentShow = testConnectionManager.receivedRequests.firstObject; @@ -179,7 +179,7 @@ describe(@"the text and graphic operation", ^{ }); it(@"should not send the media track and title", ^{ - testOp = [[SDLTextAndGraphicUpdateOperation alloc] initWithConnectionManager:testConnectionManager fileManager:mockFileManager currentCapabilities:windowCapability currentScreenData:emptyCurrentData newState:updatedState currentScreenDataUpdatedHandler:^(SDLTextAndGraphicState * _Nullable newScreenData, NSError * _Nullable error, SDLTextAndGraphicState *_Nullable errorScreenData) {} updateCompletionHandler:nil]; + testOp = [[SDLTextAndGraphicUpdateOperation alloc] initWithConnectionManager:testConnectionManager fileManager:mockFileManager currentCapabilities:windowCapability currentScreenData:emptyCurrentData newState:updatedState currentScreenDataUpdatedHandler:^(SDLTextAndGraphicState * _Nullable newScreenData, NSError * _Nullable error) {} updateCompletionHandler:nil]; [testOp start]; SDLShow *sentShow = testConnectionManager.receivedRequests.firstObject; @@ -201,7 +201,7 @@ describe(@"the text and graphic operation", ^{ updatedState = [[SDLTextAndGraphicState alloc] init]; updatedState.textField1 = field1String; - testOp = [[SDLTextAndGraphicUpdateOperation alloc] initWithConnectionManager:testConnectionManager fileManager:mockFileManager currentCapabilities:windowCapability currentScreenData:emptyCurrentData newState:updatedState currentScreenDataUpdatedHandler:^(SDLTextAndGraphicState * _Nullable newScreenData, NSError * _Nullable error, SDLTextAndGraphicState *_Nullable errorScreenData) {} updateCompletionHandler:nil]; + testOp = [[SDLTextAndGraphicUpdateOperation alloc] initWithConnectionManager:testConnectionManager fileManager:mockFileManager currentCapabilities:windowCapability currentScreenData:emptyCurrentData newState:updatedState currentScreenDataUpdatedHandler:^(SDLTextAndGraphicState * _Nullable newScreenData, NSError * _Nullable error) {} updateCompletionHandler:nil]; [testOp start]; [testConnectionManager respondToLastRequestWithResponse:successShowResponse]; @@ -233,7 +233,7 @@ describe(@"the text and graphic operation", ^{ updatedState.textField1 = field1String; updatedState.textField2 = field2String; - testOp = [[SDLTextAndGraphicUpdateOperation alloc] initWithConnectionManager:testConnectionManager fileManager:mockFileManager currentCapabilities:windowCapability currentScreenData:emptyCurrentData newState:updatedState currentScreenDataUpdatedHandler:^(SDLTextAndGraphicState * _Nullable newScreenData, NSError * _Nullable error, SDLTextAndGraphicState *_Nullable errorScreenData) {} updateCompletionHandler:nil]; + testOp = [[SDLTextAndGraphicUpdateOperation alloc] initWithConnectionManager:testConnectionManager fileManager:mockFileManager currentCapabilities:windowCapability currentScreenData:emptyCurrentData newState:updatedState currentScreenDataUpdatedHandler:^(SDLTextAndGraphicState * _Nullable newScreenData, NSError * _Nullable error) {} updateCompletionHandler:nil]; [testOp start]; [testConnectionManager respondToLastRequestWithResponse:successShowResponse]; @@ -266,7 +266,7 @@ describe(@"the text and graphic operation", ^{ updatedState.textField2 = field2String; updatedState.textField3 = field3String; - testOp = [[SDLTextAndGraphicUpdateOperation alloc] initWithConnectionManager:testConnectionManager fileManager:mockFileManager currentCapabilities:windowCapability currentScreenData:emptyCurrentData newState:updatedState currentScreenDataUpdatedHandler:^(SDLTextAndGraphicState * _Nullable newScreenData, NSError * _Nullable error, SDLTextAndGraphicState *_Nullable errorScreenData) {} updateCompletionHandler:nil]; + testOp = [[SDLTextAndGraphicUpdateOperation alloc] initWithConnectionManager:testConnectionManager fileManager:mockFileManager currentCapabilities:windowCapability currentScreenData:emptyCurrentData newState:updatedState currentScreenDataUpdatedHandler:^(SDLTextAndGraphicState * _Nullable newScreenData, NSError * _Nullable error) {} updateCompletionHandler:nil]; [testOp start]; [testConnectionManager respondToLastRequestWithResponse:successShowResponse]; @@ -300,7 +300,7 @@ describe(@"the text and graphic operation", ^{ updatedState.textField3 = field3String; updatedState.textField4 = field4String; - testOp = [[SDLTextAndGraphicUpdateOperation alloc] initWithConnectionManager:testConnectionManager fileManager:mockFileManager currentCapabilities:windowCapability currentScreenData:emptyCurrentData newState:updatedState currentScreenDataUpdatedHandler:^(SDLTextAndGraphicState * _Nullable newScreenData, NSError * _Nullable error, SDLTextAndGraphicState *_Nullable errorScreenData) {} updateCompletionHandler:nil]; + testOp = [[SDLTextAndGraphicUpdateOperation alloc] initWithConnectionManager:testConnectionManager fileManager:mockFileManager currentCapabilities:windowCapability currentScreenData:emptyCurrentData newState:updatedState currentScreenDataUpdatedHandler:^(SDLTextAndGraphicState * _Nullable newScreenData, NSError * _Nullable error) {} updateCompletionHandler:nil]; [testOp start]; [testConnectionManager respondToLastRequestWithResponse:successShowResponse]; @@ -339,7 +339,7 @@ describe(@"the text and graphic operation", ^{ updatedState = [[SDLTextAndGraphicState alloc] init]; updatedState.textField1 = field1String; - testOp = [[SDLTextAndGraphicUpdateOperation alloc] initWithConnectionManager:testConnectionManager fileManager:mockFileManager currentCapabilities:windowCapability currentScreenData:emptyCurrentData newState:updatedState currentScreenDataUpdatedHandler:^(SDLTextAndGraphicState * _Nullable newScreenData, NSError * _Nullable error, SDLTextAndGraphicState *_Nullable errorScreenData) {} updateCompletionHandler:nil]; + testOp = [[SDLTextAndGraphicUpdateOperation alloc] initWithConnectionManager:testConnectionManager fileManager:mockFileManager currentCapabilities:windowCapability currentScreenData:emptyCurrentData newState:updatedState currentScreenDataUpdatedHandler:^(SDLTextAndGraphicState * _Nullable newScreenData, NSError * _Nullable error) {} updateCompletionHandler:nil]; [testOp start]; [testConnectionManager respondToLastRequestWithResponse:successShowResponse]; @@ -371,7 +371,7 @@ describe(@"the text and graphic operation", ^{ updatedState.textField1 = field1String; updatedState.textField2 = field2String; - testOp = [[SDLTextAndGraphicUpdateOperation alloc] initWithConnectionManager:testConnectionManager fileManager:mockFileManager currentCapabilities:windowCapability currentScreenData:emptyCurrentData newState:updatedState currentScreenDataUpdatedHandler:^(SDLTextAndGraphicState * _Nullable newScreenData, NSError * _Nullable error, SDLTextAndGraphicState *_Nullable errorScreenData) {} updateCompletionHandler:nil]; + testOp = [[SDLTextAndGraphicUpdateOperation alloc] initWithConnectionManager:testConnectionManager fileManager:mockFileManager currentCapabilities:windowCapability currentScreenData:emptyCurrentData newState:updatedState currentScreenDataUpdatedHandler:^(SDLTextAndGraphicState * _Nullable newScreenData, NSError * _Nullable error) {} updateCompletionHandler:nil]; [testOp start]; [testConnectionManager respondToLastRequestWithResponse:successShowResponse]; @@ -404,7 +404,7 @@ describe(@"the text and graphic operation", ^{ updatedState.textField2 = field2String; updatedState.textField3 = field3String; - testOp = [[SDLTextAndGraphicUpdateOperation alloc] initWithConnectionManager:testConnectionManager fileManager:mockFileManager currentCapabilities:windowCapability currentScreenData:emptyCurrentData newState:updatedState currentScreenDataUpdatedHandler:^(SDLTextAndGraphicState * _Nullable newScreenData, NSError * _Nullable error, SDLTextAndGraphicState *_Nullable errorScreenData) {} updateCompletionHandler:nil]; + testOp = [[SDLTextAndGraphicUpdateOperation alloc] initWithConnectionManager:testConnectionManager fileManager:mockFileManager currentCapabilities:windowCapability currentScreenData:emptyCurrentData newState:updatedState currentScreenDataUpdatedHandler:^(SDLTextAndGraphicState * _Nullable newScreenData, NSError * _Nullable error) {} updateCompletionHandler:nil]; [testOp start]; [testConnectionManager respondToLastRequestWithResponse:successShowResponse]; @@ -438,7 +438,7 @@ describe(@"the text and graphic operation", ^{ updatedState.textField3 = field3String; updatedState.textField4 = field4String; - testOp = [[SDLTextAndGraphicUpdateOperation alloc] initWithConnectionManager:testConnectionManager fileManager:mockFileManager currentCapabilities:windowCapability currentScreenData:emptyCurrentData newState:updatedState currentScreenDataUpdatedHandler:^(SDLTextAndGraphicState * _Nullable newScreenData, NSError * _Nullable error, SDLTextAndGraphicState *_Nullable errorScreenData) {} updateCompletionHandler:nil]; + testOp = [[SDLTextAndGraphicUpdateOperation alloc] initWithConnectionManager:testConnectionManager fileManager:mockFileManager currentCapabilities:windowCapability currentScreenData:emptyCurrentData newState:updatedState currentScreenDataUpdatedHandler:^(SDLTextAndGraphicState * _Nullable newScreenData, NSError * _Nullable error) {} updateCompletionHandler:nil]; [testOp start]; [testConnectionManager respondToLastRequestWithResponse:successShowResponse]; @@ -477,7 +477,7 @@ describe(@"the text and graphic operation", ^{ updatedState = [[SDLTextAndGraphicState alloc] init]; updatedState.textField1 = field1String; - testOp = [[SDLTextAndGraphicUpdateOperation alloc] initWithConnectionManager:testConnectionManager fileManager:mockFileManager currentCapabilities:windowCapability currentScreenData:emptyCurrentData newState:updatedState currentScreenDataUpdatedHandler:^(SDLTextAndGraphicState * _Nullable newScreenData, NSError * _Nullable error, SDLTextAndGraphicState *_Nullable errorScreenData) {} updateCompletionHandler:nil]; + testOp = [[SDLTextAndGraphicUpdateOperation alloc] initWithConnectionManager:testConnectionManager fileManager:mockFileManager currentCapabilities:windowCapability currentScreenData:emptyCurrentData newState:updatedState currentScreenDataUpdatedHandler:^(SDLTextAndGraphicState * _Nullable newScreenData, NSError * _Nullable error) {} updateCompletionHandler:nil]; [testOp start]; [testConnectionManager respondToLastRequestWithResponse:successShowResponse]; @@ -509,7 +509,7 @@ describe(@"the text and graphic operation", ^{ updatedState.textField1 = field1String; updatedState.textField2 = field2String; - testOp = [[SDLTextAndGraphicUpdateOperation alloc] initWithConnectionManager:testConnectionManager fileManager:mockFileManager currentCapabilities:windowCapability currentScreenData:emptyCurrentData newState:updatedState currentScreenDataUpdatedHandler:^(SDLTextAndGraphicState * _Nullable newScreenData, NSError * _Nullable error, SDLTextAndGraphicState *_Nullable errorScreenData) {} updateCompletionHandler:nil]; + testOp = [[SDLTextAndGraphicUpdateOperation alloc] initWithConnectionManager:testConnectionManager fileManager:mockFileManager currentCapabilities:windowCapability currentScreenData:emptyCurrentData newState:updatedState currentScreenDataUpdatedHandler:^(SDLTextAndGraphicState * _Nullable newScreenData, NSError * _Nullable error) {} updateCompletionHandler:nil]; [testOp start]; [testConnectionManager respondToLastRequestWithResponse:successShowResponse]; @@ -542,7 +542,7 @@ describe(@"the text and graphic operation", ^{ updatedState.textField2 = field2String; updatedState.textField3 = field3String; - testOp = [[SDLTextAndGraphicUpdateOperation alloc] initWithConnectionManager:testConnectionManager fileManager:mockFileManager currentCapabilities:windowCapability currentScreenData:emptyCurrentData newState:updatedState currentScreenDataUpdatedHandler:^(SDLTextAndGraphicState * _Nullable newScreenData, NSError * _Nullable error, SDLTextAndGraphicState *_Nullable errorScreenData) {} updateCompletionHandler:nil]; + testOp = [[SDLTextAndGraphicUpdateOperation alloc] initWithConnectionManager:testConnectionManager fileManager:mockFileManager currentCapabilities:windowCapability currentScreenData:emptyCurrentData newState:updatedState currentScreenDataUpdatedHandler:^(SDLTextAndGraphicState * _Nullable newScreenData, NSError * _Nullable error) {} updateCompletionHandler:nil]; [testOp start]; [testConnectionManager respondToLastRequestWithResponse:successShowResponse]; @@ -576,7 +576,7 @@ describe(@"the text and graphic operation", ^{ updatedState.textField3 = field3String; updatedState.textField4 = field4String; - testOp = [[SDLTextAndGraphicUpdateOperation alloc] initWithConnectionManager:testConnectionManager fileManager:mockFileManager currentCapabilities:windowCapability currentScreenData:emptyCurrentData newState:updatedState currentScreenDataUpdatedHandler:^(SDLTextAndGraphicState * _Nullable newScreenData, NSError * _Nullable error, SDLTextAndGraphicState *_Nullable errorScreenData) {} updateCompletionHandler:nil]; + testOp = [[SDLTextAndGraphicUpdateOperation alloc] initWithConnectionManager:testConnectionManager fileManager:mockFileManager currentCapabilities:windowCapability currentScreenData:emptyCurrentData newState:updatedState currentScreenDataUpdatedHandler:^(SDLTextAndGraphicState * _Nullable newScreenData, NSError * _Nullable error) {} updateCompletionHandler:nil]; [testOp start]; [testConnectionManager respondToLastRequestWithResponse:successShowResponse]; @@ -615,7 +615,7 @@ describe(@"the text and graphic operation", ^{ updatedState = [[SDLTextAndGraphicState alloc] init]; updatedState.textField1 = field1String; - testOp = [[SDLTextAndGraphicUpdateOperation alloc] initWithConnectionManager:testConnectionManager fileManager:mockFileManager currentCapabilities:windowCapability currentScreenData:emptyCurrentData newState:updatedState currentScreenDataUpdatedHandler:^(SDLTextAndGraphicState * _Nullable newScreenData, NSError * _Nullable error, SDLTextAndGraphicState *_Nullable errorScreenData) {} updateCompletionHandler:nil]; + testOp = [[SDLTextAndGraphicUpdateOperation alloc] initWithConnectionManager:testConnectionManager fileManager:mockFileManager currentCapabilities:windowCapability currentScreenData:emptyCurrentData newState:updatedState currentScreenDataUpdatedHandler:^(SDLTextAndGraphicState * _Nullable newScreenData, NSError * _Nullable error) {} updateCompletionHandler:nil]; [testOp start]; [testConnectionManager respondToLastRequestWithResponse:successShowResponse]; @@ -647,7 +647,7 @@ describe(@"the text and graphic operation", ^{ updatedState.textField1 = field1String; updatedState.textField2 = field2String; - testOp = [[SDLTextAndGraphicUpdateOperation alloc] initWithConnectionManager:testConnectionManager fileManager:mockFileManager currentCapabilities:windowCapability currentScreenData:emptyCurrentData newState:updatedState currentScreenDataUpdatedHandler:^(SDLTextAndGraphicState * _Nullable newScreenData, NSError * _Nullable error, SDLTextAndGraphicState *_Nullable errorScreenData) {} updateCompletionHandler:nil]; + testOp = [[SDLTextAndGraphicUpdateOperation alloc] initWithConnectionManager:testConnectionManager fileManager:mockFileManager currentCapabilities:windowCapability currentScreenData:emptyCurrentData newState:updatedState currentScreenDataUpdatedHandler:^(SDLTextAndGraphicState * _Nullable newScreenData, NSError * _Nullable error) {} updateCompletionHandler:nil]; [testOp start]; [testConnectionManager respondToLastRequestWithResponse:successShowResponse]; @@ -680,7 +680,7 @@ describe(@"the text and graphic operation", ^{ updatedState.textField2 = field2String; updatedState.textField3 = field3String; - testOp = [[SDLTextAndGraphicUpdateOperation alloc] initWithConnectionManager:testConnectionManager fileManager:mockFileManager currentCapabilities:windowCapability currentScreenData:emptyCurrentData newState:updatedState currentScreenDataUpdatedHandler:^(SDLTextAndGraphicState * _Nullable newScreenData, NSError * _Nullable error, SDLTextAndGraphicState *_Nullable errorScreenData) {} updateCompletionHandler:nil]; + testOp = [[SDLTextAndGraphicUpdateOperation alloc] initWithConnectionManager:testConnectionManager fileManager:mockFileManager currentCapabilities:windowCapability currentScreenData:emptyCurrentData newState:updatedState currentScreenDataUpdatedHandler:^(SDLTextAndGraphicState * _Nullable newScreenData, NSError * _Nullable error) {} updateCompletionHandler:nil]; [testOp start]; [testConnectionManager respondToLastRequestWithResponse:successShowResponse]; @@ -714,7 +714,7 @@ describe(@"the text and graphic operation", ^{ updatedState.textField3 = field3String; updatedState.textField4 = field4String; - testOp = [[SDLTextAndGraphicUpdateOperation alloc] initWithConnectionManager:testConnectionManager fileManager:mockFileManager currentCapabilities:windowCapability currentScreenData:emptyCurrentData newState:updatedState currentScreenDataUpdatedHandler:^(SDLTextAndGraphicState * _Nullable newScreenData, NSError * _Nullable error, SDLTextAndGraphicState *_Nullable errorScreenData) {} updateCompletionHandler:nil]; + testOp = [[SDLTextAndGraphicUpdateOperation alloc] initWithConnectionManager:testConnectionManager fileManager:mockFileManager currentCapabilities:windowCapability currentScreenData:emptyCurrentData newState:updatedState currentScreenDataUpdatedHandler:^(SDLTextAndGraphicState * _Nullable newScreenData, NSError * _Nullable error) {} updateCompletionHandler:nil]; [testOp start]; [testConnectionManager respondToLastRequestWithResponse:successShowResponse]; @@ -754,7 +754,7 @@ describe(@"the text and graphic operation", ^{ updatedState.textField3 = field3String; updatedState.textField4 = field4String; - testOp = [[SDLTextAndGraphicUpdateOperation alloc] initWithConnectionManager:testConnectionManager fileManager:mockFileManager currentCapabilities:windowCapability currentScreenData:emptyCurrentData newState:updatedState currentScreenDataUpdatedHandler:^(SDLTextAndGraphicState * _Nullable newScreenData, NSError * _Nullable error, SDLTextAndGraphicState *_Nullable errorScreenData) {} updateCompletionHandler:^(NSError * _Nullable error) { + testOp = [[SDLTextAndGraphicUpdateOperation alloc] initWithConnectionManager:testConnectionManager fileManager:mockFileManager currentCapabilities:windowCapability currentScreenData:emptyCurrentData newState:updatedState currentScreenDataUpdatedHandler:^(SDLTextAndGraphicState * _Nullable newScreenData, NSError * _Nullable error) {} updateCompletionHandler:^(NSError * _Nullable error) { didCallHandler = YES; }]; [testOp start]; @@ -780,7 +780,7 @@ describe(@"the text and graphic operation", ^{ updatedState.textField3 = field3String; updatedState.textField4 = field4String; - testOp = [[SDLTextAndGraphicUpdateOperation alloc] initWithConnectionManager:testConnectionManager fileManager:mockFileManager currentCapabilities:windowCapability currentScreenData:emptyCurrentData newState:updatedState currentScreenDataUpdatedHandler:^(SDLTextAndGraphicState * _Nullable newScreenData, NSError * _Nullable error, SDLTextAndGraphicState *_Nullable errorScreenData) { + testOp = [[SDLTextAndGraphicUpdateOperation alloc] initWithConnectionManager:testConnectionManager fileManager:mockFileManager currentCapabilities:windowCapability currentScreenData:emptyCurrentData newState:updatedState currentScreenDataUpdatedHandler:^(SDLTextAndGraphicState * _Nullable newScreenData, NSError * _Nullable error) { updatedData = newScreenData; } updateCompletionHandler:nil]; [testOp start]; @@ -823,7 +823,7 @@ describe(@"the text and graphic operation", ^{ }); it(@"should send a show and not upload any artworks", ^{ - testOp = [[SDLTextAndGraphicUpdateOperation alloc] initWithConnectionManager:testConnectionManager fileManager:mockFileManager currentCapabilities:windowCapability currentScreenData:emptyCurrentData newState:updatedState currentScreenDataUpdatedHandler:^(SDLTextAndGraphicState * _Nullable newScreenData, NSError * _Nullable error, SDLTextAndGraphicState *_Nullable errorScreenData) {} updateCompletionHandler:nil]; + testOp = [[SDLTextAndGraphicUpdateOperation alloc] initWithConnectionManager:testConnectionManager fileManager:mockFileManager currentCapabilities:windowCapability currentScreenData:emptyCurrentData newState:updatedState currentScreenDataUpdatedHandler:^(SDLTextAndGraphicState * _Nullable newScreenData, NSError * _Nullable error) {} updateCompletionHandler:nil]; [testOp start]; expect(testConnectionManager.receivedRequests).to(haveCount(1)); @@ -845,7 +845,7 @@ describe(@"the text and graphic operation", ^{ updatedState2.primaryGraphic = testArtwork3; updatedState2.secondaryGraphic = testArtwork2; - SDLTextAndGraphicUpdateOperation *testOp2 = [[SDLTextAndGraphicUpdateOperation alloc] initWithConnectionManager:testConnectionManager fileManager:mockFileManager currentCapabilities:windowCapability currentScreenData:updatedState newState:updatedState2 currentScreenDataUpdatedHandler:^(SDLTextAndGraphicState * _Nullable newScreenData, NSError * _Nullable error, SDLTextAndGraphicState *_Nullable errorScreenData) {} updateCompletionHandler:nil]; + SDLTextAndGraphicUpdateOperation *testOp2 = [[SDLTextAndGraphicUpdateOperation alloc] initWithConnectionManager:testConnectionManager fileManager:mockFileManager currentCapabilities:windowCapability currentScreenData:updatedState newState:updatedState2 currentScreenDataUpdatedHandler:^(SDLTextAndGraphicState * _Nullable newScreenData, NSError * _Nullable error) {} updateCompletionHandler:nil]; [testOp2 start]; [testConnectionManager respondToLastRequestWithResponse:successShowResponse]; @@ -862,7 +862,7 @@ describe(@"the text and graphic operation", ^{ updatedState.primaryGraphic = testArtwork; updatedState.secondaryGraphic = testArtwork2; - testOp = [[SDLTextAndGraphicUpdateOperation alloc] initWithConnectionManager:testConnectionManager fileManager:mockFileManager currentCapabilities:windowCapability currentScreenData:emptyCurrentData newState:updatedState currentScreenDataUpdatedHandler:^(SDLTextAndGraphicState * _Nullable newScreenData, NSError * _Nullable error, SDLTextAndGraphicState *_Nullable errorScreenData) {} updateCompletionHandler:nil]; + testOp = [[SDLTextAndGraphicUpdateOperation alloc] initWithConnectionManager:testConnectionManager fileManager:mockFileManager currentCapabilities:windowCapability currentScreenData:emptyCurrentData newState:updatedState currentScreenDataUpdatedHandler:^(SDLTextAndGraphicState * _Nullable newScreenData, NSError * _Nullable error) {} updateCompletionHandler:nil]; [testOp start]; }); @@ -892,7 +892,7 @@ describe(@"the text and graphic operation", ^{ updatedState.textField1 = field1String; updatedState.primaryGraphic = testArtwork; - testOp = [[SDLTextAndGraphicUpdateOperation alloc] initWithConnectionManager:testConnectionManager fileManager:mockFileManager currentCapabilities:windowCapability currentScreenData:emptyCurrentData newState:updatedState currentScreenDataUpdatedHandler:^(SDLTextAndGraphicState * _Nullable newScreenData, NSError * _Nullable error, SDLTextAndGraphicState *_Nullable errorScreenData) { + testOp = [[SDLTextAndGraphicUpdateOperation alloc] initWithConnectionManager:testConnectionManager fileManager:mockFileManager currentCapabilities:windowCapability currentScreenData:emptyCurrentData newState:updatedState currentScreenDataUpdatedHandler:^(SDLTextAndGraphicState * _Nullable newScreenData, NSError * _Nullable error) { receivedState = newScreenData; receivedError = error; } updateCompletionHandler:^(NSError * _Nullable error) { @@ -967,7 +967,7 @@ describe(@"the text and graphic operation", ^{ updatedState = [[SDLTextAndGraphicState alloc] init]; updatedState.primaryGraphic = testArtwork; - testOp = [[SDLTextAndGraphicUpdateOperation alloc] initWithConnectionManager:testConnectionManager fileManager:mockFileManager currentCapabilities:windowCapability currentScreenData:emptyCurrentData newState:updatedState currentScreenDataUpdatedHandler:^(SDLTextAndGraphicState * _Nullable newScreenData, NSError * _Nullable error, SDLTextAndGraphicState *_Nullable errorScreenData) {} updateCompletionHandler:nil]; + testOp = [[SDLTextAndGraphicUpdateOperation alloc] initWithConnectionManager:testConnectionManager fileManager:mockFileManager currentCapabilities:windowCapability currentScreenData:emptyCurrentData newState:updatedState currentScreenDataUpdatedHandler:^(SDLTextAndGraphicState * _Nullable newScreenData, NSError * _Nullable error) {} updateCompletionHandler:nil]; [testOp start]; }); @@ -997,7 +997,7 @@ describe(@"the text and graphic operation", ^{ updatedState = [[SDLTextAndGraphicState alloc] init]; updatedState.primaryGraphic = testStaticIcon; - testOp = [[SDLTextAndGraphicUpdateOperation alloc] initWithConnectionManager:testConnectionManager fileManager:mockFileManager currentCapabilities:windowCapability currentScreenData:emptyCurrentData newState:updatedState currentScreenDataUpdatedHandler:^(SDLTextAndGraphicState * _Nullable newScreenData, NSError * _Nullable error, SDLTextAndGraphicState *_Nullable errorScreenData) {} updateCompletionHandler:nil]; + testOp = [[SDLTextAndGraphicUpdateOperation alloc] initWithConnectionManager:testConnectionManager fileManager:mockFileManager currentCapabilities:windowCapability currentScreenData:emptyCurrentData newState:updatedState currentScreenDataUpdatedHandler:^(SDLTextAndGraphicState * _Nullable newScreenData, NSError * _Nullable error) {} updateCompletionHandler:nil]; [testOp start]; }); @@ -1032,7 +1032,7 @@ describe(@"the text and graphic operation", ^{ updatedState.primaryGraphic = testArtwork; updatedState.secondaryGraphic = testArtwork2; - testOp = [[SDLTextAndGraphicUpdateOperation alloc] initWithConnectionManager:testConnectionManager fileManager:mockFileManager currentCapabilities:windowCapability currentScreenData:emptyCurrentData newState:updatedState currentScreenDataUpdatedHandler:^(SDLTextAndGraphicState * _Nullable newScreenData, NSError * _Nullable error, SDLTextAndGraphicState *_Nullable errorScreenData) {} updateCompletionHandler:nil]; + testOp = [[SDLTextAndGraphicUpdateOperation alloc] initWithConnectionManager:testConnectionManager fileManager:mockFileManager currentCapabilities:windowCapability currentScreenData:emptyCurrentData newState:updatedState currentScreenDataUpdatedHandler:^(SDLTextAndGraphicState * _Nullable newScreenData, NSError * _Nullable error) {} updateCompletionHandler:nil]; [testOp start]; }); @@ -1059,7 +1059,7 @@ describe(@"the text and graphic operation", ^{ updatedState.primaryGraphic = testArtwork; updatedState.secondaryGraphic = testArtwork2; - testOp = [[SDLTextAndGraphicUpdateOperation alloc] initWithConnectionManager:testConnectionManager fileManager:mockFileManager currentCapabilities:windowCapability currentScreenData:emptyCurrentData newState:updatedState currentScreenDataUpdatedHandler:^(SDLTextAndGraphicState * _Nullable newScreenData, NSError * _Nullable error, SDLTextAndGraphicState *_Nullable errorScreenData) {} updateCompletionHandler:nil]; + testOp = [[SDLTextAndGraphicUpdateOperation alloc] initWithConnectionManager:testConnectionManager fileManager:mockFileManager currentCapabilities:windowCapability currentScreenData:emptyCurrentData newState:updatedState currentScreenDataUpdatedHandler:^(SDLTextAndGraphicState * _Nullable newScreenData, NSError * _Nullable error) {} updateCompletionHandler:nil]; [testOp start]; expect(testConnectionManager.receivedRequests).to(haveCount(1)); @@ -1088,7 +1088,7 @@ describe(@"the text and graphic operation", ^{ updatedState.primaryGraphic = testArtwork; updatedState.secondaryGraphic = testArtwork2; - testOp = [[SDLTextAndGraphicUpdateOperation alloc] initWithConnectionManager:testConnectionManager fileManager:mockFileManager currentCapabilities:windowCapability currentScreenData:emptyCurrentData newState:updatedState currentScreenDataUpdatedHandler:^(SDLTextAndGraphicState * _Nullable newScreenData, NSError * _Nullable error, SDLTextAndGraphicState *_Nullable errorScreenData) {} updateCompletionHandler:nil]; + testOp = [[SDLTextAndGraphicUpdateOperation alloc] initWithConnectionManager:testConnectionManager fileManager:mockFileManager currentCapabilities:windowCapability currentScreenData:emptyCurrentData newState:updatedState currentScreenDataUpdatedHandler:^(SDLTextAndGraphicState * _Nullable newScreenData, NSError * _Nullable error) {} updateCompletionHandler:nil]; [testOp start]; expect(testConnectionManager.receivedRequests).to(haveCount(1)); @@ -1121,7 +1121,7 @@ describe(@"the text and graphic operation", ^{ beforeEach(^{ updatedState = [[SDLTextAndGraphicState alloc] init]; updatedState.templateConfig = newConfiguration; - testOp = [[SDLTextAndGraphicUpdateOperation alloc] initWithConnectionManager:testConnectionManager fileManager:mockFileManager currentCapabilities:allEnabledCapability currentScreenData:emptyCurrentData newState:updatedState currentScreenDataUpdatedHandler:^(SDLTextAndGraphicState * _Nullable newScreenData, NSError * _Nullable error, SDLTextAndGraphicState *_Nullable errorScreenData) { + testOp = [[SDLTextAndGraphicUpdateOperation alloc] initWithConnectionManager:testConnectionManager fileManager:mockFileManager currentCapabilities:allEnabledCapability currentScreenData:emptyCurrentData newState:updatedState currentScreenDataUpdatedHandler:^(SDLTextAndGraphicState * _Nullable newScreenData, NSError * _Nullable error) { receivedState = newScreenData; receivedError = error; } updateCompletionHandler:nil]; @@ -1153,7 +1153,7 @@ describe(@"the text and graphic operation", ^{ updatedState = [[SDLTextAndGraphicState alloc] init]; updatedState.templateConfig = newConfiguration; updatedState.textField1 = field1String; - testOp = [[SDLTextAndGraphicUpdateOperation alloc] initWithConnectionManager:testConnectionManager fileManager:mockFileManager currentCapabilities:allEnabledCapability currentScreenData:emptyCurrentData newState:updatedState currentScreenDataUpdatedHandler:^(SDLTextAndGraphicState * _Nullable newScreenData, NSError * _Nullable error, SDLTextAndGraphicState *_Nullable errorScreenData) { + testOp = [[SDLTextAndGraphicUpdateOperation alloc] initWithConnectionManager:testConnectionManager fileManager:mockFileManager currentCapabilities:allEnabledCapability currentScreenData:emptyCurrentData newState:updatedState currentScreenDataUpdatedHandler:^(SDLTextAndGraphicState * _Nullable newScreenData, NSError * _Nullable error) { receivedState = newScreenData; receivedError = error; } updateCompletionHandler:^(NSError * _Nullable error) { @@ -1240,7 +1240,7 @@ describe(@"the text and graphic operation", ^{ beforeEach(^{ updatedState = [[SDLTextAndGraphicState alloc] init]; updatedState.templateConfig = newConfiguration; - testOp = [[SDLTextAndGraphicUpdateOperation alloc] initWithConnectionManager:testConnectionManager fileManager:mockFileManager currentCapabilities:allEnabledCapability currentScreenData:emptyCurrentData newState:updatedState currentScreenDataUpdatedHandler:^(SDLTextAndGraphicState * _Nullable newScreenData, NSError * _Nullable error, SDLTextAndGraphicState *_Nullable errorScreenData) { + testOp = [[SDLTextAndGraphicUpdateOperation alloc] initWithConnectionManager:testConnectionManager fileManager:mockFileManager currentCapabilities:allEnabledCapability currentScreenData:emptyCurrentData newState:updatedState currentScreenDataUpdatedHandler:^(SDLTextAndGraphicState * _Nullable newScreenData, NSError * _Nullable error) { receivedState = newScreenData; receivedError = error; } updateCompletionHandler:nil]; @@ -1266,7 +1266,7 @@ describe(@"the text and graphic operation", ^{ updatedState = [[SDLTextAndGraphicState alloc] init]; updatedState.templateConfig = newConfiguration; updatedState.textField1 = field1String; - testOp = [[SDLTextAndGraphicUpdateOperation alloc] initWithConnectionManager:testConnectionManager fileManager:mockFileManager currentCapabilities:allEnabledCapability currentScreenData:emptyCurrentData newState:updatedState currentScreenDataUpdatedHandler:^(SDLTextAndGraphicState * _Nullable newScreenData, NSError * _Nullable error, SDLTextAndGraphicState *_Nullable errorScreenData) { + testOp = [[SDLTextAndGraphicUpdateOperation alloc] initWithConnectionManager:testConnectionManager fileManager:mockFileManager currentCapabilities:allEnabledCapability currentScreenData:emptyCurrentData newState:updatedState currentScreenDataUpdatedHandler:^(SDLTextAndGraphicState * _Nullable newScreenData, NSError * _Nullable error) { receivedState = newScreenData; receivedError = error; } updateCompletionHandler:nil]; |