【发布时间】:2014-12-23 00:02:06
【问题描述】:
我正在尝试快速编写一个 REST Api 类并对其进行测试。我试图遵循how to test asynchronous methods Swift 中的方法,但我似乎遇到了问题。
客户端/RestInterface.swift
import Foundation
protocol RestSearchProtocol {
func didRecieveResponse(results: NSDictionary)
}
public class RestInterface : NSObject {
// lots of code we don't care about ...
}
ClientTests/RestInterfaceTests.swift
import UIKit
import XCTest
import Client
class RestInterfaceTests: XCTestCase, RestSearchProtocol {
// ... rest of the test file
我收到一个未声明的类型错误。
关于如何完成这项工作的任何建议?
附带说明 - 如果我采用 RestInterfaceTests 类并将其放在 RestInterface.swift 的末尾,它似乎找到了协议,但是 XCTestCase 现在未声明
【问题讨论】:
标签: unit-testing swift xcode6