Migrated project to XCTest

This commit is contained in:
michael starke
2014-02-15 18:35:56 +01:00
parent edd2d89d30
commit 1f1c6d5dcb
22 changed files with 228 additions and 359 deletions

View File

@@ -6,10 +6,15 @@
// Copyright (c) 2013 HicknHack Software GmbH. All rights reserved.
//
#import "KPKTestXmlWriting.h"
#import <XCTest/XCTest.h>
#import "KPKCompositeKey.h"
#import "KPKTree+Serializing.h"
@interface KPKTestXmlWriting : XCTestCase
@end
@implementation KPKTestXmlWriting
- (void)testXmlWriting {
@@ -19,7 +24,7 @@
KPKTree *tree = [[KPKTree alloc] initWithData:data password:password error:&error];
error = nil;
NSData *saveData = [tree encryptWithPassword:password forVersion:KPKXmlVersion error:&error];
STAssertNotNil(saveData, @"Serialization should yield data");
XCTAssertNotNil(saveData, @"Serialization should yield data");
NSString *tempFile = [NSTemporaryDirectory() stringByAppendingString:@"CustomIcon_Password_1234_save.kdbx"];
NSLog(@"Saved file to %@", tempFile);
[saveData writeToFile:tempFile atomically:YES];
@@ -27,7 +32,7 @@
error = nil;
NSURL *url = [NSURL fileURLWithPath:tempFile];
KPKTree *reloadedTree = [[KPKTree alloc] initWithContentsOfUrl:url password:password error:&error];
STAssertNotNil(reloadedTree, @"Reloaded tree should not be nil");
XCTAssertNotNil(reloadedTree, @"Reloaded tree should not be nil");
}
- (NSData *)_loadTestDataBase:(NSString *)name extension:(NSString *)extension {