aboutsummaryrefslogtreecommitdiffstats
path: root/Frameworks/QueryKit/Tests/QKSelectQueryOrderByTests.m
diff options
context:
space:
mode:
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