aboutsummaryrefslogtreecommitdiffstats
path: root/UnitTests
diff options
context:
space:
mode:
authorstuconnolly <stuart02@gmail.com>2011-09-06 21:21:36 +0000
committerstuconnolly <stuart02@gmail.com>2011-09-06 21:21:36 +0000
commit0e096fe30fe8af5bee4b9e1f8e422862dc2dd189 (patch)
treec9da2e42bc81245ab2c8e16b8e511184871a12a4 /UnitTests
parent09a79031bed30c1cf95e1b9de85bf73b2ce38300 (diff)
downloadsequelpro-0e096fe30fe8af5bee4b9e1f8e422862dc2dd189.tar.gz
sequelpro-0e096fe30fe8af5bee4b9e1f8e422862dc2dd189.tar.bz2
sequelpro-0e096fe30fe8af5bee4b9e1f8e422862dc2dd189.zip
More QueryKit progress. Still very rough.
Diffstat (limited to 'UnitTests')
-rw-r--r--UnitTests/QKSelectQueryTests.m21
1 files changed, 16 insertions, 5 deletions
diff --git a/UnitTests/QKSelectQueryTests.m b/UnitTests/QKSelectQueryTests.m
index fca26f99..f1329f46 100644
--- a/UnitTests/QKSelectQueryTests.m
+++ b/UnitTests/QKSelectQueryTests.m
@@ -41,6 +41,13 @@ static NSString *SPTestFieldFour = @"test_field4";
- (void)setUp
{
_query = [QKQuery selectQueryFromTable:SPTestTableName];
+
+ [_query addField:SPTestFieldOne];
+ [_query addField:SPTestFieldTwo];
+ [_query addField:SPTestFieldThree];
+ [_query addField:SPTestFieldFour];
+
+ [_query addParameter:SPTestFieldOne operator:QKEqualityOperator value:@"10"];
}
-(void)tearDown
@@ -53,12 +60,16 @@ static NSString *SPTestFieldFour = @"test_field4";
- (void)testSelectQueryTypeIsCorrect
{
- [_query addField:SPTestFieldOne];
- [_query addField:SPTestFieldTwo];
- [_query addField:SPTestFieldThree];
- [_query addField:SPTestFieldFour];
-
STAssertTrue([[_query query] hasPrefix:@"SELECT"], @"query type");
}
+- (void)testSelectQueryFieldsAreCorrect
+{
+ NSString *query = [NSString stringWithFormat:@"SELECT %@, %@, %@, %@", SPTestFieldOne, SPTestFieldTwo, SPTestFieldThree, SPTestFieldFour];
+
+ NSLog(@"%@", _query);
+
+ STAssertTrue([[_query query] hasPrefix:query], @"query fields");
+}
+
@end