Add tests for ServerProfile
This commit is contained in:
@ -123,7 +123,7 @@ class AppDelegate: NSObject, NSApplicationDelegate, NSUserNotificationCenterDele
|
||||
for url in urls {
|
||||
let profielDict = ParseSSURL(url)
|
||||
if let profielDict = profielDict {
|
||||
let profile = ServerProfile.fromDictionary(profielDict as [String : AnyObject])
|
||||
let profile = ServerProfile.fromDictionary(profielDict)
|
||||
mgr.profiles.append(profile)
|
||||
isChanged = true
|
||||
|
||||
|
@ -28,7 +28,7 @@ class ServerProfile: NSObject {
|
||||
self.uuid = uuid
|
||||
}
|
||||
|
||||
static func fromDictionary(_ data:[String:AnyObject]) -> ServerProfile {
|
||||
static func fromDictionary(_ data:[String: Any?]) -> ServerProfile {
|
||||
let cp = {
|
||||
(profile: ServerProfile) in
|
||||
profile.serverHost = data["ServerHost"] as! String
|
||||
|
@ -21,7 +21,7 @@ class ServerProfileManager: NSObject {
|
||||
let defaults = UserDefaults.standard
|
||||
if let _profiles = defaults.array(forKey: "ServerProfiles") {
|
||||
for _profile in _profiles {
|
||||
let profile = ServerProfile.fromDictionary(_profile as! [String : AnyObject])
|
||||
let profile = ServerProfile.fromDictionary(_profile as! [String: Any])
|
||||
profiles.append(profile)
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user