|
1 | 1 | import XCTest |
2 | | -@testable import Redis |
3 | 2 | import NIO |
| 3 | +@testable import Redis |
4 | 4 |
|
5 | 5 | final class RedisClientTests: XCTestCase { |
6 | | - func testCreateClientWithDefaultArguments() throws { |
7 | | - let redisClient = Redis.createClient() |
| 6 | + |
| 7 | + func testCreateClientWithDefaultArguments() throws { |
| 8 | + let redisClient = Redis.createClient() |
8 | 9 |
|
9 | | - XCTAssert(redisClient.options.hostname! == "127.0.0.1") |
10 | | - XCTAssert(redisClient.options.port == 6379) |
11 | | - XCTAssert(redisClient.options.password == nil) |
12 | | - XCTAssert(redisClient.options.database == nil) |
13 | | - } |
| 10 | + XCTAssert(redisClient.options.hostname! == "127.0.0.1") |
| 11 | + XCTAssert(redisClient.options.port == 6379) |
| 12 | + XCTAssert(redisClient.options.password == nil) |
| 13 | + XCTAssert(redisClient.options.database == nil) |
| 14 | + } |
14 | 15 |
|
15 | | - func testCreateClientWithSpecifiedArguments() throws { |
16 | | - let eventLoop = MultiThreadedEventLoopGroup(numberOfThreads: 1).next() |
| 16 | + func testCreateClientWithSpecifiedArguments() throws { |
| 17 | + let eventLoop = MultiThreadedEventLoopGroup(numberOfThreads: 1).next() |
17 | 18 |
|
18 | | - let redisClient = Redis.createClient(port: 6380, host: "localhost", password: "password", db: 1, eventLoopGroup: eventLoop) |
| 19 | + let redisClient = Redis.createClient(port: 6380, host: "localhost", |
| 20 | + password: "password", db: 1, |
| 21 | + eventLoopGroup: eventLoop) |
19 | 22 |
|
20 | | - XCTAssert(redisClient.options.hostname! == "localhost") |
21 | | - XCTAssert(redisClient.options.port == 6380) |
22 | | - XCTAssert(redisClient.options.password == "password") |
23 | | - XCTAssert(redisClient.options.database == 1) |
24 | | - XCTAssert(redisClient.options.eventLoopGroup === eventLoop) |
25 | | - XCTAssert(redisClient.eventLoop === eventLoop) |
26 | | - } |
| 23 | + XCTAssert(redisClient.options.hostname! == "localhost") |
| 24 | + XCTAssert(redisClient.options.port == 6380) |
| 25 | + XCTAssert(redisClient.options.password == "password") |
| 26 | + XCTAssert(redisClient.options.database == 1) |
| 27 | + XCTAssert(redisClient.options.eventLoopGroup === eventLoop) |
| 28 | + XCTAssert(redisClient.eventLoop === eventLoop) |
| 29 | + } |
27 | 30 |
|
28 | | - static var allTests = [ |
29 | | - ("testCreateClientWithDefaultArguments", testCreateClientWithDefaultArguments), |
30 | | - ("testCreateClientWithSpecifiedArguments", testCreateClientWithSpecifiedArguments), |
31 | | - ] |
| 31 | + static var allTests = [ |
| 32 | + ( "testCreateClientWithDefaultArguments", |
| 33 | + testCreateClientWithDefaultArguments. ), |
| 34 | + ( "testCreateClientWithSpecifiedArguments", |
| 35 | + testCreateClientWithSpecifiedArguments ), |
| 36 | + ] |
32 | 37 | } |
0 commit comments