Using current KeePassKit. Adopted API changes

This commit is contained in:
michael starke
2015-07-20 18:04:01 +02:00
parent 93db9409b7
commit 98fd2f162f
9 changed files with 29 additions and 16 deletions

View File

@@ -0,0 +1,38 @@
//
// MPDatabaseCreation.m
// MacPass
//
// Created by Michael Starke on 10.07.13.
// Copyright (c) 2013 HicknHack Software GmbH. All rights reserved.
//
#import <XCTest/XCTest.h>
#import "MPDocument.h"
#import "KPKTree.h"
#import "KPKCompositeKey.h"
@interface MPTestDocument : XCTestCase
@end
@implementation MPTestDocument
- (void)testCreateEmptyDocument {
MPDocument *document = [[MPDocument alloc] init];
XCTAssertNotNil(document, @"Document should be created");
XCTAssertNil(document.tree, @"Allocated document should not have a tree");
XCTAssertFalse(document.encrypted, @"Document cannot be encrypted without a tree");
XCTAssertNil(document.compositeKey, @"Document shoudl have not key at all");
}
- (void)testCreateUntitledDocument {
MPDocument *document = [[MPDocument alloc] initWithType:@"" error:nil];
XCTAssertNotNil(document, @"Document should be created");
XCTAssertTrue(document.tree.minimumVersion == KPKLegacyVersion, @"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");
}
@end