aboutsummaryrefslogtreecommitdiffstats
path: root/Frameworks/QueryKit/Tests/QKSelectQueryOrderByTests.m
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/QKSelectQueryOrderByTests.m
parent32f109cf3eb2f28499f256f280525c45282e2a4e (diff)
downloadsequelpro-a5caf49b945179abdc0570a6ba8797b4552c793b.tar.gz
sequelpro-a5caf49b945179abdc0570a6ba8797b4552c793b.tar.bz2
sequelpro-a5caf49b945179abdc0570a6ba8797b4552c793b.zip
More QueryKit SELECT tests.
Diffstat (limited to 'Frameworks/QueryKit/Tests/QKSelectQueryOrderByTests.m')
-rw-r--r--Frameworks/QueryKit/Tests/QKSelectQueryOrderByTests.m18
1 files changed, 18 insertions, 0 deletions
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