Commits

Anonymous committed c7bc805

Rename and cleanup tests

Comments (0)

Files changed (1)

WhereIsMyMac-WithUnitTests/Classes/WhereIsMyMacWindowControllerTests.m

 
 #import <SenTestingKit/SenTestingKit.h>
 #import <OCMock/OCMock.h>
+#import <CoreLocation/CoreLocation.h>
+
 #import "WhereIsMyMacAppDelegate.h"
 #import "WhereIsMyMacWindowController.h"
-#import <objc/runtime.h>
-#import <CoreLocation/CoreLocation.h>
-#import "NSObject+SupersequentImplementation.h"
 
 
 @interface WhereIsMyMacWindowControllerTests : SenTestCase 
 	[_windowController release];
 }
 
-- (void)testLoadWindow
+- (void)testOutletConnectionsAfterLoadWindow
 {
 	// Setup
 	[[_mockLocationManager stub] stopUpdatingLocation];
 	// Execute
 	[_windowController loadWindow];
 
-	WebView *webView = _windowController.webView;
-	NSTextField *locationLabel = _windowController.locationLabel;
-	NSTextField *accuracyLabel = _windowController.accuracyLabel;
+	// Verify
+	STAssertTrue([_windowController isWindowLoaded], nil);
+	STAssertNotNil(_windowController.webView, nil);
+	STAssertNotNil(_windowController.locationLabel, nil);
+	STAssertNotNil(_windowController.accuracyLabel, nil);
+	
 	NSButton *openInBrowserButton = _windowController.openInBrowserButton;
-	
-	STAssertTrue([_windowController isWindowLoaded], @"Window failed to load");
-	STAssertNotNil(webView, @"webView ivar not set on load");
-	STAssertNotNil(locationLabel, @"locationLabel ivar not set on load");
-	STAssertNotNil(accuracyLabel, @"accuracyLabel ivar not set on load");
-	STAssertNotNil(openInBrowserButton, @"openInBrowserButton ivar not set on load");
-	STAssertEqualObjects(_windowController, [openInBrowserButton target],
-		@"openInBrowserButton button doesn't target window controller");
-	STAssertTrue([openInBrowserButton action] == @selector(openInDefaultBrowser:),
-		@"openInBrowserButton button doesn't invoke openInDefaultBrowser:");
+	STAssertNotNil(openInBrowserButton, nil);
+	STAssertEqualObjects(_windowController, [openInBrowserButton target], nil);
+	STAssertEquals([openInBrowserButton action],@selector(openInDefaultBrowser:), nil);
 }
 
-- (void)testWindowDidLoad
+- (void)testWindowDidLoadStartsLocationManager
 {
 	// Setup
 	[[_mockLocationManager expect] setDelegate:_mockLocationFormatter];
 	[_windowController windowDidLoad];
 }
 
-- (void)testDealloc
+- (void)testDeallocStopsLocationManager
 {
 	// Setup
 	NSUInteger preRetainCount = [_mockLocationManager retainCount];