Skip to content

Session/10

Session/10 #57

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

flutter test ✅

Tests passed successfully

✅ test_report.log

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

Test suite Passed Failed Skipped Time
test/model/weather_forecast_test.dart 5✅ 52ms
test/model/weather_reqest_test.dart 1✅ 25ms
test/service/weather_service_test.dart 3✅ 86ms
test/state/weather_state_notifier_test.dart 5✅ 90ms
test/view/weather_page_test.dart 8✅ 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, error dialog and correct message should be visible.
  ✅ when fetchWeather() returns failure with FormatException, error dialog and correct message should be visible.