mirror of
https://github.com/Ranchero-Software/NetNewsWire
synced 2025-08-12 06:26:36 +00:00
Delete some tests that don’t belong in Feedly tests.
This commit is contained in:
@@ -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)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user