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,12 +6,17 @@
// Copyright (c) 2013 HicknHack Software GmbH. All rights reserved.
//
#import "KPKTestNSCoding.h"
#import <XCTest/XCTest.h>
#import "KPKEntry.h"
#import "KPKBinary.h"
#import "KPKAttribute.h"
#import "KPKXmlElements.h"
@interface KPKTestNSCoding : XCTestCase
@end
@implementation KPKTestNSCoding
- (void)testAttributeCoding {
@@ -19,13 +24,13 @@
NSData *data = [self encode:attribute];
KPKAttribute *copy = [self decode:data ofClass:[KPKAttribute class]];
STAssertTrue([copy.value isEqualToString:attribute.value], @"Values should be preseved");
STAssertTrue([copy.key isEqualToString:attribute.key], @"Keys should be preserved");
STAssertTrue(copy.isProtected == attribute.isProtected, @"Protected status should be the same");
XCTAssertTrue([copy.value isEqualToString:attribute.value], @"Values should be preseved");
XCTAssertTrue([copy.key isEqualToString:attribute.key], @"Keys should be preserved");
XCTAssertTrue(copy.isProtected == attribute.isProtected, @"Protected status should be the same");
}
- (void)testBinaryCoding {
XCTFail(@"Not Tested");
}
- (void)testEntryCoding {
@@ -49,19 +54,19 @@
NSData *encodedData = [self encode:entry];
KPKEntry *copyEntry = [self decode:encodedData ofClass:[KPKEntry class]];
STAssertNotNil(copyEntry, @"Copied Entry cannot be nil");
STAssertTrue([copyEntry.title isEqualToString:entry.title], @"Titles should match");
STAssertTrue([copyEntry.url isEqualToString:entry.url], @"URLS should match");
STAssertTrue([copyEntry.binaries count] == 1, @"Binareis should be copied");
XCTAssertNotNil(copyEntry, @"Copied Entry cannot be nil");
XCTAssertTrue([copyEntry.title isEqualToString:entry.title], @"Titles should match");
XCTAssertTrue([copyEntry.url isEqualToString:entry.url], @"URLS should match");
XCTAssertTrue([copyEntry.binaries count] == 1, @"Binareis should be copied");
KPKBinary *copiedBinary = [copyEntry.binaries lastObject];
STAssertTrue([copiedBinary.data isEqualToData:binary.data], @"Binary data should match");
STAssertTrue([copiedBinary.name isEqualToString:binary.name], @"Binary names should macht");
XCTAssertTrue([copiedBinary.data isEqualToData:binary.data], @"Binary data should match");
XCTAssertTrue([copiedBinary.name isEqualToString:binary.name], @"Binary names should macht");
}
- (void)testGroupCoding {
XCTFail(@"Not Implemented");
}