Browse Source

Fixes from merging.

Jon Shier 7 years ago
parent
commit
6505d09025
2 changed files with 6 additions and 12 deletions
  1. 0 6
      Tests/SessionDelegateTests.swift
  2. 6 6
      Tests/SessionManagerTests.swift

+ 0 - 6
Tests/SessionDelegateTests.swift

@@ -511,12 +511,6 @@ class SessionDelegateTestCase: BaseTestCase {
         // Given
         var notificationCalledWithResponseData = false
         var response: HTTPURLResponse?
-        #if swift(>=4.1)
-        let notification = Notification.Name.Task.DidComplete
-        #else
-        let notification = Notification.Name.Task.DidComplete.rawValue
-        #endif
-        let expectation = self.expectation(forNotification: notification, object: nil) { notif -> Bool in
 
         let expectation = self.expectation(forNotification: Notification.Name.Task.DidComplete, object: nil) { notif -> Bool in
 

+ 6 - 6
Tests/SessionManagerTests.swift

@@ -646,7 +646,7 @@ class SessionManagerTestCase: BaseTestCase {
         XCTAssertEqual(handler.retryCount, 2)
         XCTAssertEqual(request.retryCount, 1)
         XCTAssertEqual(response?.result.isSuccess, false)
-        XCTAssertTrue(sessionManager.delegate.requests.isEmpty)
+        XCTAssertTrue(sessionManager.delegate.protectedRequests.directValue.isEmpty)
     }
 
     func testThatSessionManagerCallsRequestRetrierWhenRequestInitiallyEncountersAdaptError() {
@@ -677,7 +677,7 @@ class SessionManagerTestCase: BaseTestCase {
         XCTAssertEqual(handler.adaptedCount, 2)
         XCTAssertEqual(handler.retryCount, 1)
         XCTAssertEqual(response?.result.isSuccess, true)
-        XCTAssertTrue(sessionManager.delegate.requests.isEmpty)
+        XCTAssertTrue(sessionManager.delegate.protectedRequests.directValue.isEmpty)
 
         handler.retryErrors.forEach { XCTAssertFalse($0 is AdaptError) }
     }
@@ -715,7 +715,7 @@ class SessionManagerTestCase: BaseTestCase {
         XCTAssertEqual(handler.adaptedCount, 2)
         XCTAssertEqual(handler.retryCount, 1)
         XCTAssertEqual(response?.result.isSuccess, true)
-        XCTAssertTrue(sessionManager.delegate.requests.isEmpty)
+        XCTAssertTrue(sessionManager.delegate.protectedRequests.directValue.isEmpty)
 
         handler.retryErrors.forEach { XCTAssertFalse($0 is AdaptError) }
     }
@@ -747,7 +747,7 @@ class SessionManagerTestCase: BaseTestCase {
         XCTAssertEqual(handler.adaptedCount, 2)
         XCTAssertEqual(handler.retryCount, 1)
         XCTAssertEqual(response?.result.isSuccess, true)
-        XCTAssertTrue(sessionManager.delegate.requests.isEmpty)
+        XCTAssertTrue(sessionManager.delegate.protectedRequests.directValue.isEmpty)
 
         handler.retryErrors.forEach { XCTAssertFalse($0 is AdaptError) }
     }
@@ -779,7 +779,7 @@ class SessionManagerTestCase: BaseTestCase {
         XCTAssertEqual(handler.retryCount, 1)
         XCTAssertEqual(request.retryCount, 1)
         XCTAssertEqual(response?.result.isSuccess, true)
-        XCTAssertTrue(sessionManager.delegate.requests.isEmpty)
+        XCTAssertTrue(sessionManager.delegate.protectedRequests.directValue.isEmpty)
     }
 
     func testThatRequestAdapterErrorThrowsResponseHandlerErrorWhenRequestIsRetried() {
@@ -809,7 +809,7 @@ class SessionManagerTestCase: BaseTestCase {
         XCTAssertEqual(handler.retryCount, 1)
         XCTAssertEqual(request.retryCount, 0)
         XCTAssertEqual(response?.result.isSuccess, false)
-        XCTAssertTrue(sessionManager.delegate.requests.isEmpty)
+        XCTAssertTrue(sessionManager.delegate.protectedRequests.directValue.isEmpty)
 
         if let error = response?.result.error as? AFError {
             XCTAssertTrue(error.isInvalidURLError)