diff options
author | stuconnolly <stuart02@gmail.com> | 2012-02-26 13:01:37 +0000 |
---|---|---|
committer | stuconnolly <stuart02@gmail.com> | 2012-02-26 13:01:37 +0000 |
commit | a5caf49b945179abdc0570a6ba8797b4552c793b (patch) | |
tree | 61ac27740379205934359e8e810633adfba1d697 /Frameworks/QueryKit | |
parent | 32f109cf3eb2f28499f256f280525c45282e2a4e (diff) | |
download | sequelpro-a5caf49b945179abdc0570a6ba8797b4552c793b.tar.gz sequelpro-a5caf49b945179abdc0570a6ba8797b4552c793b.tar.bz2 sequelpro-a5caf49b945179abdc0570a6ba8797b4552c793b.zip |
More QueryKit SELECT tests.
Diffstat (limited to 'Frameworks/QueryKit')
-rw-r--r-- | Frameworks/QueryKit/QueryKit.xcodeproj/project.pbxproj | 44 | ||||
-rw-r--r-- | Frameworks/QueryKit/Tests/QKSelectQueryGroupByTests.m | 2 | ||||
-rw-r--r-- | Frameworks/QueryKit/Tests/QKSelectQueryOrderByTests.m | 18 |
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 |