Added some more api tests

This commit is contained in:
EricNeid 2020-11-06 08:38:14 +01:00
parent a96f5562bb
commit 28469b382e

View File

@ -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")
}