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