From 0e3f2c66fdd6e7c466d453ecafd46b24db14b49d Mon Sep 17 00:00:00 2001 From: Lukas Schmidt Date: Thu, 18 Jan 2018 09:29:14 +0100 Subject: [PATCH 1/4] correct documentation deployment --- .travis.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index 131fe03..0e34b06 100644 --- a/.travis.yml +++ b/.travis.yml @@ -34,8 +34,8 @@ matrix: - bash <(curl -s https://codecov.io/bash) deploy: provider: pages - local_dir: ${TRAVIS_BUILD_DIR}/docs + local_dir: docs skip_cleanup: true github_token: $GITHUB_TOKEN on: - branch: master \ No newline at end of file + branch: master From 483459ca18a592091a133090ad11a910491ec07e Mon Sep 17 00:00:00 2001 From: ArturFriesen Date: Fri, 9 Feb 2018 15:36:19 +0100 Subject: [PATCH 2/4] Added public protection level to initializer of NetworkError. This way, NetworkError can be used in Unit-Tests without building the framework with debug configutation. (#74) --- Source/NetworkError.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/NetworkError.swift b/Source/NetworkError.swift index 0ba4f09..860ac1f 100644 --- a/Source/NetworkError.swift +++ b/Source/NetworkError.swift @@ -40,7 +40,7 @@ public enum NetworkError: Error { /// Complete request failed. case requestError(error: Error) - init?(response: HTTPURLResponse?, data: Data?) { + public init?(response: HTTPURLResponse?, data: Data?) { guard let response = response else { return nil } From b8d8d2282110518540385e59c47c739e90577238 Mon Sep 17 00:00:00 2001 From: Lukas Schmidt Date: Mon, 12 Feb 2018 13:33:21 +0100 Subject: [PATCH 3/4] Revert "Added public protection level to initializer of NetworkError. This way, NetworkError can be used in Unit-Tests without building the framework with debug configutation. (#74)" This reverts commit 483459ca18a592091a133090ad11a910491ec07e. --- Source/NetworkError.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/NetworkError.swift b/Source/NetworkError.swift index 860ac1f..0ba4f09 100644 --- a/Source/NetworkError.swift +++ b/Source/NetworkError.swift @@ -40,7 +40,7 @@ public enum NetworkError: Error { /// Complete request failed. case requestError(error: Error) - public init?(response: HTTPURLResponse?, data: Data?) { + init?(response: HTTPURLResponse?, data: Data?) { guard let response = response else { return nil } From 1e353886049a7f4b1172a254812e6c99b46511cd Mon Sep 17 00:00:00 2001 From: Lukas Schmidt Date: Wed, 6 Jun 2018 15:41:27 +0200 Subject: [PATCH 4/4] Final Release Merge for 1.1 (#82) * Fixes small linter warning * updates to recommended build settings * upgrade swift version * Update NetworkServiceMock.swift NetworkServiceMock now supports request response chains, where one response leads to an other request. * Fixes tests of RetryNetworkService using the NetworkServiceMock * Made new implementation of returnError/returnSuccess not depend on old implemention * improves tests for RetryNetworkTask * Update README.md * small clean ups * Added unit tests for NetworkServiceMock * Resolved linter warnings * Updated documentation of NetworkServiceMock * Fixed an other linter warning * bump version * Removes unneeded file --- .swift-version | 2 +- .travis.yml | 3 +- DBNetworkStack.podspec | 2 +- DBNetworkStack.xcodeproj/project.pbxproj | 6 +- .../xcschemes/DBNetworkStack.xcscheme | 6 +- README.md | 4 +- Source/Info.plist | 2 +- Source/NetworkServiceMock.swift | 116 ++++++++--- Source/Resource+Map.swift | 2 +- Source/RetryNetworkTask.swift | 3 +- .../NetworkResponseProcessorTest.swift | 7 +- .../NetworkServiceMockTest.swift | 185 ++++++++++++++++++ .../NetworkServiceTest.swift | 2 +- .../RetryNetworkserviceTest.swift | 31 +-- Tests/DBNetworkStackTests/RetryTaskTest.swift | 24 +++ 15 files changed, 341 insertions(+), 54 deletions(-) diff --git a/.swift-version b/.swift-version index 389f774..8a36cd1 100644 --- a/.swift-version +++ b/.swift-version @@ -1 +1 @@ -4.0 \ No newline at end of file +4.1 \ No newline at end of file diff --git a/.travis.yml b/.travis.yml index 0e34b06..1f8d19d 100644 --- a/.travis.yml +++ b/.travis.yml @@ -17,8 +17,7 @@ matrix: script: - swift test --verbose - os: osx - osx_image: xcode9.2 - language: objective-c + osx_image: xcode9.3 env: "macOS" skip-cleanup: true before_install: diff --git a/DBNetworkStack.podspec b/DBNetworkStack.podspec index c599db4..d2c519c 100644 --- a/DBNetworkStack.podspec +++ b/DBNetworkStack.podspec @@ -16,7 +16,7 @@ Pod::Spec.new do |s| # s.name = "DBNetworkStack" - s.version = "1.0.0" + s.version = "1.1.0" s.summary = "DBNetworkStack is a network abstraction for fetching request and mapping them to model objects." # This description is used to generate tags and improve search results. diff --git a/DBNetworkStack.xcodeproj/project.pbxproj b/DBNetworkStack.xcodeproj/project.pbxproj index 1b9c633..1a1c4d2 100644 --- a/DBNetworkStack.xcodeproj/project.pbxproj +++ b/DBNetworkStack.xcodeproj/project.pbxproj @@ -325,7 +325,7 @@ isa = PBXProject; attributes = { LastSwiftUpdateCheck = 0730; - LastUpgradeCheck = 0900; + LastUpgradeCheck = 0930; ORGANIZATIONNAME = DBSystel; TargetAttributes = { C60BE65A1D6B2BF3006B0364 = { @@ -466,12 +466,14 @@ CLANG_WARN_BOOL_CONVERSION = YES; CLANG_WARN_COMMA = YES; CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; CLANG_WARN_EMPTY_BODY = YES; CLANG_WARN_ENUM_CONVERSION = YES; CLANG_WARN_INFINITE_RECURSION = YES; CLANG_WARN_INT_CONVERSION = YES; CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; @@ -527,12 +529,14 @@ CLANG_WARN_BOOL_CONVERSION = YES; CLANG_WARN_COMMA = YES; CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; CLANG_WARN_EMPTY_BODY = YES; CLANG_WARN_ENUM_CONVERSION = YES; CLANG_WARN_INFINITE_RECURSION = YES; CLANG_WARN_INT_CONVERSION = YES; CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; diff --git a/DBNetworkStack.xcodeproj/xcshareddata/xcschemes/DBNetworkStack.xcscheme b/DBNetworkStack.xcodeproj/xcshareddata/xcschemes/DBNetworkStack.xcscheme index 0eab9b1..ea2f0b6 100644 --- a/DBNetworkStack.xcodeproj/xcshareddata/xcschemes/DBNetworkStack.xcscheme +++ b/DBNetworkStack.xcodeproj/xcshareddata/xcschemes/DBNetworkStack.xcscheme @@ -1,6 +1,6 @@ + codeCoverageEnabled = "YES" + shouldUseLaunchSchemeArgsEnv = "YES"> diff --git a/README.md b/README.md index 3017e57..7f30c5c 100644 --- a/README.md +++ b/README.md @@ -36,7 +36,7 @@ Create a resource with a request to fetch your data. ```swift let url = URL(string: "https://httpbin.org")! -let request = URLRequest(path: "/", baseURL: url) +let request = URLRequest(path: "/", baseURL: url, HTTPMethod: .GET) let resource = Resource(request: request, parse: { String(data: $0, encoding: .utf8) }) ``` @@ -112,7 +112,7 @@ The following table shows all the protocols and their default implementations. Specify the following in your `Cartfile`: ```ogdl -github "dbsystel/dbnetworkstack" ~> 1.0 +github "dbsystel/dbnetworkstack" ~> 1.1 ``` ### CocoaPods diff --git a/Source/Info.plist b/Source/Info.plist index 60b9c00..09bc972 100644 --- a/Source/Info.plist +++ b/Source/Info.plist @@ -15,7 +15,7 @@ CFBundlePackageType FMWK CFBundleShortVersionString - 1.0.0 + 1.1.0 CFBundleSignature ???? CFBundleVersion diff --git a/Source/NetworkServiceMock.swift b/Source/NetworkServiceMock.swift index e533616..9e39d75 100644 --- a/Source/NetworkServiceMock.swift +++ b/Source/NetworkServiceMock.swift @@ -49,7 +49,8 @@ struct NetworkServiceMockCallback { } /** - Mocks a `NetworkService`. You can configure expected results or errors to have a fully functional mock. + Mocks a `NetworkService`. + You can configure expected results or errors to have a fully functional mock. **Example**: ```swift @@ -58,12 +59,46 @@ struct NetworkServiceMockCallback { let resource: Resource = // //When - // Your test code + networkService.request( + resource, + onCompletion: { string in /*...*/ }, + onError: { error in /*...*/ } + ) networkService.returnSuccess(with: "Sucess") //Then //Test your expectations + ``` + + It is possible to start multiple requests at a time. + All requests and responses (or errors) are processed + in order they have been called. So, everything is serial. + + **Example**: + ```swift + //Given + let networkServiceMock = NetworkServiceMock() + let resource: Resource = // + + //When + networkService.request( + resource, + onCompletion: { string in /* Success */ }, + onError: { error in /*...*/ } + ) + networkService.request( + resource, + onCompletion: { string in /*...*/ }, + onError: { error in /*. cancel error .*/ } + ) + + networkService.returnSuccess(with: "Sucess") + networkService.returnError(with: .cancelled) + + //Then + //Test your expectations + ``` - seealso: `NetworkService` @@ -76,11 +111,11 @@ public final class NetworkServiceMock: NetworkService { /// Set this to hava a custom networktask returned by the mock public var nextNetworkTask: NetworkTask? - private var callbacks: NetworkServiceMockCallback? + private var callbacks: [NetworkServiceMockCallback] = [] /// Creates an instace of `NetworkServiceMock` public init() {} - + /** Fetches a resource asynchronously from remote location. Execution of the requests starts immediately. Execution happens on no specific queue. It dependes on the network access which queue is used. @@ -93,9 +128,9 @@ public final class NetworkServiceMock: NetworkService { let resource: Resource = // networkService.request(queue: .main, resource: resource, onCompletionWithResponse: { htmlText, response in - print(htmlText, response) + print(htmlText, response) }, onError: { error in - // Handle errors + // Handle errors }) ``` @@ -108,11 +143,15 @@ public final class NetworkServiceMock: NetworkService { */ @discardableResult public func request(queue: DispatchQueue, resource: Resource, onCompletionWithResponse: @escaping (Result, HTTPURLResponse) -> Void, - onError: @escaping (NetworkError) -> Void) -> NetworkTask { - + onError: @escaping (NetworkError) -> Void) -> NetworkTask { + lastRequest = resource.request requestCount += 1 - callbacks = NetworkServiceMockCallback(resource: resource, onCompletionWithResponse: onCompletionWithResponse, onError: onError) + callbacks.append(NetworkServiceMockCallback( + resource: resource, + onCompletionWithResponse: onCompletionWithResponse, + onError: onError + )) return nextNetworkTask ?? NetworkTaskMock() } @@ -121,12 +160,30 @@ public final class NetworkServiceMock: NetworkService { /// /// - Parameters: /// - error: the error which gets passed to the caller - /// - count: the count, how often the error accours. 1 by default - public func returnError(with error: NetworkError, count: Int = 1) { - for _ in 0..(with serializedResponse: T, httpResponse: HTTPURLResponse = HTTPURLResponse(), count: Int = 1) { - for _ in 0..(with serializedResponse: T, httpResponse: HTTPURLResponse = HTTPURLResponse()) { + callbacks.removeFirst().onTypedSuccess?(serializedResponse, httpResponse) + } + + /// Will return a successful request, by using the given type `T` as serialized result of a request. + /// + /// **Warning:** This will crash if type `T` does not match your expected ResponseType of your current request + /// + /// - Parameters: + /// - data: the mock response from the server. `Data()` by default + /// - httpResponse: the mock `HTTPURLResponse` from the server. `HTTPURLResponse()` by default + /// - count: the count how often the response gets triggerd. + @available(*, deprecated, message: "Use returnSuccess without count parameter instead. Multiple calls can be done manually.") + public func returnSuccess(with serializedResponse: T, httpResponse: HTTPURLResponse = HTTPURLResponse(), count: Int) { + (0..(transform: @escaping (Model) throws -> (T)) -> Resource { + public func map(transform: @escaping (Model) throws -> T) -> Resource { return Resource(request: request, parse: { data in return try transform(try self.parse(data)) }) diff --git a/Source/RetryNetworkTask.swift b/Source/RetryNetworkTask.swift index 4d6551e..892d25c 100644 --- a/Source/RetryNetworkTask.swift +++ b/Source/RetryNetworkTask.swift @@ -25,7 +25,8 @@ import Foundation import Dispatch /// A NetworkTaskRepresenting which can be used together with `RetryNetworkService` to keep a task alife to repeat the task after a given time -class RetryNetworkTask : NetworkTask { +final class RetryNetworkTask: NetworkTask { + private let maxmimumNumberOfRetries: Int private let idleTimeInterval: TimeInterval private let shouldRetry: (NetworkError) -> Bool diff --git a/Tests/DBNetworkStackTests/NetworkResponseProcessorTest.swift b/Tests/DBNetworkStackTests/NetworkResponseProcessorTest.swift index d1946a8..4401f3c 100644 --- a/Tests/DBNetworkStackTests/NetworkResponseProcessorTest.swift +++ b/Tests/DBNetworkStackTests/NetworkResponseProcessorTest.swift @@ -51,7 +51,7 @@ class NetworkResponseProcessingTests: XCTestCase { XCTFail("Expected cancelled error (got \(error)") } } catch let error { - XCTFail("Expected NetworkError (got \(type(of:error)))") + XCTFail("Expected NetworkError (got \(type(of: error)))") } XCTAssertNil(result, "Expected processing to fail") @@ -80,12 +80,11 @@ class NetworkResponseProcessingTests: XCTestCase { } XCTAssertEqual(recievedData, data) - break default: XCTFail("Expected cancelled error (got \(error)") } } catch let error { - XCTFail("Expected NetworkError (got \(type(of:error)))") + XCTFail("Expected NetworkError (got \(type(of: error)))") } } @@ -105,7 +104,7 @@ class NetworkResponseProcessingTests: XCTestCase { XCTFail("Expected cancelled error (got \(error)") } } catch let error { - XCTFail("Expected NetworkError (got \(type(of:error)))") + XCTFail("Expected NetworkError (got \(type(of: error)))") } } diff --git a/Tests/DBNetworkStackTests/NetworkServiceMockTest.swift b/Tests/DBNetworkStackTests/NetworkServiceMockTest.swift index 26c4650..fdc53bf 100644 --- a/Tests/DBNetworkStackTests/NetworkServiceMockTest.swift +++ b/Tests/DBNetworkStackTests/NetworkServiceMockTest.swift @@ -59,6 +59,69 @@ class NetworkServiceMockTest: XCTestCase { XCTAssertEqual(capturedResult, 1) XCTAssertEqual(executionCount, 1) } + + func testCorrectOrderOfReturnSuccessWithDataForMultipleRequests() { + //Given + var called1First = false + var called2First = false + + //When + networkServiceMock.request(resource, onCompletion: { _ in + if !called2First { + called1First = true + } + }, onError: { _ in }) + networkServiceMock.request(resource, onCompletion: { _ in + if !called1First { + called2First = true + } + }, onError: { _ in }) + networkServiceMock.returnSuccess() + networkServiceMock.returnSuccess() + + //Then + XCTAssertTrue(called1First) + XCTAssertFalse(called2First) + } + + func testRequestSuccessWithDataChaining() { + //Given + var executionCount1: Int = 0 + var executionCount2: Int = 0 + + //When + networkServiceMock.request(resource, onCompletion: { _ in + executionCount1 += 1 + self.networkServiceMock.request(self.resource, onCompletion: { _ in + executionCount2 += 1 + }, onError: { _ in }) + }, onError: { _ in }) + networkServiceMock.returnSuccess() + networkServiceMock.returnSuccess() + + //Then + XCTAssertEqual(executionCount1, 1) + XCTAssertEqual(executionCount2, 1) + } + + func testReturnSuccessWithDataForAllRequests() { + //Given + var executionCount1: Int = 0 + var executionCount2: Int = 0 + + //When + networkServiceMock.request(resource, onCompletion: { _ in + executionCount1 += 1 + }, onError: { _ in }) + networkServiceMock.request(resource, onCompletion: { _ in + executionCount2 += 1 + }, onError: { _ in }) + networkServiceMock.returnSuccess(count: 2) + + //Then + XCTAssertEqual(executionCount1, 1) + XCTAssertEqual(executionCount2, 1) + } func testReturnSuccessWithSerializedData() { //Given @@ -77,6 +140,65 @@ class NetworkServiceMockTest: XCTestCase { XCTAssertEqual(executionCount, 1) } + func testCorrectOrderOfReturnSuccessWithSerializedDataForMultipleRequests() { + //Given + var capturedResult1: Int? + var capturedResult2: Int? + + //When + networkServiceMock.request(resource, onCompletion: { result in + capturedResult1 = result + }, onError: { _ in }) + networkServiceMock.request(resource, onCompletion: { result in + capturedResult2 = result + }, onError: { _ in }) + networkServiceMock.returnSuccess(with: 10) + networkServiceMock.returnSuccess(with: 20) + + //Then + XCTAssertEqual(capturedResult1, 10) + XCTAssertEqual(capturedResult2, 20) + } + + func testRequestSuccessWithSerializedDataChaining() { + //Given + var executionCount1: Int = 0 + var executionCount2: Int = 0 + + //When + networkServiceMock.request(resource, onCompletion: { _ in + executionCount1 += 1 + self.networkServiceMock.request(self.resource, onCompletion: { _ in + executionCount2 += 1 + }, onError: { _ in }) + }, onError: { _ in }) + networkServiceMock.returnSuccess(with: 10) + networkServiceMock.returnSuccess(with: 20) + + //Then + XCTAssertEqual(executionCount1, 1) + XCTAssertEqual(executionCount2, 1) + } + + func testReturnSuccessWithSerializedDataForAllRequests() { + //Given + var executionCount1: Int = 0 + var executionCount2: Int = 0 + + //When + networkServiceMock.request(resource, onCompletion: { _ in + executionCount1 += 1 + }, onError: { _ in }) + networkServiceMock.request(resource, onCompletion: { _ in + executionCount2 += 1 + }, onError: { _ in }) + networkServiceMock.returnSuccess(with: 10, count: 2) + + //Then + XCTAssertEqual(executionCount1, 1) + XCTAssertEqual(executionCount2, 1) + } + func testReturnError() { //Given var capturedError: NetworkError? @@ -98,4 +220,67 @@ class NetworkServiceMockTest: XCTestCase { XCTAssertEqual(executionCount, 1) } + func testCorrectOrderOfReturnErrorForMultipleRequests() { + //Given + var capturedError1: NetworkError? + var capturedError2: NetworkError? + + //When + networkServiceMock.request(resource, onCompletion: { _ in }, onError: { error in + capturedError1 = error + }) + networkServiceMock.request(resource, onCompletion: { _ in }, onError: { error in + capturedError2 = error + }) + networkServiceMock.returnError(with: .unknownError) + networkServiceMock.returnError(with: .cancelled) + + //Then + if case .unknownError? = capturedError1, case .cancelled? = capturedError2 { + + } else { + XCTFail("Wrong order of error responses") + } + } + + func testRequestErrorChaining() { + //Given + var executionCount1: Int = 0 + var executionCount2: Int = 0 + + //When + networkServiceMock.request(resource, onCompletion: { _ in }, onError: { _ in + executionCount1 += 1 + self.networkServiceMock.request(self.resource, onCompletion: { _ in }, onError: { _ in + executionCount2 += 1 + }) + }) + + networkServiceMock.returnError(with: .unknownError) + networkServiceMock.returnError(with: .unknownError) + + //Then + XCTAssertEqual(executionCount1, 1) + XCTAssertEqual(executionCount2, 1) + } + + func testReturnErrorsForAllRequests() { + //Given + var executionCount1: Int = 0 + var executionCount2: Int = 0 + + //When + networkServiceMock.request(resource, onCompletion: { _ in }, onError: { _ in + executionCount1 += 1 + }) + networkServiceMock.request(resource, onCompletion: { _ in }, onError: { _ in + executionCount2 += 1 + }) + networkServiceMock.returnError(with: .unknownError, count: 2) + + //Then + XCTAssertEqual(executionCount1, 1) + XCTAssertEqual(executionCount2, 1) + } + } diff --git a/Tests/DBNetworkStackTests/NetworkServiceTest.swift b/Tests/DBNetworkStackTests/NetworkServiceTest.swift index d17141a..e81c6b1 100644 --- a/Tests/DBNetworkStackTests/NetworkServiceTest.swift +++ b/Tests/DBNetworkStackTests/NetworkServiceTest.swift @@ -35,7 +35,7 @@ class NetworkServiceTest: XCTestCase { let baseURL: URL! = URL(string: "//bahn.de") var resource: Resource { - let request = URLRequest(path:"train", baseURL: baseURL) + let request = URLRequest(path: "train", baseURL: baseURL) return Resource(request: request, decoder: JSONDecoder()) } diff --git a/Tests/DBNetworkStackTests/RetryNetworkserviceTest.swift b/Tests/DBNetworkStackTests/RetryNetworkserviceTest.swift index 24e6f32..4a13574 100644 --- a/Tests/DBNetworkStackTests/RetryNetworkserviceTest.swift +++ b/Tests/DBNetworkStackTests/RetryNetworkserviceTest.swift @@ -48,20 +48,24 @@ class RetryNetworkserviceTest: XCTestCase { let numberOfRetries = 2 var executedRetrys = 0 + let retryService = RetryNetworkService(networkService: networkServiceMock, numberOfRetries: numberOfRetries, + idleTimeInterval: 0, shouldRetry: { _ in return true }, dispatchRetry: { _, block in + executedRetrys += 1 + block() + }) + //When - weak var task: NetworkTask? - task = RetryNetworkService(networkService: networkServiceMock, numberOfRetries: numberOfRetries, - idleTimeInterval: 0, shouldRetry: { _ in return true}, dispatchRetry: { _, block in - executedRetrys += 1 - block() - }).request(resource, onCompletionWithResponse: { _, _ in + weak var task = retryService.request(resource, onCompletion: { _ in + XCTAssertEqual(executedRetrys, numberOfRetries) }, onError: { _ in XCTFail("Expects to not call error block") }) - networkServiceMock.returnError(with: .unknownError, count: errorCount) + (0.. = RetryNetworkTask(maxmimumNumberOfRetries: 3, idleTimeInterval: 0.3, + shouldRetry: { _ in return true }, onSuccess: { _, _ in + + }, onError: { _ in + + }, retryAction: { _, _ in + retryCount += 1 + return NetworkTaskMock() + }, dispatchRetry: { _, block in + block() + }) + + let onError = task.createOnError() + + onError(.unknownError) + onError(.unknownError) + onError(.unknownError) + onError(.unknownError) + + XCTAssertEqual(retryCount, 3) + } + func testResume() { //Given let taskMock = NetworkTaskMock()