aboutsummaryrefslogtreecommitdiffstats
path: root/Frameworks/QueryKit
diff options
context:
space:
mode:
Diffstat (limited to 'Frameworks/QueryKit')
-rw-r--r--Frameworks/QueryKit/QueryKit.xcodeproj/project.pbxproj44
-rw-r--r--Frameworks/QueryKit/Tests/QKSelectQueryGroupByTests.m2
-rw-r--r--Frameworks/QueryKit/Tests/QKSelectQueryOrderByTests.m18
3 files changed, 57 insertions, 7 deletions
diff --git a/Frameworks/QueryKit/QueryKit.xcodeproj/project.pbxproj b/Frameworks/QueryKit/QueryKit.xcodeproj/project.pbxproj
index 6d52f5f0..efbdb9f1 100644
--- a/Frameworks/QueryKit/QueryKit.xcodeproj/project.pbxproj
+++ b/Frameworks/QueryKit/QueryKit.xcodeproj/project.pbxproj
@@ -133,6 +133,40 @@
path = Source;
sourceTree = "<group>";
};
+ 17322A7214FA645300F0CF9B /* SELECT Tests */ = {
+ isa = PBXGroup;
+ children = (
+ 17E5969714F307B70054EE08 /* QKSelectQueryTests.h */,
+ 17E5969814F307B70054EE08 /* QKSelectQueryTests.m */,
+ 1713ECAE14F96A5C0013C4F0 /* QKSelectQueryOrderByTests.h */,
+ 1713ECAF14F96A5C0013C4F0 /* QKSelectQueryOrderByTests.m */,
+ 1713ECD614F970BB0013C4F0 /* QKSelectQueryGroupByTests.h */,
+ 1713ECD714F970BB0013C4F0 /* QKSelectQueryGroupByTests.m */,
+ );
+ name = "SELECT Tests";
+ sourceTree = "<group>";
+ };
+ 17322A7414FA646000F0CF9B /* UPDATE Tests */ = {
+ isa = PBXGroup;
+ children = (
+ );
+ name = "UPDATE Tests";
+ sourceTree = "<group>";
+ };
+ 17322A7514FA647200F0CF9B /* DELETE Tests */ = {
+ isa = PBXGroup;
+ children = (
+ );
+ name = "DELETE Tests";
+ sourceTree = "<group>";
+ };
+ 17322A7614FA648100F0CF9B /* INSERT Tests */ = {
+ isa = PBXGroup;
+ children = (
+ );
+ name = "INSERT Tests";
+ sourceTree = "<group>";
+ };
17E5952814F301F40054EE08 /* Constants */ = {
isa = PBXGroup;
children = (
@@ -145,12 +179,10 @@
17E5969614F3079E0054EE08 /* Tests */ = {
isa = PBXGroup;
children = (
- 17E5969714F307B70054EE08 /* QKSelectQueryTests.h */,
- 17E5969814F307B70054EE08 /* QKSelectQueryTests.m */,
- 1713ECAE14F96A5C0013C4F0 /* QKSelectQueryOrderByTests.h */,
- 1713ECAF14F96A5C0013C4F0 /* QKSelectQueryOrderByTests.m */,
- 1713ECD614F970BB0013C4F0 /* QKSelectQueryGroupByTests.h */,
- 1713ECD714F970BB0013C4F0 /* QKSelectQueryGroupByTests.m */,
+ 17322A7614FA648100F0CF9B /* INSERT Tests */,
+ 17322A7514FA647200F0CF9B /* DELETE Tests */,
+ 17322A7414FA646000F0CF9B /* UPDATE Tests */,
+ 17322A7214FA645300F0CF9B /* SELECT Tests */,
);
path = Tests;
sourceTree = "<group>";
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