Permalink
Browse files

Deleted GBDatabaseTester and moved the code to GBDatabaseTestingBase.

  • Loading branch information...
1 parent 5a4c4ca commit fd7b2c873fb0826134290ad7ab7a9b2905225de4 @tomaz committed Apr 16, 2010
@@ -1,16 +0,0 @@
-//
-// GBDatabaseTester.h
-// ___PROJECTNAME___
-//
-// Created by ___FULLUSERNAME___ on ___DATE___.
-// Copyright (C) ___YEAR___, ___ORGANIZATIONNAME___. All rights reserved.
-//
-
-#import <Cocoa/Cocoa.h>
-
-@interface GBDatabaseTester : NSObject
-
-- (void) injectInMemoryDatabaseProvider;
-- (void) restoreOriginalDatabaseProvider;
-
-@end
@@ -1,27 +0,0 @@
-//
-// GBDatabaseTester.m
-// ___PROJECTNAME___
-//
-// Created by ___FULLUSERNAME___ on ___DATE___.
-// Copyright (C) ___YEAR___, ___ORGANIZATIONNAME___. All rights reserved.
-//
-
-#import "GBDatabaseProvider.h"
-#import "GBModelController.h"
-#import "GBDatabaseTester.h"
-
-@implementation GBDatabaseTester
-
-- (void) injectInMemoryDatabaseProvider
-{
- logNormal(@"Injecting in-memory database provider...");
- [GBModelController sharedGBModelController].databaseProvider = [[GBDatabaseProvider alloc] initWithInMemoryStoreType];
-}
-
-- (void) restoreOriginalDatabaseProvider
-{
- logNormal(@"Restoring original database provider...");
- [GBModelController sharedGBModelController].databaseProvider = nil;
-}
-
-@end
@@ -22,4 +22,7 @@
GBDatabaseTester* databaseTester;
}
+- (void) injectInMemoryDatabaseProvider;
+- (void) restoreOriginalDatabaseProvider;
+
@end
@@ -6,7 +6,6 @@
// Copyright (C) ___YEAR___, ___ORGANIZATIONNAME___. All rights reserved.
//
-#import "GBDatabaseTester.h"
#import "GBDatabaseTestingBase.h"
@implementation GBDatabaseTestingBase
@@ -16,15 +15,27 @@ @implementation GBDatabaseTestingBase
- (void) setUp
{
registry = [[GBTestObjectsRegistry alloc] init];
- databaseTester = [[GBDatabaseTester alloc] init];
- [databaseTester injectInMemoryDatabaseProvider];
+ [self injectInMemoryDatabaseProvider];
}
- (void) tearDown
{
- [databaseTester restoreOriginalDatabaseProvider];
- [databaseTester invalidate], databaseTester = nil;
+ [self restoreOriginalDatabaseProvider];
[registry invalidate], registry = nil;
}
+#pragma mark Database handling
+
+- (void) injectInMemoryDatabaseProvider
+{
+ logNormal(@"Injecting in-memory database provider...");
+ [GBModelController sharedGBModelController].databaseProvider = [[GBDatabaseProvider alloc] initWithInMemoryStoreType];
+}
+
+- (void) restoreOriginalDatabaseProvider
+{
+ logNormal(@"Restoring original database provider...");
+ [GBModelController sharedGBModelController].databaseProvider = nil;
+}
+
@end

0 comments on commit fd7b2c8

Please sign in to comment.