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,9 +6,13 @@
// Copyright (c) 2013 HicknHack Software GmbH. All rights reserved.
//
#import "KPKTestKeyfileParsing.h"
#import <XCTest/XCTest.h>
#import "NSData+Keyfile.h"
@interface KPKTestKeyfileParsing : XCTestCase
@end
@implementation KPKTestKeyfileParsing
- (void)testXmlKeyfileLoadingValidFile {
@@ -16,32 +20,32 @@
NSURL *url = [myBundle URLForResource:@"Keepass2Key" withExtension:@"xml"];
NSError *error;
NSData *data = [NSData dataWithContentsOfKeyFile:url version:KPKXmlVersion error:&error];
STAssertNotNil(data, @"Data should be loaded");
STAssertNil(error, @"No error should occur on keyfile loading");
XCTAssertNotNil(data, @"Data should be loaded");
XCTAssertNil(error, @"No error should occur on keyfile loading");
}
- (void)testXmlKeyfileLoadingCorruptData {
STAssertFalse(NO, @"Not Implemented");
XCTAssertFalse(NO, @"Not Implemented");
}
- (void)testXmlKeyfileLoadingMissingVersion {
STAssertFalse(NO, @"Not Implemented");
XCTAssertFalse(NO, @"Not Implemented");
}
- (void)testXmlKeyfileLoadingLowerVersion {
STAssertFalse(NO, @"Not Implemented");
XCTAssertFalse(NO, @"Not Implemented");
}
- (void)testXmlKeyfilGeneration {
NSData *data = [NSData generateKeyfiledataForVersion:KPKXmlVersion];
// Test if structure is sound;
STAssertNotNil(data, @"Keydata should have been generated");
XCTAssertNotNil(data, @"Keydata should have been generated");
}
- (void)testLegacyKeyfileGeneration {
NSData *data = [NSData generateKeyfiledataForVersion:KPKLegacyVersion];
// test if strucutre is sound;
STAssertNotNil(data, @"Keydata should have been generated");
XCTAssertNotNil(data, @"Keydata should have been generated");
}
@end