Skip to content
This repository has been archived by the owner on Apr 12, 2023. It is now read-only.

Migrate IDeviceVerifier from DependencyService to ServiceLocator #189

Merged

Conversation

keiji
Copy link
Collaborator

@keiji keiji commented May 17, 2021

Issue 番号 / Issue ID

目的 / Purpose

DependencyServiceを廃止するためにIDeviceVerifierをServiceLocatorに移行する。

破壊的変更をもたらしますか / Does this introduce a breaking change?

[x] Yes
[ ] No

Pull Request の種類 / Pull Request type

[ ] Bugfix
[ ] Feature
[ ] Code style update (formatting, local variables)
[x] Refactoring (no functional changes, no api changes)
[ ] Documentation content changes
[ ] Other... Please describe:

検証方法 / How to test

コードの入手 / Get the code

git clone [repo-address]
cd [repo-name]
git checkout [branch-name]
dotnet restore

確認事項 / What to check

  • Debug_Mock時にダミーの結果を返す(実際のDeviceCheckを使わない)
  • Debug/Release時には実際のDeviceCheckを使用する

その他 / Other information

#if USE_MOCKでモックを登録するところだけAppに置くか迷ったけど、結局Android, iOSのプラットフォーム固有処理の登録で#ifディレクティブ使うことになるので現在の形になりました。

@@ -29,6 +28,7 @@ public class ExposureNotificationHandler : IExposureNotificationHandler
private IHttpDataService HttpDataService => ServiceLocator.Current.GetInstance<IHttpDataService>();
private IExposureNotificationService ExposureNotificationService => ServiceLocator.Current.GetInstance<IExposureNotificationService>();
private IUserDataService UserDataService => ServiceLocator.Current.GetInstance<IUserDataService>();
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

この辺にもreadonly付けたかったけど、今回の変更に関係ないのでぐっと我慢

Copy link
Contributor

Choose a reason for hiding this comment

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

この辺はフィールド変数ではなく読み取り専用のプロパティになっているので readonly を付ける必要はありません。

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

ほんとだ! よく見たら => ですね!

@i-maruyama
Copy link
Contributor

#191 で合わせて、動作確認しました。

@keiji keiji changed the base branch from master to develop June 7, 2021 07:15
Copy link
Contributor

@cocoa-dev cocoa-dev left a comment

Choose a reason for hiding this comment

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

確認しました。問題ありませんのでApproveします。

@cocoa-dev cocoa-dev merged commit 68ba94c into cocoa-mhlw:develop Jun 24, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

IDeviceVerifierをServiceLocatorで取り扱う
4 participants