diff options
author | Frank Elias <francois.elias@livio.io> | 2020-12-02 12:36:27 -0500 |
---|---|---|
committer | Frank Elias <francois.elias@livio.io> | 2020-12-02 12:36:27 -0500 |
commit | 3837dc23952a306b29aef27bc9239b74f3eb5d59 (patch) | |
tree | 5e447fa42868bc08cec5c81ae2468f1ca9905a6c /SmartDeviceLinkTests/SDLSoftButtonReplaceOperationSpec.m | |
parent | 90535fd88838561ae87f730f4a6ac9dce1209824 (diff) | |
download | sdl_ios-3837dc23952a306b29aef27bc9239b74f3eb5d59.tar.gz |
Unit test fixes in SDLSoftButtonReplaceOperation
Diffstat (limited to 'SmartDeviceLinkTests/SDLSoftButtonReplaceOperationSpec.m')
-rw-r--r-- | SmartDeviceLinkTests/SDLSoftButtonReplaceOperationSpec.m | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/SmartDeviceLinkTests/SDLSoftButtonReplaceOperationSpec.m b/SmartDeviceLinkTests/SDLSoftButtonReplaceOperationSpec.m index 91e814630..3b4669d78 100644 --- a/SmartDeviceLinkTests/SDLSoftButtonReplaceOperationSpec.m +++ b/SmartDeviceLinkTests/SDLSoftButtonReplaceOperationSpec.m @@ -274,6 +274,8 @@ describe(@"a soft button replace operation", ^{ context(@"when artworks are already on the system", ^{ beforeEach(^{ + OCMStub([testFileManager hasUploadedFile:[OCMArg isNotNil]]).andReturn(YES); + testSoftButtonObjects = @[buttonWithText, buttonWithTextAndImage]; testOp = [[SDLSoftButtonReplaceOperation alloc] initWithConnectionManager:testConnectionManager fileManager:testFileManager capabilities:capabilities softButtonObjects:testSoftButtonObjects mainField1:testMainField1]; }); @@ -427,19 +429,20 @@ describe(@"a soft button replace operation", ^{ it(@"should upload all artworks even if the initial state does not have artworks", ^{ OCMReject([testFileManager uploadFiles:[OCMArg any] progressHandler:[OCMArg invokeBlock] completionHandler:[OCMArg invokeBlock]]); -// OCMStub([testFileManager fileNeedsUpload:[OCMArg any]]).andReturn(NO); + OCMExpect([testFileManager fileNeedsUpload:[OCMArg isNotNil]]).andReturn(YES); + OCMExpect([testFileManager fileNeedsUpload:[OCMArg isNotNil]]).andReturn(NO); + OCMExpect([testFileManager fileNeedsUpload:[OCMArg isNil]]).andReturn(NO); // buttonWithTextAndImage2 has text in the first state and an text and image in the second & third states testSoftButtonObjects = @[buttonWithTextAndStaticImage, buttonWithTextAndImage2]; testOp = [[SDLSoftButtonReplaceOperation alloc] initWithConnectionManager:testConnectionManager fileManager:testFileManager capabilities:capabilities softButtonObjects:testSoftButtonObjects mainField1:testMainField1]; -// OCMStub([testFileManager fileNeedsUpload:[OCMArg any]]); + [testOp start]; -// OCMStub([testFileManager fileNeedsUpload:[OCMArg any]]).andReturn(YES); OCMVerifyAllWithDelay(testFileManager, 0.5); NSArray<SDLArtwork *> *testArtworkUploads = @[buttonWithTextAndImage2.states[1].artwork, buttonWithTextAndImage2.states[2].artwork]; + OCMStub([testFileManager fileNeedsUpload:[OCMArg isNotNil]]).andReturn(YES); OCMExpect([testFileManager uploadArtworks:testArtworkUploads progressHandler:[OCMArg invokeBlock] completionHandler:[OCMArg invokeBlock]]); -// OCMExpect([testFileManager fileNeedsUpload:[OCMArg any]]); [testConnectionManager respondToLastRequestWithResponse:successResponse]; OCMVerifyAllWithDelay(testFileManager, 0.5); |