summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFrank Elias <francois.elias@livio.io>2020-12-02 11:43:10 -0500
committerFrank Elias <francois.elias@livio.io>2020-12-02 11:43:10 -0500
commit90535fd88838561ae87f730f4a6ac9dce1209824 (patch)
tree818a57c7feee62e8f4d1413b93e04fdcae0e06fc
parent503a9c6acf3534c05f34896a5115239944fcd706 (diff)
downloadsdl_ios-90535fd88838561ae87f730f4a6ac9dce1209824.tar.gz
Unit test fixes
-rw-r--r--SmartDeviceLinkTests/SDLSoftButtonReplaceOperationSpec.m27
1 files changed, 7 insertions, 20 deletions
diff --git a/SmartDeviceLinkTests/SDLSoftButtonReplaceOperationSpec.m b/SmartDeviceLinkTests/SDLSoftButtonReplaceOperationSpec.m
index 91751a814..91e814630 100644
--- a/SmartDeviceLinkTests/SDLSoftButtonReplaceOperationSpec.m
+++ b/SmartDeviceLinkTests/SDLSoftButtonReplaceOperationSpec.m
@@ -270,17 +270,12 @@ describe(@"a soft button replace operation", ^{
beforeEach(^{
capabilities = [[SDLSoftButtonCapabilities alloc] init];
capabilities.imageSupported = @YES;
-// OCMExpect([testFileManager fileNeedsUpload:[OCMArg any]]);
-// OCMStub([testFileManager fileNeedsUpload:[OCMArg isNotNil]]);
});
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];
-// OCMExpect([testFileManager fileNeedsUpload:[OCMArg any]]).andReturn(YES);
});
it(@"should not upload artworks", ^{
@@ -304,24 +299,21 @@ describe(@"a soft button replace operation", ^{
});
it(@"should properly overwrite artwork", ^{
-// OCMExpect([testFileManager fileNeedsUpload:[OCMArg any]]);
- OCMStub([testFileManager fileNeedsUpload:[OCMArg isNotNil]]).andReturn(YES);
OCMExpect([testFileManager uploadArtworks:[OCMArg any] progressHandler:[OCMArg any] completionHandler:[OCMArg any]]);
-
+ OCMExpect([testFileManager fileNeedsUpload:[OCMArg any]]);
+ OCMStub([testFileManager fileNeedsUpload:[OCMArg isNotNil]]).andReturn(YES);
object2State1 = [[SDLSoftButtonState alloc] initWithStateName:object2State1Name text:object2State1Text artwork:object2State11Art];
buttonWithTextAndImage = [[SDLSoftButtonObject alloc] initWithName:object2Name states:@[object2State1, object2State2] initialStateName:object2State1.name handler:^(SDLOnButtonPress * _Nullable buttonPress, SDLOnButtonEvent * _Nullable buttonEvent) {}];
testSoftButtonObjects = @[buttonWithText, buttonWithTextAndImage];
testOp = [[SDLSoftButtonReplaceOperation alloc] initWithConnectionManager:testConnectionManager fileManager:testFileManager capabilities:capabilities softButtonObjects:testSoftButtonObjects mainField1:testMainField1];
-// OCMExpect([testFileManager fileNeedsUpload:[OCMArg isNil]]).andReturn(YES);
+ OCMExpect([testFileManager fileNeedsUpload:[OCMArg any]]);
[testOp start];
-// OCMStub([testFileManager fileNeedsUpload:[OCMArg isNotNil]]).andReturn(YES);
OCMVerify([testFileManager uploadArtworks:[OCMArg any] progressHandler:[OCMArg any] completionHandler:[OCMArg any]]);
});
context(@"When a response is received to the upload", ^{
beforeEach(^{
-// OCMExpect([testFileManager fileNeedsUpload:[OCMArg isNotNil]]);
-// OCMStub([testFileManager fileNeedsUpload:[OCMArg isNotNil]]).andReturn(YES);
+ OCMStub([testFileManager fileNeedsUpload:[OCMArg any]]).andReturn(NO);
[testOp start];
});
@@ -344,7 +336,6 @@ describe(@"a soft button replace operation", ^{
context(@"when the artworks need uploading", ^{
beforeEach(^{
OCMStub([testFileManager hasUploadedFile:[OCMArg isNotNil]]).andReturn(NO);
-// OCMStub([testFileManager fileNeedsUpload:[OCMArg isNotNil]]).andReturn(YES);
});
context(@"when artworks are static icons", ^{
@@ -394,18 +385,14 @@ describe(@"a soft button replace operation", ^{
});
context(@"when artworks are dynamic icons", ^{
-// beforeEach(^{
-// OCMStub([testFileManager fileNeedsUpload:[OCMArg any]]);
-// });
-
it(@"should upload all artworks", ^{
// Check that the artworks in the initial button states are uploaded
OCMExpect([testFileManager uploadArtworks:@[buttonWithTextAndImage.states[0].artwork] progressHandler:[OCMArg invokeBlock] completionHandler:[OCMArg invokeBlock]]);
-// OCMExpect([testFileManager fileNeedsUpload:[OCMArg any]]);
-// OCMStub([testFileManager fileNeedsUpload:[OCMArg isNotNil]]).andReturn(YES);
+ OCMExpect([testFileManager fileNeedsUpload:[OCMArg any]]);
+ OCMStub([testFileManager fileNeedsUpload:[OCMArg isNotNil]]).andReturn(YES);
testSoftButtonObjects = @[buttonWithText, buttonWithTextAndImage];
testOp = [[SDLSoftButtonReplaceOperation alloc] initWithConnectionManager:testConnectionManager fileManager:testFileManager capabilities:capabilities softButtonObjects:testSoftButtonObjects mainField1:testMainField1];
-// OCMStub([testFileManager fileNeedsUpload:[OCMArg any]]).andReturn(YES);
+ OCMExpect([testFileManager fileNeedsUpload:[OCMArg any]]);
[testOp start];
OCMVerifyAllWithDelay(testFileManager, 0.5);