-
Notifications
You must be signed in to change notification settings - Fork 68
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #984 from pekkah/bug/microjson-dates-numbers-and-a…
…rrays microjson: some fixes for localization and arrays
- Loading branch information
Showing
8 changed files
with
154 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
41 changes: 41 additions & 0 deletions
41
..._and_Frameworks/Serialization.MicroJson/Tests/MicroJson.Unit.Tests/inputs/open-meteo.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
{ | ||
"latitude": 60.17136, | ||
"longitude": 24.927353, | ||
"generationtime_ms": 0.11599063873291016, | ||
"utc_offset_seconds": 10800, | ||
"timezone": "Europe/Helsinki", | ||
"timezone_abbreviation": "EEST", | ||
"elevation": 12.0, | ||
"current_units": { | ||
"time": "iso8601", | ||
"interval": "seconds", | ||
"temperature_2m": "°C", | ||
"relative_humidity_2m": "%" | ||
}, | ||
"current": { | ||
"time": "2024-05-20T13:45", | ||
"interval": 900, | ||
"temperature_2m": 19.0, | ||
"relative_humidity_2m": 24 | ||
}, | ||
"hourly_units": { | ||
"time": "iso8601", | ||
"temperature_2m": "°C" | ||
}, | ||
"hourly": { | ||
"time": [ "2024-05-20T00:00", "2024-05-20T01:00", "2024-05-20T02:00", "2024-05-20T03:00", "2024-05-20T04:00", "2024-05-20T05:00", "2024-05-20T06:00", "2024-05-20T07:00", "2024-05-20T08:00", "2024-05-20T09:00", "2024-05-20T10:00", "2024-05-20T11:00", "2024-05-20T12:00", "2024-05-20T13:00", "2024-05-20T14:00", "2024-05-20T15:00", "2024-05-20T16:00", "2024-05-20T17:00", "2024-05-20T18:00", "2024-05-20T19:00", "2024-05-20T20:00", "2024-05-20T21:00", "2024-05-20T22:00", "2024-05-20T23:00", "2024-05-21T00:00", "2024-05-21T01:00", "2024-05-21T02:00", "2024-05-21T03:00", "2024-05-21T04:00", "2024-05-21T05:00", "2024-05-21T06:00", "2024-05-21T07:00", "2024-05-21T08:00", "2024-05-21T09:00", "2024-05-21T10:00", "2024-05-21T11:00", "2024-05-21T12:00", "2024-05-21T13:00", "2024-05-21T14:00", "2024-05-21T15:00", "2024-05-21T16:00", "2024-05-21T17:00", "2024-05-21T18:00", "2024-05-21T19:00", "2024-05-21T20:00", "2024-05-21T21:00", "2024-05-21T22:00", "2024-05-21T23:00", "2024-05-22T00:00", "2024-05-22T01:00", "2024-05-22T02:00", "2024-05-22T03:00", "2024-05-22T04:00", "2024-05-22T05:00", "2024-05-22T06:00", "2024-05-22T07:00", "2024-05-22T08:00", "2024-05-22T09:00", "2024-05-22T10:00", "2024-05-22T11:00", "2024-05-22T12:00", "2024-05-22T13:00", "2024-05-22T14:00", "2024-05-22T15:00", "2024-05-22T16:00", "2024-05-22T17:00", "2024-05-22T18:00", "2024-05-22T19:00", "2024-05-22T20:00", "2024-05-22T21:00", "2024-05-22T22:00", "2024-05-22T23:00", "2024-05-23T00:00", "2024-05-23T01:00", "2024-05-23T02:00", "2024-05-23T03:00", "2024-05-23T04:00", "2024-05-23T05:00", "2024-05-23T06:00", "2024-05-23T07:00", "2024-05-23T08:00", "2024-05-23T09:00", "2024-05-23T10:00", "2024-05-23T11:00", "2024-05-23T12:00", "2024-05-23T13:00", "2024-05-23T14:00", "2024-05-23T15:00", "2024-05-23T16:00", "2024-05-23T17:00", "2024-05-23T18:00", "2024-05-23T19:00", "2024-05-23T20:00", "2024-05-23T21:00", "2024-05-23T22:00", "2024-05-23T23:00", "2024-05-24T00:00", "2024-05-24T01:00", "2024-05-24T02:00", "2024-05-24T03:00", "2024-05-24T04:00", "2024-05-24T05:00", "2024-05-24T06:00", "2024-05-24T07:00", "2024-05-24T08:00", "2024-05-24T09:00", "2024-05-24T10:00", "2024-05-24T11:00", "2024-05-24T12:00", "2024-05-24T13:00", "2024-05-24T14:00", "2024-05-24T15:00", "2024-05-24T16:00", "2024-05-24T17:00", "2024-05-24T18:00", "2024-05-24T19:00", "2024-05-24T20:00", "2024-05-24T21:00", "2024-05-24T22:00", "2024-05-24T23:00", "2024-05-25T00:00", "2024-05-25T01:00", "2024-05-25T02:00", "2024-05-25T03:00", "2024-05-25T04:00", "2024-05-25T05:00", "2024-05-25T06:00", "2024-05-25T07:00", "2024-05-25T08:00", "2024-05-25T09:00", "2024-05-25T10:00", "2024-05-25T11:00", "2024-05-25T12:00", "2024-05-25T13:00", "2024-05-25T14:00", "2024-05-25T15:00", "2024-05-25T16:00", "2024-05-25T17:00", "2024-05-25T18:00", "2024-05-25T19:00", "2024-05-25T20:00", "2024-05-25T21:00", "2024-05-25T22:00", "2024-05-25T23:00", "2024-05-26T00:00", "2024-05-26T01:00", "2024-05-26T02:00", "2024-05-26T03:00", "2024-05-26T04:00", "2024-05-26T05:00", "2024-05-26T06:00", "2024-05-26T07:00", "2024-05-26T08:00", "2024-05-26T09:00", "2024-05-26T10:00", "2024-05-26T11:00", "2024-05-26T12:00", "2024-05-26T13:00", "2024-05-26T14:00", "2024-05-26T15:00", "2024-05-26T16:00", "2024-05-26T17:00", "2024-05-26T18:00", "2024-05-26T19:00", "2024-05-26T20:00", "2024-05-26T21:00", "2024-05-26T22:00", "2024-05-26T23:00" ], | ||
"temperature_2m": [ 16.9, 16.3, 15.9, 15.0, 14.6, 14.6, 14.3, 14.9, 14.7, 14.8, 15.1, 15.7, 16.4, 18.1, 19.1, 19.7, 19.8, 19.5, 19.3, 19.1, 18.4, 17.6, 16.7, 16.2, 15.9, 15.3, 14.3, 13.0, 11.8, 10.8, 10.4, 10.8, 11.6, 13.0, 14.3, 14.9, 15.2, 15.8, 16.6, 17.2, 17.5, 17.6, 17.4, 17.2, 16.7, 15.9, 15.0, 14.3, 13.7, 13.3, 12.8, 12.0, 11.4, 11.1, 11.2, 11.6, 12.4, 13.1, 13.8, 14.6, 15.9, 17.2, 18.3, 18.6, 18.9, 19.1, 19.1, 18.8, 18.2, 17.7, 16.8, 12.6, 12.2, 12.0, 11.8, 11.5, 11.2, 11.0, 11.3, 12.1, 13.1, 14.0, 14.8, 15.5, 16.3, 16.6, 17.0, 17.2, 17.4, 17.6, 17.4, 16.8, 15.9, 15.1, 14.3, 13.6, 13.0, 12.8, 12.7, 12.7, 12.6, 12.5, 12.7, 13.3, 14.2, 15.1, 16.1, 17.2, 18.1, 18.7, 19.1, 19.4, 19.6, 19.6, 19.3, 18.5, 17.3, 16.3, 15.6, 15.1, 14.7, 14.5, 14.5, 14.4, 14.1, 13.8, 13.7, 14.2, 15.0, 15.6, 20.1, 21.4, 22.5, 23.3, 24.0, 24.3, 24.2, 23.8, 23.2, 22.4, 21.3, 20.2, 19.0, 17.7, 16.6, 16.0, 15.7, 15.3, 14.5, 13.7, 13.2, 13.5, 14.3, 15.0, 15.6, 16.2, 16.6, 16.6, 16.4, 16.2, 16.1, 15.9, 15.5, 14.9, 14.2, 13.4, 12.6, 11.8 ] | ||
}, | ||
"daily_units": { | ||
"time": "iso8601", | ||
"weather_code": "wmo code", | ||
"temperature_2m_max": "°C", | ||
"temperature_2m_min": "°C" | ||
}, | ||
"daily": { | ||
"time": [ "2024-05-20", "2024-05-21", "2024-05-22", "2024-05-23", "2024-05-24", "2024-05-25", "2024-05-26" ], | ||
"weather_code": [ 3, 3, 0, 0, 3, 80, 3 ], | ||
"temperature_2m_max": [ 19.8, 17.6, 19.1, 17.6, 19.6, 24.3, 16.6 ], | ||
"temperature_2m_min": [ 14.3, 10.4, 11.1, 11.0, 12.5, 13.7, 11.8 ] | ||
} | ||
} |
69 changes: 69 additions & 0 deletions
69
...rameworks/Serialization.MicroJson/Tests/MicroJson.Unit.Tests/test types/OpenMeteoTypes.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.IO; | ||
using System.Linq; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
|
||
namespace Unit.Tests; | ||
|
||
public class MeteoResponse | ||
{ | ||
public float latitude { get; set; } | ||
public float longitude { get; set; } | ||
public float generationtime_ms { get; set; } | ||
public int utc_offset_seconds { get; set; } | ||
public string timezone { get; set; } | ||
public string timezone_abbreviation { get; set; } | ||
public float elevation { get; set; } | ||
public Current_Units current_units { get; set; } | ||
public Current current { get; set; } | ||
public Hourly_Units hourly_units { get; set; } | ||
public Hourly hourly { get; set; } | ||
public Daily_Units daily_units { get; set; } | ||
public Daily daily { get; set; } | ||
} | ||
|
||
public class Current_Units | ||
{ | ||
public string time { get; set; } | ||
public string interval { get; set; } | ||
public string temperature_2m { get; set; } | ||
public string relative_humidity_2m { get; set; } | ||
} | ||
|
||
public class Current | ||
{ | ||
public string time { get; set; } | ||
public int interval { get; set; } | ||
public float temperature_2m { get; set; } | ||
public int relative_humidity_2m { get; set; } | ||
} | ||
|
||
public class Hourly_Units | ||
{ | ||
public string time { get; set; } | ||
public string temperature_2m { get; set; } | ||
} | ||
|
||
public class Hourly | ||
{ | ||
public string[] time { get; set; } | ||
public float[] temperature_2m { get; set; } | ||
} | ||
|
||
public class Daily_Units | ||
{ | ||
public string time { get; set; } | ||
public string weather_code { get; set; } | ||
public string temperature_2m_max { get; set; } | ||
public string temperature_2m_min { get; set; } | ||
} | ||
|
||
public class Daily | ||
{ | ||
public string[] time { get; set; } | ||
public int[] weather_code { get; set; } | ||
public float[] temperature_2m_max { get; set; } | ||
public float[] temperature_2m_min { get; set; } | ||
} |