aboutsummaryrefslogtreecommitdiffstats
path: root/Frameworks/QueryKit/Tests
diff options
context:
space:
mode:
authorstuconnolly <stuart02@gmail.com>2012-02-26 13:01:37 +0000
committerstuconnolly <stuart02@gmail.com>2012-02-26 13:01:37 +0000
commita5caf49b945179abdc0570a6ba8797b4552c793b (patch)
tree61ac27740379205934359e8e810633adfba1d697 /Frameworks/QueryKit/Tests
parent32f109cf3eb2f28499f256f280525c45282e2a4e (diff)
downloadsequelpro-a5caf49b945179abdc0570a6ba8797b4552c793b.tar.gz
sequelpro-a5caf49b945179abdc0570a6ba8797b4552c793b.tar.bz2
sequelpro-a5caf49b945179abdc0570a6ba8797b4552c793b.zip
More QueryKit SELECT tests.
Diffstat (limited to 'Frameworks/QueryKit/Tests')
-rw-r--r--Frameworks/QueryKit/Tests/QKSelectQueryGroupByTests.m2
-rw-r--r--Frameworks/QueryKit/Tests/QKSelectQueryOrderByTests.m18
2 files changed, 19 insertions, 1 deletions
diff --git a/Frameworks/QueryKit/Tests/QKSelectQueryGroupByTests.m b/Frameworks/QueryKit/Tests/QKSelectQueryGroupByTests.m
index 722d7df0..9bbe75a2 100644
--- a/Frameworks/QueryKit/Tests/QKSelectQueryGroupByTests.m
+++ b/Frameworks/QueryKit/Tests/QKSelectQueryGroupByTests.m
@@ -67,7 +67,7 @@ static NSString *QKTestFieldTwo = @"test_field2";
STAssertTrue([[_query query] hasSuffix:query], @"query group by");
}
-- (void)testSelectQueryMultipleGroupByIsCorrect
+- (void)testSelectQueryGroupByMultipleFieldsIsCorrect
{
[_query groupByFields:[NSArray arrayWithObjects:QKTestFieldOne, QKTestFieldTwo, nil]];
diff --git a/Frameworks/QueryKit/Tests/QKSelectQueryOrderByTests.m b/Frameworks/QueryKit/Tests/QKSelectQueryOrderByTests.m
index 4f33d657..84bd5ddb 100644
--- a/Frameworks/QueryKit/Tests/QKSelectQueryOrderByTests.m
+++ b/Frameworks/QueryKit/Tests/QKSelectQueryOrderByTests.m
@@ -67,6 +67,15 @@ static NSString *QKTestFieldTwo = @"test_field2";
STAssertTrue([[_query query] hasSuffix:query], @"query order by");
}
+- (void)testSelectQueryOrderByMultipleFieldsAscendingIsCorrect
+{
+ [_query orderByFields:[NSArray arrayWithObjects:QKTestFieldOne, QKTestFieldTwo, nil] descending:NO];
+
+ NSString *query = [NSString stringWithFormat:@"ORDER BY %@, %@ ASC", QKTestFieldOne, QKTestFieldTwo];
+
+ STAssertTrue([[_query query] hasSuffix:query], @"query order by");
+}
+
- (void)testSelectQueryOrderByDescendingIsCorrect
{
[_query orderByField:QKTestFieldOne descending:YES];
@@ -76,4 +85,13 @@ static NSString *QKTestFieldTwo = @"test_field2";
STAssertTrue([[_query query] hasSuffix:query], @"query order by");
}
+- (void)testSelectQueryOrderByMultipleFieldsDescendingIsCorrect
+{
+ [_query orderByFields:[NSArray arrayWithObjects:QKTestFieldOne, QKTestFieldTwo, nil] descending:YES];
+
+ NSString *query = [NSString stringWithFormat:@"ORDER BY %@, %@ DESC", QKTestFieldOne, QKTestFieldTwo];
+
+ STAssertTrue([[_query query] hasSuffix:query], @"query order by");
+}
+
@end