From 28469b382e1f05edb67f5aaffb9010f77b0926d0 Mon Sep 17 00:00:00 2001 From: EricNeid Date: Fri, 6 Nov 2020 08:38:14 +0100 Subject: [PATCH] Added some more api tests --- api_test.go | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/api_test.go b/api_test.go index c799805..1090c26 100644 --- a/api_test.go +++ b/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") +}