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,13 +6,23 @@
// Copyright (c) 2013 HicknHack Software GmbH. All rights reserved.
//
#import "KPKTestXmlLoading.h"
#import "KPKCompositeKey.h"
#import <XCTest/XCTest.h>
#import "KPKCompositeKey.h"
#import "KPKTree+Serializing.h"
#import "KPKEntry.h"
#import "KPKGroup.h"
@interface KPKTestXmlLoading : XCTestCase {
@private
NSData *_data;
KPKCompositeKey *_password;
}
@end
@implementation KPKTestXmlLoading
- (void)setUp {
@@ -30,10 +40,10 @@
- (void)testLoading {
NSError *error;
KPKTree *tree = [[KPKTree alloc] initWithData:_data password:_password error:&error];
STAssertNotNil(tree, @"Loading should result in a tree object");
XCTAssertNotNil(tree, @"Loading should result in a tree object");
STAssertTrue([tree.root.groups count] == 0, @"Tree contains just root group");
STAssertTrue([tree.root.entries count] == 1, @"Tree has only one entry");
XCTAssertTrue([tree.root.groups count] == 0, @"Tree contains just root group");
XCTAssertTrue([tree.root.entries count] == 1, @"Tree has only one entry");
}
- (void)testAutotypeLoading {
@@ -42,9 +52,9 @@
KPKCompositeKey *password = [[KPKCompositeKey alloc] initWithPassword:@"test" key:nil];
NSError *error;
KPKTree *tree = [[KPKTree alloc] initWithContentsOfUrl:url password:password error:&error];
STAssertNotNil(tree, @"Tree shoud be loaded");
XCTAssertNotNil(tree, @"Tree shoud be loaded");
KPKEntry *entry = tree.root.entries[0];
STAssertNotNil(entry, @"Entry should be there");
XCTAssertNotNil(entry, @"Entry should be there");
}
@end