updated to new prefixed KeePassKit API. Fixed tests

This commit is contained in:
michael starke
2016-12-09 10:43:53 +01:00
parent e9563f3f67
commit 08d11f1213
9 changed files with 17 additions and 16 deletions

View File

@@ -28,8 +28,8 @@
XCTAssertTrue(document.encrypted, @"Loaded but unencrypted should be not decrypted");
XCTAssertTrue([document unlockWithPassword:@"1234" keyFileURL:nil error:&error], @"Should decrypt with password");
XCTAssertNil(error, @"No Error should occur on unlocking with correct password");
XCTAssertTrue((document.tree.minimumType = KPKDatabaseFormatKdb), @"Minimal Version should not increase with KDB File loaded");
//STAssertTrue([document.fileType isEqualToString:[MPDocument fileTypeForVersion:KPKLegacyVersion]], @"File type needs to match opened file");
KPKFileVersion kdb = { KPKDatabaseFormatKdb, kKPKKdbFileVersion };
XCTAssertEqual(NSOrderedSame, KPKFileVersionCompare(kdb, document.tree.minimumVersion), @"Minimal Version should not increase with KDB File loaded");
}
- (void)testVersion1WrongPassword {

View File

@@ -28,7 +28,8 @@
- (void)testCreateUntitledDocument {
MPDocument *document = [[MPDocument alloc] initWithType:@"" error:nil];
XCTAssertNotNil(document, @"Document should be created");
XCTAssertTrue(document.tree.minimumType == KPKDatabaseFormatKdb, @"Tree should be Legacy Version in default case");
KPKFileVersion kdb = { KPKDatabaseFormatKdb, kKPKKdbFileVersion };
XCTAssertEqual(NSOrderedSame, KPKFileVersionCompare(kdb, document.tree.minimumVersion), @"Tree should be Legacy Version in default case");
XCTAssertFalse(document.encrypted, @"Document cannot be encrypted at creation");
XCTAssertFalse(document.compositeKey.hasPasswordOrKeyFile, @"Document has no Password/Keyfile and thus is not secured");