IOSAD-177 Fail test with missing "passphrase too long" IOSAD-177
authorDirk Zimmermann <dz@pep.security>
Thu, 09 Jul 2020 13:33:11 +0200
branchIOSAD-177
changeset 16710051a0a9cd2b
parent 1670 cfd98c545e37
child 1672 9f02a665cdc3
IOSAD-177 Fail test with missing "passphrase too long"
pEpObjCTests/PEPSessionTest.m
     1.1 --- a/pEpObjCTests/PEPSessionTest.m	Thu Jul 09 13:32:56 2020 +0200
     1.2 +++ b/pEpObjCTests/PEPSessionTest.m	Thu Jul 09 13:33:11 2020 +0200
     1.3 @@ -1688,8 +1688,10 @@
     1.4      }
     1.5  
     1.6      NSArray *onePassphraseThatIsTooLong = @[passphraseTooLong];
     1.7 -    [PEPObjCAdapter setPassphraseProvider:[[PEPPassphraseProviderMock alloc]
     1.8 -                                           initWithPassphrases:onePassphraseThatIsTooLong]];
     1.9 +    PEPPassphraseProviderMock *passphraseProviderMock1 = [[PEPPassphraseProviderMock
    1.10 +                                                           alloc]
    1.11 +                                                          initWithPassphrases:onePassphraseThatIsTooLong];
    1.12 +    [PEPObjCAdapter setPassphraseProvider:passphraseProviderMock1];
    1.13  
    1.14      XCTAssertFalse([session
    1.15                      encryptMessage:draftMail
    1.16 @@ -1701,6 +1703,7 @@
    1.17  
    1.18      XCTAssertEqualObjects(error.domain, PEPObjCAdapterEngineStatusErrorDomain);
    1.19      XCTAssertEqual(error.code, PEPStatusWrongPassphrase);
    1.20 +    XCTAssertTrue(passphraseProviderMock1.passphraseTooLongWasCalled);
    1.21  
    1.22      // Use case: Passphrase provider set, has correct passphrase after 2 unsuccessful attempts
    1.23