aboutsummaryrefslogtreecommitdiffstats
path: root/UnitTests/SPDatabaseInfoTest.m
diff options
context:
space:
mode:
Diffstat (limited to 'UnitTests/SPDatabaseInfoTest.m')
-rw-r--r--UnitTests/SPDatabaseInfoTest.m24
1 files changed, 16 insertions, 8 deletions
diff --git a/UnitTests/SPDatabaseInfoTest.m b/UnitTests/SPDatabaseInfoTest.m
index a53104e9..fc2309e3 100644
--- a/UnitTests/SPDatabaseInfoTest.m
+++ b/UnitTests/SPDatabaseInfoTest.m
@@ -24,28 +24,35 @@
// More info at <http://code.google.com/p/sequel-pro/>
#import <OCMock/OCMock.h>
+
#import "SPDatabaseInfo.h"
#import "SPDatabaseInfoTest.h"
-
@implementation SPDatabaseInfoTest
-- (SPDatabaseInfo *)getDatabaseInfoFixture {
+- (SPDatabaseInfo *)getDatabaseInfoFixture
+{
SPDatabaseInfo *dbInfo = [[SPDatabaseInfo alloc] init];
+
return dbInfo;
}
-- (id) getMockConnection {
+- (id) getMockConnection
+{
id mockConnection = [OCMockObject niceMockForClass:[MCPConnection class]];
+
return mockConnection;
}
-- (id) getMockMCPResult {
+- (id) getMockMCPResult
+{
id mockResult = [OCMockObject niceMockForClass:[MCPResult class]];
+
return mockResult;
}
-- (void)testDatabaseExists {
+- (void)testDatabaseExists
+{
SPDatabaseInfo *dbInfo = [self getDatabaseInfoFixture];
NSArray *tables = [[NSArray alloc] initWithObjects: @"db_one", nil];
@@ -62,7 +69,8 @@
[mockConnection verify];
}
-- (void)testListDBs {
+- (void)testListDBs
+{
SPDatabaseInfo *dbInfo = [self getDatabaseInfoFixture];
id mockConnection = [self getMockConnection];
[[mockConnection expect] queryString:@"SHOW DATABASES"];
@@ -71,7 +79,8 @@
[mockConnection verify];
}
-- (void)testListDBsLike {
+- (void)testListDBsLike
+{
SPDatabaseInfo *dbInfo = [self getDatabaseInfoFixture];
id mockConnection = [self getMockConnection];
[[mockConnection expect] queryString:@"SHOW DATABASES LIKE `test_db`"];
@@ -80,5 +89,4 @@
[mockConnection verify];
}
-
@end