From d14ba85a5a4b38c3b26efa992c2d70211bf81e71 Mon Sep 17 00:00:00 2001 From: Przemko Date: Fri, 19 Nov 2021 11:15:08 +0100 Subject: [PATCH] fix tests --- airly_it_test.go | 4 ++-- airly_test.go | 54 ++++++++++++++++++++++++------------------------ 2 files changed, 29 insertions(+), 29 deletions(-) diff --git a/airly_it_test.go b/airly_it_test.go index 69fab13..6c077c2 100644 --- a/airly_it_test.go +++ b/airly_it_test.go @@ -25,9 +25,9 @@ func TestInstallationIT(t *testing.T) { assert.Equal(t, Installation{ Id: 8077, Location: Location{50.062006, 19.940984}, - Address: address{"Poland", "Krakow", "Mikołajska", "", "Krakow", "Mikołajska"}, + Address: Address{"Poland", "Krakow", "Mikołajska", "", "Krakow", "Mikołajska"}, Elevation: 220.38, Airly: true, - Sponsor: sponsor{489, "Chatham Financial", "sponsor sensora Airly", "https://cdn.airly.eu/logo/ChathamFinancial_1570109001008_473803190.jpg", "https://crossweb.pl/job/chatham-financial/ ", "Chatham Financial"}, + Sponsor: Sponsor{489, "Chatham Financial", "sponsor sensora Airly", "https://cdn.airly.eu/logo/ChathamFinancial_1570109001008_473803190.jpg", "https://crossweb.pl/job/chatham-financial/ ", "Chatham Financial"}, }, installation) } diff --git a/airly_test.go b/airly_test.go index 3e117d9..e047912 100644 --- a/airly_test.go +++ b/airly_test.go @@ -65,7 +65,7 @@ func TestInstallation(t *testing.T) { "latitude": 50.062006, "longitude": 19.940984 }, - "address": { + "Address": { "country": "Poland", "city": "Kraków", "street": "Mikołajska", @@ -93,7 +93,7 @@ func TestInstallation(t *testing.T) { Latitude: 50.062006, Longitude: 19.940984, }, - Address: address{ + Address: Address{ Country: "Poland", City: "Kraków", Street: "Mikołajska", @@ -103,7 +103,7 @@ func TestInstallation(t *testing.T) { }, Elevation: 220.38, Airly: true, - Sponsor: sponsor{ + Sponsor: Sponsor{ Name: "KrakówOddycha", Description: "Sensor Airly w ramach akcji", Logo: "https://cdn.airly.org/logo/KrakówOddycha.jpg", @@ -130,7 +130,7 @@ func TestNearestInstallations(t *testing.T) { "latitude": 50.062006, "longitude": 19.940984 }, - "address": { + "Address": { "country": "Poland", "city": "Kraków", "street": "Mikołajska", @@ -158,7 +158,7 @@ func TestNearestInstallations(t *testing.T) { Latitude: 50.062006, Longitude: 19.940984, }, - Address: address{ + Address: Address{ Country: "Poland", City: "Kraków", Street: "Mikołajska", @@ -168,7 +168,7 @@ func TestNearestInstallations(t *testing.T) { }, Elevation: 220.38, Airly: true, - Sponsor: sponsor{ + Sponsor: Sponsor{ Name: "KrakówOddycha", Description: "Sensor Airly w ramach akcji", Logo: "https://cdn.airly.org/logo/KrakówOddycha.jpg", @@ -195,7 +195,7 @@ func TestNearestInstallationsOptions(t *testing.T) { "latitude": 50.062006, "longitude": 19.940984 }, - "address": { + "Address": { "country": "Poland", "city": "Kraków", "street": "Mikołajska", @@ -224,7 +224,7 @@ func TestNearestInstallationsOptions(t *testing.T) { Latitude: 50.062006, Longitude: 19.940984, }, - Address: address{ + Address: Address{ Country: "Poland", City: "Kraków", Street: "Mikołajska", @@ -234,7 +234,7 @@ func TestNearestInstallationsOptions(t *testing.T) { }, Elevation: 220.38, Airly: true, - Sponsor: sponsor{ + Sponsor: Sponsor{ Name: "KrakówOddycha", Description: "Sensor Airly w ramach akcji", Logo: "https://cdn.airly.org/logo/KrakówOddycha.jpg", @@ -290,17 +290,17 @@ func TestInstallationMeasurements(t *testing.T) { measurements, err := api.InstallationMeasurements(204) assert.Nil(t, err) assert.Equal(t, Measurements{ - Current: measurement{ + Current: Measurement{ FromDateTime: time.Date(2018, 8, 24, 8, 24, 48, 652*1000*1000, time.UTC), TillDateTime: time.Date(2018, 8, 24, 9, 24, 48, 652*1000*1000, time.UTC), - Values: []value{{ + Values: []Value{{ Name: "PM1", Value: 12.73, }, { Name: "PM25", Value: 18.7, }}, - Indexes: []index{{ + Indexes: []Index{{ Name: "AIRLY_CAQI", Value: 35.53, Level: "LOW", @@ -308,15 +308,15 @@ func TestInstallationMeasurements(t *testing.T) { Advice: "Możesz bez obaw wyjść na zewnątrz.", Color: "#D1CF1E", }}, - Standards: []standard{{ + Standards: []Standard{{ Name: "WHO", Pollutant: "PM25", Limit: 25, Percent: 74.81, }}, }, - History: []measurement{}, - Forecast: []measurement{}, + History: []Measurement{}, + Forecast: []Measurement{}, }, measurements) } @@ -367,17 +367,17 @@ func TestNearestMeasurements(t *testing.T) { measurements, err := api.NearestMeasurements(Location{50.062006, 19.940984}, MaxDistance(5)) assert.Nil(t, err) assert.Equal(t, Measurements{ - Current: measurement{ + Current: Measurement{ FromDateTime: time.Date(2018, 8, 24, 8, 24, 48, 652*1000*1000, time.UTC), TillDateTime: time.Date(2018, 8, 24, 9, 24, 48, 652*1000*1000, time.UTC), - Values: []value{{ + Values: []Value{{ Name: "PM1", Value: 12.73, }, { Name: "PM25", Value: 18.7, }}, - Indexes: []index{{ + Indexes: []Index{{ Name: "AIRLY_CAQI", Value: 35.53, Level: "LOW", @@ -385,15 +385,15 @@ func TestNearestMeasurements(t *testing.T) { Advice: "Możesz bez obaw wyjść na zewnątrz.", Color: "#D1CF1E", }}, - Standards: []standard{{ + Standards: []Standard{{ Name: "WHO", Pollutant: "PM25", Limit: 25, Percent: 74.81, }}, }, - History: []measurement{}, - Forecast: []measurement{}, + History: []Measurement{}, + Forecast: []Measurement{}, }, measurements) } @@ -444,17 +444,17 @@ func TestPointMeasurements(t *testing.T) { measurements, err := api.PointMeasurements(Location{50.062006, 19.940984}) assert.Nil(t, err) assert.Equal(t, Measurements{ - Current: measurement{ + Current: Measurement{ FromDateTime: time.Date(2018, 8, 24, 8, 24, 48, 652*1000*1000, time.UTC), TillDateTime: time.Date(2018, 8, 24, 9, 24, 48, 652*1000*1000, time.UTC), - Values: []value{{ + Values: []Value{{ Name: "PM1", Value: 12.73, }, { Name: "PM25", Value: 18.7, }}, - Indexes: []index{{ + Indexes: []Index{{ Name: "AIRLY_CAQI", Value: 35.53, Level: "LOW", @@ -462,14 +462,14 @@ func TestPointMeasurements(t *testing.T) { Advice: "Możesz bez obaw wyjść na zewnątrz.", Color: "#D1CF1E", }}, - Standards: []standard{{ + Standards: []Standard{{ Name: "WHO", Pollutant: "PM25", Limit: 25, Percent: 74.81, }}, }, - History: []measurement{}, - Forecast: []measurement{}, + History: []Measurement{}, + Forecast: []Measurement{}, }, measurements) }