Validations/Tests/ValidationsTests/ValidationsTestCase.swift

11 lines
276 B
Swift

import Foundation
import XCTest
class ValidationsTestCase: XCTestCase {
private let decoder = JSONDecoder()
func decode<T: Decodable>(_ string: String, as _: T.Type = T.self) throws -> T {
try decoder.decode(T.self, from: string.data(using: .utf8)!)
}
}