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