IOSAD-172 Test for 2 passphrases IOSAD-172
authorDirk Zimmermann <dz@pep.security>
Thu, 25 Jun 2020 17:08:21 +0200
branchIOSAD-172
changeset 14532da4a0ba6b07
parent 1452 5bd6583a7f5c
child 1454 45299c4176f1
IOSAD-172 Test for 2 passphrases
pEpObjCTests/PEPPassphraseCacheTest.m
     1.1 --- a/pEpObjCTests/PEPPassphraseCacheTest.m	Thu Jun 25 17:08:21 2020 +0200
     1.2 +++ b/pEpObjCTests/PEPPassphraseCacheTest.m	Thu Jun 25 17:08:21 2020 +0200
     1.3 @@ -34,7 +34,21 @@
     1.4      NSString *passphrase = @"somepass";
     1.5      [self.cache addPassphrase:passphrase];
     1.6      XCTAssertEqual(self.cache.passphrases.count, 2);
     1.7 -    XCTAssertEqualObjects(self.cache.passphrases, @[@""]);
     1.8 +    NSArray *expected = @[@"", passphrase];
     1.9 +    XCTAssertEqualObjects(self.cache.passphrases, expected);
    1.10 +}
    1.11 +
    1.12 +- (void)testContainsSetPassphrases
    1.13 +{
    1.14 +    NSString *passphrase1 = @"somepass1";
    1.15 +    NSString *passphrase2 = @"somepass2";
    1.16 +
    1.17 +    [self.cache addPassphrase:passphrase1];
    1.18 +    [self.cache addPassphrase:passphrase2];
    1.19 +
    1.20 +    XCTAssertEqual(self.cache.passphrases.count, 3);
    1.21 +    NSArray *expected = @[@"", passphrase1, passphrase2];
    1.22 +    XCTAssertEqualObjects(self.cache.passphrases, expected);
    1.23  }
    1.24  
    1.25  @end