func TestDeserializeWeatherWithAllFields(t *testing.T) {
	var w HourlyForecast
	require.NoError(t, json.Unmarshal(everyWeatherField, &w))
	assert.Equal(t, 91.128, w.Lat)
	assert.Equal(t, -181.250, w.Lon)
	expObservationTime, err := time.Parse(time.RFC3339, "2020-04-12T12:00:00.000Z")
	require.NoError(t, err)
	assert.EqualValues(t, expObservationTime, w.ObservationTime.Value)
	if temp, ok := w.Temp.GetValue(); assert.True(t, ok) {
		assert.EqualValues(t, 10, temp)
	}
	if feelsLike, ok := w.FeelsLike.GetValue(); assert.True(t, ok) {
		assert.EqualValues(t, 10, feelsLike)
	}
	if dewPoint, ok := w.DewPoint.GetValue(); assert.True(t, ok) {
		assert.EqualValues(t, -0.50, dewPoint)
	}
	if windSpeed, ok := w.WindSpeed.GetValue(); assert.True(t, ok) {
		assert.EqualValues(t, 5, windSpeed)
	}
	if windGust, ok := w.WindGust.GetValue(); assert.True(t, ok) {
		assert.EqualValues(t, 10, windGust)
	}
	if baroPressure, ok := w.BaroPressure.GetValue(); assert.True(t, ok) {
		assert.EqualValues(t, 20.71, baroPressure)
	}
	if visibility, ok := w.Visibility.GetValue(); assert.True(t, ok) {
		assert.EqualValues(t, 6.21371, visibility)
	}
	if humidity, ok := w.Humidity.GetValue(); assert.True(t, ok) {
		assert.EqualValues(t, 20.71, humidity)
	}
	if windDirection, ok := w.WindDirection.GetValue(); assert.True(t, ok) {
		assert.EqualValues(t, 250.25, windDirection)
	}
	if precipitation, ok := w.Precipitation.GetValue(); assert.True(t, ok) {
		assert.EqualValues(t, 10, precipitation)
	}
	if precipitationType, ok := w.PrecipitationType.GetValue(); assert.True(t, ok) {
		assert.EqualValues(t, "rain", precipitationType)
	}
	if cloudCover, ok := w.CloudCover.GetValue(); assert.True(t, ok) {
		assert.EqualValues(t, 12.8, cloudCover)
	}
	if cloudCeiling, ok := w.CloudCeiling.GetValue(); assert.True(t, ok) {
		assert.EqualValues(t, 6000, cloudCeiling)
	}
	if cloudBase, ok := w.CloudBase.GetValue(); assert.True(t, ok) {
		assert.EqualValues(t, 5000, cloudBase)
	}
	if ssw, ok := w.SurfaceShortwaveRadiation.GetValue(); assert.True(t, ok) {
		assert.EqualValues(t, 250.1123, ssw)
	}
	if fireIndex, ok := w.FireIndex.GetValue(); ok {
		assert.EqualValues(t, 3.6, fireIndex)
	}
	expSunrise, err := time.Parse(time.RFC3339, "2020-04-12T12:34:56.789Z")
	require.NoError(t, err)
	if sunrise, ok := w.Sunrise.GetValue(); assert.True(t, ok) {
		assert.WithinDuration(t, expSunrise, sunrise, time.Second)
	}
	expSunset, err := time.Parse(time.RFC3339, "2020-04-12T23:45:56.789Z")
	require.NoError(t, err)
	if sunset, ok := w.Sunset.GetValue(); assert.True(t, ok) {
		assert.WithinDuration(t, expSunset, sunset, time.Second)
	}
	if moonPhase, ok := w.MoonPhase.GetValue(); assert.True(t, ok) {
		assert.EqualValues(t, "waning_gibbous", moonPhase)
	}
	if weatherCode, ok := w.WeatherCode.GetValue(); assert.True(t, ok) {
		assert.EqualValues(t, "mostly_clear", weatherCode)
	}
	if roadRisk, ok := w.RoadRisk.GetValue(); assert.True(t, ok) {
		assert.EqualValues(t, "low_risk", roadRisk)
	}
	if roadRiskScore, ok := w.RoadRiskScore.GetValue(); assert.True(t, ok) {
		assert.EqualValues(t, "Low Risk", roadRiskScore)
	}
	if roadRiskConfidence, ok := w.RoadRiskConfidence.GetValue(); assert.True(t, ok) {
		assert.EqualValues(t, 100, roadRiskConfidence)
	}
	if roadRiskConditions, ok := w.RoadRiskConditions.GetValue(); assert.True(t, ok) {
		assert.EqualValues(t, "Low visibility", roadRiskConditions)
	}
	if epaAQI, ok := w.EpaAQI.GetValue(); assert.True(t, ok) {
		assert.EqualValues(t, 25, epaAQI)
	}
	if epaPrimaryPollutant, ok := w.EPAPrimaryPollutant.GetValue(); assert.True(t, ok) {
		assert.EqualValues(t, "pm25", epaPrimaryPollutant)
	}
	if epaHealthConcern, ok := w.EPAHealthConcern.GetValue(); assert.True(t, ok) {
		assert.EqualValues(t, "Good", epaHealthConcern)
	}
	if chinaAQI, ok := w.ChinaAQI.GetValue(); assert.True(t, ok) {
		assert.EqualValues(t, 12, chinaAQI)
	}
	if chinaPrimaryPollutant, ok := w.ChinaPrimaryPollutant.GetValue(); assert.True(t, ok) {
		assert.EqualValues(t, "pm25", chinaPrimaryPollutant)
	}
	if chinaHealthConcern, ok := w.ChinaHealthConcern.GetValue(); assert.True(t, ok) {
		assert.EqualValues(t, "Good", chinaHealthConcern)
	}
	if pmTwoPointFive, ok := w.PMTwoPointFive.GetValue(); assert.True(t, ok) {
		assert.EqualValues(t, 10, pmTwoPointFive)
	}
	if pmTen, ok := w.PMTen.GetValue(); assert.True(t, ok) {
		assert.EqualValues(t, 15, pmTen)
	}
	if o3, ok := w.O3.GetValue(); assert.True(t, ok) {
		assert.EqualValues(t, 8, o3)
	}
	if no2, ok := w.NO2.GetValue(); assert.True(t, ok) {
		assert.EqualValues(t, 40, no2)
	}
	if co, ok := w.CO.GetValue(); assert.True(t, ok) {
		assert.EqualValues(t, 3, co)
	}
	if so2, ok := w.SO2.GetValue(); assert.True(t, ok) {
		assert.EqualValues(t, 1, so2)
	}
}
TestDeserializeWeatherWithAllFields validates that if we try to deserialize
a Weather sample with all fields non-null, the deserialization succeeds.
package climacell
import (
	"encoding/json"
	"testing"
	"time"
	"github.com/stretchr/testify/assert"
	"github.com/stretchr/testify/require"
)
var everyWeatherField = []byte(`
{
  "lat":                         91.128,
  "lon":                         -181.250,
  "temp":                        {"value": 10,       "units": "C"},
  "feels_like":                  {"value": 10,       "units": "C"},
  "dewpoint":                    {"value": -0.50,    "units": "C"},
  "wind_speed":                  {"value": 5,        "units": "beaufort"},
  "wind_gust":                   {"value": 10,       "units": "beaufort"},
  "baro_pressure":               {"value": 20.71,    "units": "inHg"},
  "visibility":                  {"value": 6.21371,  "units": "mi"},
  "humidity":                    {"value": 20.71,    "units": "%"},
  "wind_direction":              {"value": 250.25,   "units": "degrees"},
  "precipitation":               {"value": 10,       "units": "mm/hr"},
  "precipitation_type":          {"value": "rain"},
  "cloud_cover":                 {"value": 12.8,     "units": "%"},
  "cloud_ceiling":               {"value": 6000,     "units": "ft"},
  "cloud_base":                  {"value": 5000,     "units": "ft"},
  "surface_shortwave_radiation": {"value": 250.1123, "units": "w/sqm"},
  "fire_index":                  {"value": 3.6},
  "sunrise":                     {"value": "2020-04-12T12:34:56.789Z"},
  "sunset":                      {"value": "2020-04-12T23:45:56.789Z"},
  "moon_phase":                  {"value": "waning_gibbous"},
  "weather_code":                {"value": "mostly_clear"},
  "road_risk":                   {"value": "low_risk"},
  "road_risk_score":             {"value": "Low Risk"},
  "road_risk_confidence":        {"value": 100 },
  "road_risk_conditions":        {"value": "Low visibility"},
  "epa_aqi":                     {"value": 25},
  "epa_primary_pollutant":       {"value": "pm25"},
  "china_aqi":                   {"value": 12},
  "china_primary_pollutant":     {"value": "pm25"},
  "pm25":                        {"value": 10,       "units": "µg/m3"},
  "pm10":                        {"value": 15,       "units": "µg/m3"},
  "o3":                          {"value": 8,        "units": "ppb"},
  "no2":                         {"value": 40,       "units": "ppb"},
  "co":                          {"value": 3,        "units": "ppm"},
  "so2":                         {"value": 1,        "units": "ppb"},
  "epa_health_concern":          {"value": "Good"},
  "china_health_concern":        {"value": "Good"},
  "observation_time":            {"value": "2020-04-12T12:00:00.000Z"}
}`)