mirror of
https://github.com/MacPass/MacPass.git
synced 2025-12-14 15:12:21 +00:00
Migrated project to XCTest
This commit is contained in:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user