Refactor ParseSSURL as ServerProfile initializer
This commit is contained in:
@ -37,7 +37,7 @@ class ServerProfileTests: XCTestCase {
|
||||
}
|
||||
|
||||
func testServerProfileURL() {
|
||||
let parsed = ParseSSURL(profile.URL())
|
||||
let parsed = ServerProfile(url: profile.URL())?.toDictionary()
|
||||
|
||||
XCTAssertNotNil(parsed)
|
||||
|
||||
@ -49,6 +49,17 @@ class ServerProfileTests: XCTestCase {
|
||||
XCTAssertEqual(parsed?["OTA"] as? Bool, profile.ota)
|
||||
}
|
||||
|
||||
func testServerProfileInitFromURL() {
|
||||
let newProfile = ServerProfile.init(url: profile.URL())
|
||||
|
||||
XCTAssertEqual(newProfile?.serverHost, profile.serverHost)
|
||||
XCTAssertEqual(newProfile?.serverPort, profile.serverPort)
|
||||
XCTAssertEqual(newProfile?.method, profile.method)
|
||||
XCTAssertEqual(newProfile?.password, profile.password)
|
||||
XCTAssertEqual(newProfile?.remark, profile.remark)
|
||||
XCTAssertEqual(newProfile?.ota, profile.ota)
|
||||
}
|
||||
|
||||
func testPerformanceExample() {
|
||||
// This is an example of a performance test case.
|
||||
self.measure {
|
||||
|
Reference in New Issue
Block a user