ios/Authenticator/Application/TestHelpers/Support/TestInstanceFactory.swift
2024-03-28 23:01:06 -05:00

12 lines
320 B
Swift

import Foundation
enum TestInstanceFactory {
static func create<T: NSObject>(_ type: T.Type, properties: [String: Any] = [:]) -> T {
let instance = type.init()
for property in properties {
instance.setValue(property.value, forKey: property.key)
}
return instance
}
}