From 32986cf7e43fffb22b70d594981ec738b13d1c53 Mon Sep 17 00:00:00 2001 From: Maximilian Wendel Date: Fri, 12 Feb 2021 16:25:55 +0100 Subject: [PATCH] Added example data --- Sources/Weather/Models/Forecast.swift | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/Sources/Weather/Models/Forecast.swift b/Sources/Weather/Models/Forecast.swift index a1a1f8e..8a8162d 100644 --- a/Sources/Weather/Models/Forecast.swift +++ b/Sources/Weather/Models/Forecast.swift @@ -49,3 +49,24 @@ public struct Forecast: Decodable { return self.get(name)[keyPath: keyPath] } } + +#if DEBUG +extension Forecast { + public static var example: Forecast { + return Forecast( + validTime: Date(), + parameters: [ + Parameter( + name: .t, + levelType: .unknown, + level: 0, + unit: "Cel", + values: [ + Double.random(in: -10...10) + ] + ) + ] + ) + } +} +#endif