Skip to content

Commit

Permalink
Added basic unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
faceleg committed Jan 30, 2013
1 parent 8d2c516 commit d0f5e8f
Show file tree
Hide file tree
Showing 6 changed files with 273 additions and 32 deletions.
22 changes: 22 additions & 0 deletions ACEView Tests/ACEView Tests-Info.plist
@@ -0,0 +1,22 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>en</string>
<key>CFBundleExecutable</key>
<string>${EXECUTABLE_NAME}</string>
<key>CFBundleIdentifier</key>
<string>coi.codeofinterest.${PRODUCT_NAME:rfc1034identifier}</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundlePackageType</key>
<string>BNDL</string>
<key>CFBundleShortVersionString</key>
<string>1.0</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>1</string>
</dict>
</plist>
7 changes: 7 additions & 0 deletions ACEView Tests/ACEView Tests-Prefix.pch
@@ -0,0 +1,7 @@
//
// Prefix header for all source files of the 'ACEView Tests' target in the 'ACEView Tests' project
//

#ifdef __OBJC__
#import <Cocoa/Cocoa.h>
#endif
18 changes: 18 additions & 0 deletions ACEView Tests/ACEView_Tests.h
@@ -0,0 +1,18 @@
//
// ACEView_Tests.h
// ACEView Tests
//
// Created by Michael Robinson on 30/01/13.
// Copyright (c) 2013 Code of Interest. All rights reserved.
//

#import <SenTestingKit/SenTestingKit.h>

@class ACEView;

@interface ACEView_Tests : SenTestCase {
id appDelegate;
ACEView *aceView;
}

@end
40 changes: 40 additions & 0 deletions ACEView Tests/ACEView_Tests.m
@@ -0,0 +1,40 @@
//
// ACEView_Tests.m
// ACEView Tests
//
// Created by Michael Robinson on 30/01/13.
// Copyright (c) 2013 Code of Interest. All rights reserved.
//

#import "ACEView_Tests.h"
#import "ACEViewAppDelegate.h"
#import "ACEView.h"

@implementation ACEView_Tests

- (void)setUp {
[super setUp];
appDelegate = [[NSApplication sharedApplication] delegate];
aceView = [appDelegate aceView];
}

- (void)tearDown {
[super tearDown];
}

- (void)testAppDelegate {
STAssertTrue([appDelegate isKindOfClass:[ACEViewAppDelegate class]],
@"Cannot find the application delegate.");
}

- (void) testAceViewLoad {
STAssertNotNil(aceView, @"ACEView should load");
}

- (void) testSetHTML {
NSString *html = @"<html><head></head><body></body></html>";
[aceView setString:html];
STAssertEqualObjects(html, [aceView string], @"ACEView string should equal set value");
}

@end
2 changes: 2 additions & 0 deletions ACEView Tests/en.lproj/InfoPlist.strings
@@ -0,0 +1,2 @@
/* Localized versions of Info.plist keys */

0 comments on commit d0f5e8f

Please sign in to comment.