aboutsummaryrefslogtreecommitdiffstats
path: root/Frameworks/QueryKit/Tests
diff options
context:
space:
mode:
authorstuconnolly <stuart02@gmail.com>2012-07-18 11:24:06 +0000
committerstuconnolly <stuart02@gmail.com>2012-07-18 11:24:06 +0000
commit523a4334f8bf80a0c441871db93ae83eaaa2a5ed (patch)
tree896a3890d9bec824b043371ad7626ab0d9ede8df /Frameworks/QueryKit/Tests
parent25f16dd7b9d6de440763f0d0188a0f7e520b2126 (diff)
downloadsequelpro-523a4334f8bf80a0c441871db93ae83eaaa2a5ed.tar.gz
sequelpro-523a4334f8bf80a0c441871db93ae83eaaa2a5ed.tar.bz2
sequelpro-523a4334f8bf80a0c441871db93ae83eaaa2a5ed.zip
Rework QueryKit's tests to accept parameters allowing use to run them with different data sets.
Diffstat (limited to 'Frameworks/QueryKit/Tests')
-rw-r--r--Frameworks/QueryKit/Tests/QKQueryTests.m53
-rw-r--r--Frameworks/QueryKit/Tests/QKSelectQueryGroupByTests.h40
-rw-r--r--Frameworks/QueryKit/Tests/QKSelectQueryGroupByTests.m78
-rw-r--r--Frameworks/QueryKit/Tests/QKSelectQueryOrderByTests.h40
-rw-r--r--Frameworks/QueryKit/Tests/QKSelectQueryOrderByTests.m116
-rw-r--r--Frameworks/QueryKit/Tests/QKSelectQueryTests.h40
-rw-r--r--Frameworks/QueryKit/Tests/QKSelectQueryTests.m95
-rw-r--r--Frameworks/QueryKit/Tests/QKTestCase.h52
-rw-r--r--Frameworks/QueryKit/Tests/QKTestCase.m55
-rw-r--r--Frameworks/QueryKit/Tests/QKUpdateQueryTests.h40
-rw-r--r--Frameworks/QueryKit/Tests/QKUpdateQueryTests.m75
11 files changed, 464 insertions, 220 deletions
diff --git a/Frameworks/QueryKit/Tests/QKQueryTests.m b/Frameworks/QueryKit/Tests/QKQueryTests.m
index b014c48c..dbccb9c0 100644
--- a/Frameworks/QueryKit/Tests/QKQueryTests.m
+++ b/Frameworks/QueryKit/Tests/QKQueryTests.m
@@ -29,15 +29,12 @@
// OTHER DEALINGS IN THE SOFTWARE.
#import "QKTestConstants.h"
+#import "QKTestCase.h"
#import <QueryKit/QueryKit.h>
#import <SenTestingKit/SenTestingKit.h>
-@interface QKQueryTests : SenTestCase
-{
- QKQuery *_query;
-}
-
+@interface QKQueryTests : QKTestCase
@end
@implementation QKQueryTests
@@ -47,21 +44,23 @@
- (void)setUp
{
- _query = [QKQuery selectQueryFromTable:QKTestTableName];
+ QKQuery *query = [QKQuery selectQueryFromTable:QKTestTableName];
+
+ [query setUseQuotedIdentifiers:NO];
+ [query setQueryDatabase:QKDatabaseMySQL];
- [_query setUseQuotedIdentifiers:NO];
- [_query setQueryDatabase:QKDatabaseMySQL];
+ [query setDatabase:QKTestDatabaseName];
- [_query setDatabase:QKTestDatabaseName];
+ [query addField:QKTestFieldOne];
+ [query addField:QKTestFieldTwo];
+ [query addField:QKTestFieldThree];
+ [query addField:QKTestFieldFour];
- [_query addField:QKTestFieldOne];
- [_query addField:QKTestFieldTwo];
- [_query addField:QKTestFieldThree];
- [_query addField:QKTestFieldFour];
+ [query addParameter:QKTestFieldOne operator:QKEqualityOperator value:[NSNumber numberWithUnsignedInteger:QKTestParameterOne]];
- [_query addParameter:QKTestFieldOne operator:QKEqualityOperator value:[NSNumber numberWithUnsignedInteger:QKTestParameterOne]];
+ [query orderByField:QKTestFieldOne descending:NO];
- [_query orderByField:QKTestFieldOne descending:NO];
+ [self setQuery:query];
}
#pragma mark -
@@ -69,21 +68,21 @@
- (void)testCallingClearOnAQueryCorretlyResetsItToItsDefaultState
{
- [_query clear];
+ [[self query] clear];
- STAssertNil([_query table], @"query table");
- STAssertNil([_query database], @"query database");
+ STAssertNil([[self query] table], @"query table");
+ STAssertNil([[self query] database], @"query database");
- STAssertTrue([_query useQuotedIdentifiers], @"query use quoted identifiers");
- STAssertTrue([[_query identifierQuote] isEqualToString:EMPTY_STRING], @"query identifier quote");
- STAssertTrue([[_query fields] count] == 0, @"query fields");
- STAssertTrue([[_query parameters] count] == 0, @"query parameters");
- STAssertTrue([[_query updateParameters] count] == 0, @"query update parameters");
- STAssertTrue([[_query groupByFields] count] == 0, @"query group by fields");
- STAssertTrue([[_query orderByFields] count] == 0, @"query order by fields");
+ STAssertTrue([[self query] useQuotedIdentifiers], @"query use quoted identifiers");
+ STAssertTrue([[[self query] identifierQuote] isEqualToString:EMPTY_STRING], @"query identifier quote");
+ STAssertTrue([[[self query] fields] count] == 0, @"query fields");
+ STAssertTrue([[[self query] parameters] count] == 0, @"query parameters");
+ STAssertTrue([[[self query] updateParameters] count] == 0, @"query update parameters");
+ STAssertTrue([[[self query] groupByFields] count] == 0, @"query group by fields");
+ STAssertTrue([[[self query] orderByFields] count] == 0, @"query order by fields");
- STAssertEquals([_query queryType], QKUnknownQuery, @"query type");
- STAssertEquals([_query queryDatabase], QKDatabaseUnknown, @"query database");
+ STAssertEquals([[self query] queryType], QKUnknownQuery, @"query type");
+ STAssertEquals([[self query] queryDatabase], QKDatabaseUnknown, @"query database");
}
@end
diff --git a/Frameworks/QueryKit/Tests/QKSelectQueryGroupByTests.h b/Frameworks/QueryKit/Tests/QKSelectQueryGroupByTests.h
new file mode 100644
index 00000000..ba3d9020
--- /dev/null
+++ b/Frameworks/QueryKit/Tests/QKSelectQueryGroupByTests.h
@@ -0,0 +1,40 @@
+//
+// $Id$
+//
+// QKSelectQueryGroupByTests.h
+// QueryKit
+//
+// Created by Stuart Connolly (stuconnolly.com) on July 18, 2012
+// Copyright (c) 2012 Stuart Connolly. All rights reserved.
+//
+// Permission is hereby granted, free of charge, to any person
+// obtaining a copy of this software and associated documentation
+// files (the "Software"), to deal in the Software without
+// restriction, including without limitation the rights to use,
+// copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the
+// Software is furnished to do so, subject to the following
+// conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
+// OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
+// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+// WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+// OTHER DEALINGS IN THE SOFTWARE.
+
+#import "QKTestCase.h"
+
+#import <QueryKit/QueryKit.h>
+#import <SenTestingKit/SenTestingKit.h>
+
+@interface QKSelectQueryGroupByTests : QKTestCase
+
++ (void)addTestForDatabase:(QKQueryDatabase)database withIdentifierQuote:(NSString *)quote toTestSuite:(SenTestSuite *)testSuite;
+
+@end \ No newline at end of file
diff --git a/Frameworks/QueryKit/Tests/QKSelectQueryGroupByTests.m b/Frameworks/QueryKit/Tests/QKSelectQueryGroupByTests.m
index 649f3173..076cb9cb 100644
--- a/Frameworks/QueryKit/Tests/QKSelectQueryGroupByTests.m
+++ b/Frameworks/QueryKit/Tests/QKSelectQueryGroupByTests.m
@@ -28,29 +28,51 @@
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
// OTHER DEALINGS IN THE SOFTWARE.
+#import "QKSelectQueryGroupByTests.h"
#import "QKTestConstants.h"
-#import <QueryKit/QueryKit.h>
-#import <SenTestingKit/SenTestingKit.h>
+@implementation QKSelectQueryGroupByTests
+
+#pragma mark -
+#pragma mark Initialisation
-@interface QKSelectQueryGroupByTests : SenTestCase
++ (id)defaultTestSuite
{
- QKQuery *_query;
+ SenTestSuite *testSuite = [[SenTestSuite alloc] initWithName:NSStringFromClass(self)];
+
+ [self addTestForDatabase:QKDatabaseUnknown withIdentifierQuote:EMPTY_STRING toTestSuite:testSuite];
+ [self addTestForDatabase:QKDatabaseMySQL withIdentifierQuote:QKMySQLIdentifierQuote toTestSuite:testSuite];
+ [self addTestForDatabase:QKDatabasePostgreSQL withIdentifierQuote:QKPostgreSQLIdentifierQuote toTestSuite:testSuite];
+
+ return [testSuite autorelease];
}
-@end
-
-@implementation QKSelectQueryGroupByTests
++ (void)addTestForDatabase:(QKQueryDatabase)database withIdentifierQuote:(NSString *)quote toTestSuite:(SenTestSuite *)testSuite
+{
+ for (NSInvocation *invocation in [self testInvocations])
+ {
+ SenTestCase *test = [[QKSelectQueryGroupByTests alloc] initWithInvocation:invocation database:database identifierQuote:quote];
+
+ [testSuite addTest:test];
+
+ [test release];
+ }
+}
#pragma mark -
#pragma mark Setup
- (void)setUp
{
- _query = [QKQuery selectQueryFromTable:QKTestTableName];
+ QKQuery *query = [QKQuery selectQueryFromTable:QKTestTableName];
+
+ [query setQueryDatabase:[self database]];
+ [query setUseQuotedIdentifiers:[self identifierQuote] && [[self identifierQuote] length] > 0];
+
+ [query addField:QKTestFieldOne];
+ [query addField:QKTestFieldTwo];
- [_query addField:QKTestFieldOne];
- [_query addField:QKTestFieldTwo];
+ [self setQuery:query];
}
#pragma mark -
@@ -58,45 +80,25 @@
- (void)testSelectQueryTypeIsCorrect
{
- STAssertTrue([[_query query] hasPrefix:@"SELECT"], @"select query type");
+ STAssertTrue([[[self query] query] hasPrefix:@"SELECT"], nil);
}
- (void)testSelectQueryGroupByIsCorrect
{
- [_query groupByField:QKTestFieldOne];
+ [[self query] groupByField:QKTestFieldOne];
- NSString *query = [NSString stringWithFormat:@"GROUP BY `%@`", QKTestFieldOne];
-
- STAssertTrue([[_query query] hasSuffix:query], @"select query group by");
-}
-
-- (void)testSelectQueryGroupByWithoutQuotesIsCorrect
-{
- [_query setUseQuotedIdentifiers:NO];
- [_query groupByField:QKTestFieldOne];
-
- NSString *query = [NSString stringWithFormat:@"GROUP BY %@", QKTestFieldOne];
-
- STAssertTrue([[_query query] hasSuffix:query], @"select query group by without quotes");
+ NSString *query = [NSString stringWithFormat:@"GROUP BY %1$@%2$@%1$@", [self identifierQuote], QKTestFieldOne];
+
+ STAssertTrue([[[self query] query] hasSuffix:query], nil);
}
- (void)testSelectQueryGroupByMultipleFieldsIsCorrect
{
- [_query groupByFields:[NSArray arrayWithObjects:QKTestFieldOne, QKTestFieldTwo, nil]];
-
- NSString *query = [NSString stringWithFormat:@"GROUP BY `%@`, `%@`", QKTestFieldOne, QKTestFieldTwo];
-
- STAssertTrue([[_query query] hasSuffix:query], @"select query group by multiple fields");
-}
-
-- (void)testSelectQueryGroupByMultipleFieldsWithoutQuotesIsCorrect
-{
- [_query setUseQuotedIdentifiers:NO];
- [_query groupByFields:[NSArray arrayWithObjects:QKTestFieldOne, QKTestFieldTwo, nil]];
+ [[self query] groupByFields:[NSArray arrayWithObjects:QKTestFieldOne, QKTestFieldTwo, nil]];
- NSString *query = [NSString stringWithFormat:@"GROUP BY %@, %@", QKTestFieldOne, QKTestFieldTwo];
+ NSString *query = [NSString stringWithFormat:@"GROUP BY %1$@%2$@%1$@, %1$@%3$@%1$@", [self identifierQuote], QKTestFieldOne, QKTestFieldTwo];
- STAssertTrue([[_query query] hasSuffix:query], @"select query group by multiple fields without quotes");
+ STAssertTrue([[[self query] query] hasSuffix:query], nil);
}
@end
diff --git a/Frameworks/QueryKit/Tests/QKSelectQueryOrderByTests.h b/Frameworks/QueryKit/Tests/QKSelectQueryOrderByTests.h
new file mode 100644
index 00000000..f16ee659
--- /dev/null
+++ b/Frameworks/QueryKit/Tests/QKSelectQueryOrderByTests.h
@@ -0,0 +1,40 @@
+//
+// $Id$
+//
+// QKSelectQueryOrderByTests.h
+// QueryKit
+//
+// Created by Stuart Connolly (stuconnolly.com) on July 18, 2012
+// Copyright (c) 2012 Stuart Connolly. All rights reserved.
+//
+// Permission is hereby granted, free of charge, to any person
+// obtaining a copy of this software and associated documentation
+// files (the "Software"), to deal in the Software without
+// restriction, including without limitation the rights to use,
+// copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the
+// Software is furnished to do so, subject to the following
+// conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
+// OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
+// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+// WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+// OTHER DEALINGS IN THE SOFTWARE.
+
+#import "QKTestCase.h"
+
+#import <QueryKit/QueryKit.h>
+#import <SenTestingKit/SenTestingKit.h>
+
+@interface QKSelectQueryOrderByTests : QKTestCase
+
++ (void)addTestForDatabase:(QKQueryDatabase)database withIdentifierQuote:(NSString *)quote toTestSuite:(SenTestSuite *)testSuite;
+
+@end
diff --git a/Frameworks/QueryKit/Tests/QKSelectQueryOrderByTests.m b/Frameworks/QueryKit/Tests/QKSelectQueryOrderByTests.m
index 2f467bea..ad13ce33 100644
--- a/Frameworks/QueryKit/Tests/QKSelectQueryOrderByTests.m
+++ b/Frameworks/QueryKit/Tests/QKSelectQueryOrderByTests.m
@@ -28,29 +28,51 @@
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
// OTHER DEALINGS IN THE SOFTWARE.
+#import "QKSelectQueryOrderByTests.h"
#import "QKTestConstants.h"
-#import <QueryKit/QueryKit.h>
-#import <SenTestingKit/SenTestingKit.h>
+@implementation QKSelectQueryOrderByTests
+
+#pragma mark -
+#pragma mark Initialisation
-@interface QKSelectQueryOrderByTests : SenTestCase
++ (id)defaultTestSuite
{
- QKQuery *_query;
+ SenTestSuite *testSuite = [[SenTestSuite alloc] initWithName:NSStringFromClass(self)];
+
+ [self addTestForDatabase:QKDatabaseUnknown withIdentifierQuote:EMPTY_STRING toTestSuite:testSuite];
+ [self addTestForDatabase:QKDatabaseMySQL withIdentifierQuote:QKMySQLIdentifierQuote toTestSuite:testSuite];
+ [self addTestForDatabase:QKDatabasePostgreSQL withIdentifierQuote:QKPostgreSQLIdentifierQuote toTestSuite:testSuite];
+
+ return [testSuite autorelease];
}
-@end
-
-@implementation QKSelectQueryOrderByTests
++ (void)addTestForDatabase:(QKQueryDatabase)database withIdentifierQuote:(NSString *)quote toTestSuite:(SenTestSuite *)testSuite
+{
+ for (NSInvocation *invocation in [self testInvocations])
+ {
+ SenTestCase *test = [[QKSelectQueryOrderByTests alloc] initWithInvocation:invocation database:database identifierQuote:quote];
+
+ [testSuite addTest:test];
+
+ [test release];
+ }
+}
#pragma mark -
#pragma mark Setup
- (void)setUp
{
- _query = [QKQuery selectQueryFromTable:QKTestTableName];
+ QKQuery *query = [QKQuery selectQueryFromTable:QKTestTableName];
+
+ [query setQueryDatabase:[self database]];
+ [query setUseQuotedIdentifiers:[self identifierQuote] && [[self identifierQuote] length] > 0];
- [_query addField:QKTestFieldOne];
- [_query addField:QKTestFieldTwo];
+ [query addField:QKTestFieldOne];
+ [query addField:QKTestFieldTwo];
+
+ [self setQuery:query];
}
#pragma mark -
@@ -58,89 +80,45 @@
- (void)testSelectQueryTypeIsCorrect
{
- STAssertTrue([[_query query] hasPrefix:@"SELECT"], @"select query type");
+ STAssertTrue([[[self query] query] hasPrefix:@"SELECT"], nil);
}
- (void)testSelectQueryOrderByAscendingIsCorrect
{
- [_query orderByField:QKTestFieldOne descending:NO];
+ [[self query] orderByField:QKTestFieldOne descending:NO];
- NSString *query = [NSString stringWithFormat:@"ORDER BY `%@` ASC", QKTestFieldOne];
-
- STAssertTrue([[_query query] hasSuffix:query], @"");
-}
-
-- (void)testSelectQueryOrderByAscendingWithoutQuotesIsCorrect
-{
- [_query setUseQuotedIdentifiers:NO];
- [_query orderByField:QKTestFieldOne descending:NO];
-
- NSString *query = [NSString stringWithFormat:@"ORDER BY %@ ASC", QKTestFieldOne];
+ NSString *query = [NSString stringWithFormat:@"ORDER BY %1$@%2$@%1$@ ASC", [self identifierQuote], QKTestFieldOne];
- STAssertTrue([[_query query] hasSuffix:query], @"select query order by without quotes");
+ STAssertTrue([[[self query] query] hasSuffix:query], nil);
}
- (void)testSelectQueryOrderByMultipleFieldsAscendingIsCorrect
{
- [_query orderByField:QKTestFieldOne descending:NO];
- [_query orderByField:QKTestFieldTwo descending:NO];
+ [[self query] orderByField:QKTestFieldOne descending:NO];
+ [[self query] orderByField:QKTestFieldTwo descending:NO];
- NSString *query = [NSString stringWithFormat:@"ORDER BY `%@` ASC, `%@` ASC", QKTestFieldOne, QKTestFieldTwo];
+ NSString *query = [NSString stringWithFormat:@"ORDER BY %1$@%2$@%1$@ ASC, %1$@%3$@%1$@ ASC", [self identifierQuote], QKTestFieldOne, QKTestFieldTwo];
- STAssertTrue([[_query query] hasSuffix:query], @"select query order by multiple fields ascending when quoted");
-}
-
-- (void)testSelectQueryOrderByMultipleFieldsAscendingWithoutQuotesIsCorrect
-{
- [_query setUseQuotedIdentifiers:NO];
-
- [_query orderByField:QKTestFieldOne descending:NO];
- [_query orderByField:QKTestFieldTwo descending:NO];
-
- NSString *query = [NSString stringWithFormat:@"ORDER BY %@ ASC, %@ ASC", QKTestFieldOne, QKTestFieldTwo];
-
- STAssertTrue([[_query query] hasSuffix:query], @"select query order by multiple fields ascending without quotes");
+ STAssertTrue([[[self query] query] hasSuffix:query], nil);
}
- (void)testSelectQueryOrderByDescendingIsCorrect
{
- [_query orderByField:QKTestFieldOne descending:YES];
+ [[self query] orderByField:QKTestFieldOne descending:YES];
- NSString *query = [NSString stringWithFormat:@"ORDER BY `%@` DESC", QKTestFieldOne];
+ NSString *query = [NSString stringWithFormat:@"ORDER BY %1$@%2$@%1$@ DESC", [self identifierQuote], QKTestFieldOne];
- STAssertTrue([[_query query] hasSuffix:query], @"select query order by descending");
-}
-
-- (void)testSelectQueryOrderByDescendingWithoutQuotesIsCorrect
-{
- [_query setUseQuotedIdentifiers:NO];
- [_query orderByField:QKTestFieldOne descending:YES];
-
- NSString *query = [NSString stringWithFormat:@"ORDER BY %@ DESC", QKTestFieldOne];
-
- STAssertTrue([[_query query] hasSuffix:query], @"select query order by descending without quotes");
+ STAssertTrue([[[self query] query] hasSuffix:query], nil);
}
- (void)testSelectQueryOrderByMultipleFieldsDescendingIsCorrect
{
- [_query orderByField:QKTestFieldOne descending:YES];
- [_query orderByField:QKTestFieldTwo descending:YES];
-
- NSString *query = [NSString stringWithFormat:@"ORDER BY `%@` DESC, `%@` DESC", QKTestFieldOne, QKTestFieldTwo];
-
- STAssertTrue([[_query query] hasSuffix:query], @"select query order by multiple fields descending");
-}
-
-- (void)testSelectQueryOrderByMultipleFieldsDescendingWithoutQuotesIsCorrect
-{
- [_query setUseQuotedIdentifiers:NO];
-
- [_query orderByField:QKTestFieldOne descending:YES];
- [_query orderByField:QKTestFieldTwo descending:YES];
+ [[self query] orderByField:QKTestFieldOne descending:YES];
+ [[self query] orderByField:QKTestFieldTwo descending:YES];
- NSString *query = [NSString stringWithFormat:@"ORDER BY %@ DESC, %@ DESC", QKTestFieldOne, QKTestFieldTwo];
+ NSString *query = [NSString stringWithFormat:@"ORDER BY %1$@%2$@%1$@ DESC, %1$@%3$@%1$@ DESC", [self identifierQuote], QKTestFieldOne, QKTestFieldTwo];
- STAssertTrue([[_query query] hasSuffix:query], @"select query order by multiple fields descending without quotes");
+ STAssertTrue([[[self query] query] hasSuffix:query], nil);
}
@end
diff --git a/Frameworks/QueryKit/Tests/QKSelectQueryTests.h b/Frameworks/QueryKit/Tests/QKSelectQueryTests.h
new file mode 100644
index 00000000..22c75352
--- /dev/null
+++ b/Frameworks/QueryKit/Tests/QKSelectQueryTests.h
@@ -0,0 +1,40 @@
+//
+// $Id$
+//
+// QKSelectQueryTests.h
+// QueryKit
+//
+// Created by Stuart Connolly (stuconnolly.com) on July 17, 2012
+// Copyright (c) 2012 Stuart Connolly. All rights reserved.
+//
+// Permission is hereby granted, free of charge, to any person
+// obtaining a copy of this software and associated documentation
+// files (the "Software"), to deal in the Software without
+// restriction, including without limitation the rights to use,
+// copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the
+// Software is furnished to do so, subject to the following
+// conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
+// OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
+// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+// WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+// OTHER DEALINGS IN THE SOFTWARE.
+
+#import "QKTestCase.h"
+
+#import <QueryKit/QueryKit.h>
+#import <SenTestingKit/SenTestingKit.h>
+
+@interface QKSelectQueryTests : QKTestCase
+
++ (void)addTestForDatabase:(QKQueryDatabase)database withIdentifierQuote:(NSString *)quote toTestSuite:(SenTestSuite *)testSuite;
+
+@end
diff --git a/Frameworks/QueryKit/Tests/QKSelectQueryTests.m b/Frameworks/QueryKit/Tests/QKSelectQueryTests.m
index 8e12e13a..3eebb707 100644
--- a/Frameworks/QueryKit/Tests/QKSelectQueryTests.m
+++ b/Frameworks/QueryKit/Tests/QKSelectQueryTests.m
@@ -22,39 +22,61 @@
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
// OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
+// ;. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
// WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
// OTHER DEALINGS IN THE SOFTWARE.
+#import "QKSelectQueryTests.h"
#import "QKTestConstants.h"
-#import <QueryKit/QueryKit.h>
-#import <SenTestingKit/SenTestingKit.h>
+@implementation QKSelectQueryTests
+
+#pragma mark -
+#pragma mark Initialisation
-@interface QKSelectQueryTests : SenTestCase
++ (id)defaultTestSuite
{
- QKQuery *_query;
+ SenTestSuite *testSuite = [[SenTestSuite alloc] initWithName:NSStringFromClass(self)];
+
+ [self addTestForDatabase:QKDatabaseUnknown withIdentifierQuote:EMPTY_STRING toTestSuite:testSuite];
+ [self addTestForDatabase:QKDatabaseMySQL withIdentifierQuote:QKMySQLIdentifierQuote toTestSuite:testSuite];
+ [self addTestForDatabase:QKDatabasePostgreSQL withIdentifierQuote:QKPostgreSQLIdentifierQuote toTestSuite:testSuite];
+
+ return [testSuite autorelease];
}
-@end
-
-@implementation QKSelectQueryTests
++ (void)addTestForDatabase:(QKQueryDatabase)database withIdentifierQuote:(NSString *)quote toTestSuite:(SenTestSuite *)testSuite
+{
+ for (NSInvocation *invocation in [self testInvocations])
+ {
+ SenTestCase *test = [[QKSelectQueryTests alloc] initWithInvocation:invocation database:database identifierQuote:quote];
+
+ [testSuite addTest:test];
+
+ [test release];
+ }
+}
#pragma mark -
#pragma mark Setup
- (void)setUp
{
- _query = [QKQuery selectQueryFromTable:QKTestTableName];
+ QKQuery *query = [QKQuery selectQueryFromTable:QKTestTableName];
+
+ [query setQueryDatabase:[self database]];
+ [query setUseQuotedIdentifiers:[self identifierQuote] && [[self identifierQuote] length] > 0];
- [_query addField:QKTestFieldOne];
- [_query addField:QKTestFieldTwo];
- [_query addField:QKTestFieldThree];
- [_query addField:QKTestFieldFour];
+ [query addField:QKTestFieldOne];
+ [query addField:QKTestFieldTwo];
+ [query addField:QKTestFieldThree];
+ [query addField:QKTestFieldFour];
- [_query addParameter:QKTestFieldOne operator:QKEqualityOperator value:[NSNumber numberWithUnsignedInteger:QKTestParameterOne]];
+ [query addParameter:QKTestFieldOne operator:QKEqualityOperator value:[NSNumber numberWithUnsignedInteger:QKTestParameterOne]];
+
+ [self setQuery:query];
}
#pragma mark -
@@ -62,55 +84,28 @@
- (void)testSelectQueryTypeIsCorrect
{
- STAssertTrue([[_query query] hasPrefix:@"SELECT"], @"select query type");
+ STAssertTrue([[[self query] query] hasPrefix:@"SELECT"], nil);
}
- (void)testSelectQueryFieldIsCorrect
-{
- NSString *query = [NSString stringWithFormat:@"SELECT `%@`", QKTestFieldOne];
-
- STAssertTrue([[_query query] hasPrefix:query], @"select query field");
-}
-
-- (void)testSelectQueryFieldWithoutQuotesIsCorrect
-{
- [_query setUseQuotedIdentifiers:NO];
-
- NSString *query = [NSString stringWithFormat:@"SELECT %@", QKTestFieldOne];
-
- STAssertTrue([[_query query] hasPrefix:query], @"select query field without quotes");
+{
+ NSString *query = [NSString stringWithFormat:@"SELECT %1$@%2$@%1$@", [self identifierQuote], QKTestFieldOne];
+
+ STAssertTrue([[[self query] query] hasPrefix:query], nil);
}
- (void)testSelectQueryMultipleFieldsWhenQuotedAreCorrect
{
- NSString *query = [NSString stringWithFormat:@"SELECT `%@`, `%@`, `%@`, `%@`", QKTestFieldOne, QKTestFieldTwo, QKTestFieldThree, QKTestFieldFour];
-
- STAssertTrue([[_query query] hasPrefix:query], @"select query multiple fields");
-}
-
-- (void)testSelectQueryMultipleFieldsWithoutQuotesAreCorrect
-{
- [_query setUseQuotedIdentifiers:NO];
-
- NSString *query = [NSString stringWithFormat:@"SELECT %@, %@, %@, %@", QKTestFieldOne, QKTestFieldTwo, QKTestFieldThree, QKTestFieldFour];
+ NSString *query = [NSString stringWithFormat:@"SELECT %1$@%2$@%1$@, %1$@%3$@%1$@, %1$@%4$@%1$@, %1$@%5$@%1$@", [self identifierQuote], QKTestFieldOne, QKTestFieldTwo, QKTestFieldThree, QKTestFieldFour];
- STAssertTrue([[_query query] hasPrefix:query], @"select query multiple fields without quotes");
+ STAssertTrue([[[self query] query] hasPrefix:query], nil);
}
- (void)testSelectQueryConstraintsAreCorrect
{
- NSString *query = [NSString stringWithFormat:@"WHERE `%@` %@ %@", QKTestFieldOne, [QKQueryUtilities stringRepresentationOfQueryOperator:QKEqualityOperator], [NSNumber numberWithUnsignedInteger:QKTestParameterOne]];
+ NSString *query = [NSString stringWithFormat:@"WHERE %1$@%2$@%1$@ %3$@ %4$@", [self identifierQuote], QKTestFieldOne, [QKQueryUtilities stringRepresentationOfQueryOperator:QKEqualityOperator], [NSNumber numberWithUnsignedInteger:QKTestParameterOne]];
- STAssertTrue(([[_query query] rangeOfString:query].location != NSNotFound), @"select query constraint");
-}
-
-- (void)testSelectQueryConstraintsWithoutQuotesAreCorrect
-{
- [_query setUseQuotedIdentifiers:NO];
-
- NSString *query = [NSString stringWithFormat:@"WHERE %@ %@ %@", QKTestFieldOne, [QKQueryUtilities stringRepresentationOfQueryOperator:QKEqualityOperator], [NSNumber numberWithUnsignedInteger:QKTestParameterOne]];
-
- STAssertTrue(([[_query query] rangeOfString:query].location != NSNotFound), @"select query constraint without quotes");
+ STAssertTrue(([[[self query] query] rangeOfString:query].location != NSNotFound), nil);
}
@end
diff --git a/Frameworks/QueryKit/Tests/QKTestCase.h b/Frameworks/QueryKit/Tests/QKTestCase.h
new file mode 100644
index 00000000..45f1911a
--- /dev/null
+++ b/Frameworks/QueryKit/Tests/QKTestCase.h
@@ -0,0 +1,52 @@
+//
+// $Id$
+//
+// QKTestCase.h
+// QueryKit
+//
+// Created by Stuart Connolly (stuconnolly.com) on July 18, 2012
+// Copyright (c) 2012 Stuart Connolly. All rights reserved.
+//
+// Permission is hereby granted, free of charge, to any person
+// obtaining a copy of this software and associated documentation
+// files (the "Software"), to deal in the Software without
+// restriction, including without limitation the rights to use,
+// copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the
+// Software is furnished to do so, subject to the following
+// conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
+// OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
+// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+// WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+// OTHER DEALINGS IN THE SOFTWARE.
+
+#import <QueryKit/QueryKit.h>
+#import <SenTestingKit/SenTestingKit.h>
+
+@interface QKTestCase : SenTestCase
+{
+@private
+ QKQuery *_query;
+
+ NSString *_identifierQuote;
+
+ QKQueryDatabase _database;
+}
+
+@property (readwrite, retain) QKQuery *query;
+
+@property (readwrite, retain) NSString *identifierQuote;
+
+@property (readwrite, assign) QKQueryDatabase database;
+
+- (id)initWithInvocation:(NSInvocation *)invocation database:(QKQueryDatabase)database identifierQuote:(NSString *)quote;
+
+@end
diff --git a/Frameworks/QueryKit/Tests/QKTestCase.m b/Frameworks/QueryKit/Tests/QKTestCase.m
new file mode 100644
index 00000000..c129e07a
--- /dev/null
+++ b/Frameworks/QueryKit/Tests/QKTestCase.m
@@ -0,0 +1,55 @@
+//
+// $Id$
+//
+// QKTestCase.m
+// QueryKit
+//
+// Created by Stuart Connolly (stuconnolly.com) on July 18, 2012
+// Copyright (c) 2012 Stuart Connolly. All rights reserved.
+//
+// Permission is hereby granted, free of charge, to any person
+// obtaining a copy of this software and associated documentation
+// files (the "Software"), to deal in the Software without
+// restriction, including without limitation the rights to use,
+// copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the
+// Software is furnished to do so, subject to the following
+// conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
+// OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
+// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+// WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+// OTHER DEALINGS IN THE SOFTWARE.
+
+#import "QKTestCase.h"
+
+@implementation QKTestCase
+
+@synthesize query = _query;
+@synthesize identifierQuote = _identifierQuote;
+@synthesize database = _database;
+
+- (id)initWithInvocation:(NSInvocation *)invocation database:(QKQueryDatabase)database identifierQuote:(NSString *)quote
+{
+ if ((self = [super initWithInvocation:invocation])) {
+ [self setDatabase:database];
+ [self setIdentifierQuote:quote];
+ }
+
+ return self;
+}
+
+- (void)dealloc
+{
+ if (_query) [_query release], _query = nil;
+ if (_identifierQuote) [_identifierQuote release], _identifierQuote = nil;
+}
+
+@end
diff --git a/Frameworks/QueryKit/Tests/QKUpdateQueryTests.h b/Frameworks/QueryKit/Tests/QKUpdateQueryTests.h
new file mode 100644
index 00000000..c4dad17c
--- /dev/null
+++ b/Frameworks/QueryKit/Tests/QKUpdateQueryTests.h
@@ -0,0 +1,40 @@
+//
+// $Id$
+//
+// QKUpdateQueryTests.h
+// QueryKit
+//
+// Created by Stuart Connolly (stuconnolly.com) on July 17, 2012
+// Copyright (c) 2012 Stuart Connolly. All rights reserved.
+//
+// Permission is hereby granted, free of charge, to any person
+// obtaining a copy of this software and associated documentation
+// files (the "Software"), to deal in the Software without
+// restriction, including without limitation the rights to use,
+// copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the
+// Software is furnished to do so, subject to the following
+// conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
+// OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
+// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+// WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+// OTHER DEALINGS IN THE SOFTWARE.
+
+#import "QKTestCase.h"
+
+#import <QueryKit/QueryKit.h>
+#import <SenTestingKit/SenTestingKit.h>
+
+@interface QKUpdateQueryTests : QKTestCase
+
++ (void)addTestForDatabase:(QKQueryDatabase)database withIdentifierQuote:(NSString *)quote toTestSuite:(SenTestSuite *)testSuite;
+
+@end \ No newline at end of file
diff --git a/Frameworks/QueryKit/Tests/QKUpdateQueryTests.m b/Frameworks/QueryKit/Tests/QKUpdateQueryTests.m
index 4c585aee..afeb9434 100644
--- a/Frameworks/QueryKit/Tests/QKUpdateQueryTests.m
+++ b/Frameworks/QueryKit/Tests/QKUpdateQueryTests.m
@@ -28,33 +28,54 @@
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
// OTHER DEALINGS IN THE SOFTWARE.
+#import "QKUpdateQueryTests.h"
#import "QKTestConstants.h"
-#import <QueryKit/QueryKit.h>
-#import <SenTestingKit/SenTestingKit.h>
+@implementation QKUpdateQueryTests
+
+#pragma mark -
+#pragma mark Initialisation
-@interface QKUpdateQueryTests : SenTestCase
++ (id)defaultTestSuite
{
- QKQuery *_query;
+ SenTestSuite *testSuite = [[SenTestSuite alloc] initWithName:NSStringFromClass(self)];
+
+ [self addTestForDatabase:QKDatabaseUnknown withIdentifierQuote:EMPTY_STRING toTestSuite:testSuite];
+ [self addTestForDatabase:QKDatabaseMySQL withIdentifierQuote:QKMySQLIdentifierQuote toTestSuite:testSuite];
+ [self addTestForDatabase:QKDatabasePostgreSQL withIdentifierQuote:QKPostgreSQLIdentifierQuote toTestSuite:testSuite];
+
+ return [testSuite autorelease];
}
-@end
-
-@implementation QKUpdateQueryTests
++ (void)addTestForDatabase:(QKQueryDatabase)database withIdentifierQuote:(NSString *)quote toTestSuite:(SenTestSuite *)testSuite
+{
+ for (NSInvocation *invocation in [self testInvocations])
+ {
+ SenTestCase *test = [[NSClassFromString(@"QKUpdateQueryTests") alloc] initWithInvocation:invocation database:database identifierQuote:quote];
+
+ [testSuite addTest:test];
+
+ [test release];
+ }
+}
#pragma mark -
#pragma mark Setup
- (void)setUp
{
- _query = [QKQuery queryTable:QKTestTableName];
+ QKQuery *query = [QKQuery queryTable:QKTestTableName];
+
+ [query setQueryType:QKUpdateQuery];
+ [query setQueryDatabase:[self database]];
+ [query setUseQuotedIdentifiers:[self identifierQuote] && [[self identifierQuote] length] > 0];
- [_query setQueryType:QKUpdateQuery];
+ [query addFieldToUpdate:QKTestFieldOne toValue:QKTestUpdateValueOne];
+ [query addFieldToUpdate:QKTestFieldTwo toValue:QKTestUpdateValueTwo];
- [_query addFieldToUpdate:QKTestFieldOne toValue:QKTestUpdateValueOne];
- [_query addFieldToUpdate:QKTestFieldTwo toValue:QKTestUpdateValueTwo];
+ [query addParameter:QKTestFieldOne operator:QKEqualityOperator value:[NSNumber numberWithUnsignedInteger:QKTestParameterOne]];
- [_query addParameter:QKTestFieldOne operator:QKEqualityOperator value:[NSNumber numberWithUnsignedInteger:QKTestParameterOne]];
+ [self setQuery:query];
}
#pragma mark -
@@ -62,39 +83,21 @@
- (void)testUpdateQueryTypeIsCorrect
{
- STAssertTrue([[_query query] hasPrefix:@"UPDATE"], @"update query type");
+ STAssertTrue([[[self query] query] hasPrefix:@"UPDATE"], nil);
}
- (void)testUpdateQueryFieldsAreCorrect
{
- NSString *query = [NSString stringWithFormat:@"UPDATE `%@` SET `%@` = '%@', `%@` = '%@'", QKTestTableName, QKTestFieldOne, QKTestUpdateValueOne, QKTestFieldTwo, QKTestUpdateValueTwo];
+ NSString *query = [NSString stringWithFormat:@"UPDATE %1$@%2$@%1$@ SET %1$@%3$@%1$@ = '%4$@', %1$@%5$@%1$@ = '%6$@'", [self identifierQuote], QKTestTableName, QKTestFieldOne, QKTestUpdateValueOne, QKTestFieldTwo, QKTestUpdateValueTwo];
- STAssertTrue([[_query query] hasPrefix:query], @"update query fields");
-}
-
-- (void)testUpdateQueryFieldsWithoutQuotesAreCorrect
-{
- [_query setUseQuotedIdentifiers:NO];
-
- NSString *query = [NSString stringWithFormat:@"UPDATE %@ SET %@ = '%@', %@ = '%@'", QKTestTableName, QKTestFieldOne, QKTestUpdateValueOne, QKTestFieldTwo, QKTestUpdateValueTwo];
-
- STAssertTrue([[_query query] hasPrefix:query], @"update query fields without quotes");
+ STAssertTrue([[[self query] query] hasPrefix:query], nil);
}
- (void)testUpdateQueryConstraintIsCorrect
{
- NSString *query = [NSString stringWithFormat:@"WHERE `%@` %@ %@", QKTestFieldOne, [QKQueryUtilities stringRepresentationOfQueryOperator:QKEqualityOperator], [NSNumber numberWithUnsignedInteger:QKTestParameterOne]];
-
- STAssertTrue(([[_query query] rangeOfString:query].location != NSNotFound), @"update query constraint");
-}
-
-- (void)testUpdateQueryConstraintWithoutQuotesIsCorrect
-{
- [_query setUseQuotedIdentifiers:NO];
-
- NSString *query = [NSString stringWithFormat:@"WHERE %@ %@ %@", QKTestFieldOne, [QKQueryUtilities stringRepresentationOfQueryOperator:QKEqualityOperator], [NSNumber numberWithUnsignedInteger:QKTestParameterOne]];
-
- STAssertTrue(([[_query query] rangeOfString:query].location != NSNotFound), @"update query constraint without quotes");
+ NSString *query = [NSString stringWithFormat:@"WHERE %1$@%2$@%1$@ %3$@ %4$@", [self identifierQuote], QKTestFieldOne, [QKQueryUtilities stringRepresentationOfQueryOperator:QKEqualityOperator], [NSNumber numberWithUnsignedInteger:QKTestParameterOne]];
+
+ STAssertTrue(([[[self query] query] rangeOfString:query].location != NSNotFound), nil);
}
@end
1946 1947 1948 1949 1950 1951 1952 1953 1954 1955 1956 1957 1958 1959 1960 1961 1962 1963 1964 1965 1966 1967 1968 1969 1970 1971 1972 1973 1974 1975 1976 1977 1978 1979 1980 1981 1982 1983 1984 1985 1986 1987 1988 1989 1990 1991 1992 1993 1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 2005 2006 2007 2008 2009 2010 2011 2012 2013 2014 2015 2016 2017 2018 2019 2020 2021 2022 2023 2024 2025 2026 2027 2028 2029 2030 2031 2032 2033 2034 2035 2036 2037 2038 2039 2040 2041 2042 2043 2044 2045 2046 2047 2048 2049 2050 2051 2052 2053 2054 2055 2056 2057 2058 2059 2060 2061 2062 2063 2064 2065 2066 2067 2068 2069 2070 2071 2072 2073 2074 2075 2076 2077 2078 2079 2080 2081 2082 2083 2084 2085 2086 2087 2088 2089 2090 2091 2092 2093 2094 2095 2096 2097 2098 2099 2100 2101 2102 2103 2104 2105 2106 2107 2108 2109 2110 2111 2112 2113 2114 2115 2116 2117 2118 2119 2120 2121 2122 2123 2124 2125 2126 2127 2128 2129 2130 2131 2132 2133 2134 2135 2136 2137 2138 2139 2140 2141 2142 2143 2144 2145 2146 2147 2148 2149 2150 2151 2152 2153 2154 2155 2156 2157 2158 2159 2160 2161 2162 2163 2164 2165 2166 2167 2168 2169 2170 2171 2172 2173 2174 2175 2176 2177 2178 2179 2180 2181 2182 2183 2184 2185 2186 2187 2188 2189 2190 2191 2192 2193 2194 2195 2196 2197 2198 2199 2200 2201 2202 2203 2204 2205 2206 2207 2208 2209 2210 2211 2212 2213 2214 2215 2216 2217 2218 2219 2220 2221 2222 2223 2224 2225 2226 2227 2228 2229 2230 2231 2232 2233 2234 2235 2236 2237 2238 2239 2240 2241 2242 2243 2244 2245 2246 2247 2248 2249 2250 2251 2252 2253 2254 2255 2256 2257 2258 2259