Delete some tests that don’t belong in Feedly tests.

This commit is contained in:
Brent Simmons
2025-04-20 21:20:43 -07:00
parent 7dc965aba6
commit 894acaeb0a

View File

@@ -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)
}
}