Delete unused FeedlyCheckpointOperationTests (since FeedlyCheckpointOperation no longer exists).
This commit is contained in:
parent
ec12232fb8
commit
aa14143494
@ -1,61 +0,0 @@
|
|||||||
//
|
|
||||||
// FeedlyCheckpointOperationTests.swift
|
|
||||||
// AccountTests
|
|
||||||
//
|
|
||||||
// Created by Kiel Gillard on 25/10/19.
|
|
||||||
// Copyright © 2019 Ranchero Software, LLC. All rights reserved.
|
|
||||||
//
|
|
||||||
|
|
||||||
import XCTest
|
|
||||||
@testable import Account
|
|
||||||
|
|
||||||
class FeedlyCheckpointOperationTests: XCTestCase {
|
|
||||||
|
|
||||||
class TestDelegate: FeedlyCheckpointOperationDelegate {
|
|
||||||
|
|
||||||
var didReachCheckpointExpectation: XCTestExpectation?
|
|
||||||
|
|
||||||
func feedlyCheckpointOperationDidReachCheckpoint(_ operation: FeedlyCheckpointOperation) {
|
|
||||||
didReachCheckpointExpectation?.fulfill()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
func testCallback() {
|
|
||||||
let delegate = TestDelegate()
|
|
||||||
delegate.didReachCheckpointExpectation = expectation(description: "Did Reach Checkpoint")
|
|
||||||
|
|
||||||
let operation = FeedlyCheckpointOperation()
|
|
||||||
operation.checkpointDelegate = delegate
|
|
||||||
|
|
||||||
let didFinishExpectation = expectation(description: "Did Finish")
|
|
||||||
operation.completionBlock = { _ in
|
|
||||||
didFinishExpectation.fulfill()
|
|
||||||
}
|
|
||||||
|
|
||||||
MainThreadOperationQueue.shared.add(operation)
|
|
||||||
|
|
||||||
waitForExpectations(timeout: 2)
|
|
||||||
}
|
|
||||||
|
|
||||||
func testCancellation() {
|
|
||||||
let didReachCheckpointExpectation = expectation(description: "Did Reach Checkpoint")
|
|
||||||
didReachCheckpointExpectation.isInverted = true
|
|
||||||
|
|
||||||
let delegate = TestDelegate()
|
|
||||||
delegate.didReachCheckpointExpectation = didReachCheckpointExpectation
|
|
||||||
|
|
||||||
let operation = FeedlyCheckpointOperation()
|
|
||||||
operation.checkpointDelegate = delegate
|
|
||||||
|
|
||||||
let didFinishExpectation = expectation(description: "Did Finish")
|
|
||||||
operation.completionBlock = { _ in
|
|
||||||
didFinishExpectation.fulfill()
|
|
||||||
}
|
|
||||||
|
|
||||||
MainThreadOperationQueue.shared.add(operation)
|
|
||||||
|
|
||||||
MainThreadOperationQueue.shared.cancelOperations([operation])
|
|
||||||
|
|
||||||
waitForExpectations(timeout: 1)
|
|
||||||
}
|
|
||||||
}
|
|
Loading…
x
Reference in New Issue
Block a user