diff --git a/Account/Tests/AccountTests/Feedly/FeedlyOperationTests.swift b/Account/Tests/AccountTests/Feedly/FeedlyOperationTests.swift index 7492baa90..f2cbc0dd9 100644 --- a/Account/Tests/AccountTests/Feedly/FeedlyOperationTests.swift +++ b/Account/Tests/AccountTests/Feedly/FeedlyOperationTests.swift @@ -135,97 +135,4 @@ class FeedlyOperationTests: XCTestCase { // // waitForExpectations(timeout: 2) } - - func testProgressReporting() { - let progress = DownloadProgress(numberOfTasks: 0) - let didChangeExpectation = expectation(forNotification: .DownloadProgressDidChange, object: progress) - // This number is the number of times breakpoints on calls to DownloadProgress.postDidChangeNotification is hit. - didChangeExpectation.expectedFulfillmentCount = 4 - didChangeExpectation.assertForOverFulfill = true - - let testOperation = TestOperation() - - testOperation.downloadProgress = progress - XCTAssertTrue(progress.numberRemaining == 1) - - testOperation.downloadProgress = nil - XCTAssertTrue(progress.numberRemaining == 0) - - waitForExpectations(timeout: 2) - } - - func testProgressReportingOnCancel() { - let progress = DownloadProgress(numberOfTasks: 0) - let didChangeExpectation = expectation(forNotification: .DownloadProgressDidChange, object: progress) - // This number is the number of times breakpoints on calls to DownloadProgress.postDidChangeNotification is hit. - didChangeExpectation.expectedFulfillmentCount = 4 - didChangeExpectation.assertForOverFulfill = true - - let testOperation = TestOperation() - testOperation.downloadProgress = progress - - let completionExpectation = expectation(description: "Operation Completed") - testOperation.completionBlock = { _ in - completionExpectation.fulfill() - } - - MainThreadOperationQueue.shared.add(testOperation) - - XCTAssertTrue(progress.numberRemaining == 1) - MainThreadOperationQueue.shared.cancelOperations([testOperation]) - XCTAssertTrue(progress.numberRemaining == 0) - - waitForExpectations(timeout: 2) - - XCTAssertTrue(progress.numberRemaining == 0) - } - - func testDoesProgressReportingOnSuccess() { - let progress = DownloadProgress(numberOfTasks: 0) - let didChangeExpectation = expectation(forNotification: .DownloadProgressDidChange, object: progress) - // This number is the number of times breakpoints on calls to DownloadProgress.postDidChangeNotification is hit. - didChangeExpectation.expectedFulfillmentCount = 4 - didChangeExpectation.assertForOverFulfill = true - - let testOperation = TestOperation() - testOperation.downloadProgress = progress - - let completionExpectation = expectation(description: "Operation Completed") - testOperation.completionBlock = { _ in - completionExpectation.fulfill() - } - - MainThreadOperationQueue.shared.add(testOperation) - - XCTAssertTrue(progress.numberRemaining == 1) - - waitForExpectations(timeout: 2) - - XCTAssertTrue(progress.numberRemaining == 0) - } - - func testProgressReportingOnFailure() { - let progress = DownloadProgress(numberOfTasks: 0) - let didChangeExpectation = expectation(forNotification: .DownloadProgressDidChange, object: progress) - // This number is the number of times breakpoints on calls to DownloadProgress.postDidChangeNotification is hit. - didChangeExpectation.expectedFulfillmentCount = 4 - didChangeExpectation.assertForOverFulfill = true - - let testOperation = TestOperation() - testOperation.mockError = TestOperationError.mockError - testOperation.downloadProgress = progress - - let completionExpectation = expectation(description: "Operation Completed") - testOperation.completionBlock = { _ in - completionExpectation.fulfill() - } - - MainThreadOperationQueue.shared.add(testOperation) - - XCTAssertTrue(progress.numberRemaining == 1) - - waitForExpectations(timeout: 2) - - XCTAssertTrue(progress.numberRemaining == 0) - } }