Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Session/9 #22

Merged
merged 30 commits into from
Oct 6, 2023
Merged

Session/9 #22

merged 30 commits into from
Oct 6, 2023

Conversation

mqkotoo
Copy link
Owner

@mqkotoo mqkotoo commented Sep 28, 2023

課題

close #10

対応箇所

  • yumemi_weather API の呼び出しから Widget へ通知する部分までの Unit tests を書く
    • 以下のクラスのunitテストを実装しました
    • WeatherService
    • WeatherRequest
    • WeatherForecast
    • WeatherStateNotifier
  • 依存しているものが、成功・失敗するケースも網羅する
  • 余力があれば、JSON のエンコード・デコードの Unit tests も書く
    • jsonEncode: WeatherRequest
    • jsonDecode: WeatherForecast

動作

動作変更なし

@mqkotoo mqkotoo marked this pull request as ready for review October 2, 2023 03:17
@github-actions
Copy link

github-actions bot commented Oct 2, 2023

Ready for review 🚀

@mqkotoo
Copy link
Owner Author

mqkotoo commented Oct 2, 2023

[memo]
json.encode()とjsonEncode()等の違い

jsonは変数名と被ることが多いからjsonEncode が用意されているみたい
jsonEncode内でjson.encodeを呼び出している

ref:
flutter - What is the difference and preferred way between jsonEncode() and json.encode() in Dart? - Stack Overflow

https://api.flutter.dev/flutter/dart-convert/jsonEncode.html#:~:text=Shorthand%20for%20json.encode.%20Useful%20if%20a%20local%20variable%20shadows%20the%20global%20json%20constant.

.vscode/settings.json Show resolved Hide resolved
test/model/weather_forecast_test.dart Show resolved Hide resolved
test/model/weather_forecast_test.dart Show resolved Hide resolved
test/model/weather_forecast_test.dart Outdated Show resolved Hide resolved
test/model/weather_forecast_test.dart Outdated Show resolved Hide resolved
test/model/weather_reqest_test.dart Show resolved Hide resolved
test/state/weather_state_notifier_test.dart Outdated Show resolved Hide resolved
test/state/weather_state_notifier_test.dart Outdated Show resolved Hide resolved
@Yamasaki-pan961
Copy link
Collaborator

一旦レビューしました。
テストの実装に関してはテストの基本ができており、さまざまなテストケースを考慮できているので非常に良いです!

imo-badge
一つ気になったのは、テストのdescriptionで"case"というワードがよく使われていることです。
個人的には文章的な説明をするように心がけているのでコメントのように書くことが多いです。

(間違ってコメントなしでレビューを送ってしましました)

Copy link
Collaborator

@Yamasaki-pan961 Yamasaki-pan961 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

1点だけ指摘していますが問題ないです。ご対応ありがとうございます。
LGTM

test/model/weather_forecast_test.dart Show resolved Hide resolved
test/state/weather_state_notifier_test.dart Outdated Show resolved Hide resolved
@mqkotoo mqkotoo merged commit 4e41359 into main Oct 6, 2023
3 checks passed
@mqkotoo mqkotoo deleted the session/9 branch October 6, 2023 07:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Session9
3 participants