mirror of
https://github.com/EricNeid/go-openweather.git
synced 2025-01-10 15:05:07 +00:00
Added some more api tests
This commit is contained in:
parent
a96f5562bb
commit
28469b382e
20
api_test.go
20
api_test.go
@ -62,3 +62,23 @@ func TestDailyForecast(t *testing.T) {
|
||||
test.Ok(t, err)
|
||||
test.Equals(t, "Berlin", data.City.Name)
|
||||
}
|
||||
|
||||
func TestDailyForecast5(t *testing.T) {
|
||||
// arrange
|
||||
q := NewQueryForCity(readAPIKey(), cityBerlin)
|
||||
// action
|
||||
data, err := q.DailyForecast5()
|
||||
// verify
|
||||
test.Ok(t, err)
|
||||
test.Equals(t, "Berlin", data.City.Name)
|
||||
}
|
||||
|
||||
func TestDailyForecast5Raw(t *testing.T) {
|
||||
// arrange
|
||||
q := NewQueryForCity(readAPIKey(), cityBerlin)
|
||||
// action
|
||||
data, err := q.DailyForecast5Raw()
|
||||
// verify
|
||||
test.Ok(t, err)
|
||||
test.Assert(t, len(data) > 0, "Empty response received")
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user