Skip to content

Session/11

Session/11 #60

GitHub Actions / flutter test succeeded Oct 27, 2023 in 0s

flutter test ✅

Tests passed successfully

✅ test_report.log

21 tests were completed in 21s with 21 passed, 0 failed and 0 skipped.

Test suite Passed Failed Skipped Time
test/model/weather_forecast_test.dart 5✅ 55ms
test/model/weather_reqest_test.dart 1✅ 24ms
test/service/weather_service_test.dart 3✅ 85ms
test/state/weather_state_notifier_test.dart 5✅ 102ms
test/view/weather_page_test.dart 7✅ 1s

✅ test/model/weather_forecast_test.dart

✅ success case: fromJson
fromJson failure: CheckedFromJsonException should be thrown.
  ✅ non-exist weather
  ✅ jsonData has wrong key
  ✅ unexpected type of value
  ✅ required property is missing

✅ test/model/weather_reqest_test.dart

✅ success case: encode WeatherRequest

✅ test/service/weather_service_test.dart

✅ success case
failure case
  ✅ invalidParameter error is thrown
  ✅ unknown error is thrown

✅ test/state/weather_state_notifier_test.dart

✅ success case: getWeather()
failure case: getWeather()
  ✅ an unknown error is thrown
  ✅ invalidParameter error is thrown
  ✅ fromJson error case: CheckedFromJsonException should be thrown.
  ✅ received data is not in JSON format

✅ test/view/weather_page_test.dart

✅ initial screen
after getting the weather
  ✅ when reload button is pressed, cloudy weather and correct temperature should be displayed.
  ✅ when reload button is pressed, sunny weather and correct temperature should be displayed.
  ✅ when reload button is pressed, rainy weather and correct temperature should be displayed.
when an error occurs
  ✅ when fetchWeather() returns failure with invalidParameter error, error dialog and correct message should be visible. Then the dialog is closed by pressing the ok button.
  ✅ when fetchWeather() returns failure with unknown error, error dialog and correct message should be visible.
  ✅ when fetchWeather() returns failure with CheckedFromJsonException or FormatException, 
        error dialog and correct message should be visible.