This repository has been archived by the owner on Apr 12, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 111
Risk calculation #671
Merged
kazuhiro4949
merged 7 commits into
cocoa-mhlw:feature/cocoa2
from
keiji:risk_calculation
Jan 12, 2022
Merged
Risk calculation #671
kazuhiro4949
merged 7 commits into
cocoa-mhlw:feature/cocoa2
from
keiji:risk_calculation
Jan 12, 2022
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Closed
Merged
Comment on lines
60
to
95
[Fact] | ||
public void HighRiskExposureTest() | ||
{ | ||
|
||
var dailySummary = new DailySummary() | ||
{ | ||
DateMillisSinceEpoch = 0, | ||
DaySummary = new ExposureSummaryData() | ||
{ | ||
ScoreSum = 2000.0 | ||
}, | ||
ConfirmedClinicalDiagnosisSummary = new ExposureSummaryData(), | ||
ConfirmedTestSummary = new ExposureSummaryData(), | ||
RecursiveSummary = new ExposureSummaryData(), | ||
SelfReportedSummary = new ExposureSummaryData() | ||
}; | ||
|
||
var exposureWindows = new List<ExposureWindow>() | ||
{ | ||
new ExposureWindow() | ||
{ | ||
CalibrationConfidence = CalibrationConfidence.High, | ||
DateMillisSinceEpoch = 0, | ||
Infectiousness = Infectiousness.High, | ||
ReportType = ReportType.Unknown, | ||
ScanInstances = new List<ScanInstance>() | ||
} | ||
}; | ||
|
||
IExposureRiskCalculationService service = CreateService(); | ||
|
||
RiskLevel result = service.CalcRiskLevel(dailySummary, exposureWindows); | ||
|
||
Assert.Equal(RiskLevel.High, result); | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
テストの実装がパラメータと期待値以外は同じなので、LowRiskExposureTestとTheoryでまとめた方がよいかと思います。
[Theory]
[InlineData(1999, RiskLevel.Low)]
[InlineData(2000, RiskLevel.High)]
public void CalcRiskLevelTest(double scoreSum, RiskLevel expected)
// TODO: refine | ||
private const double THRESHOLD_SCORE_SUM = 2000.0; | ||
|
||
public RiskLevel CalcRiskLevel(DailySummary dailySummary, List<ExposureWindow> exposureWindowList) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
引数として渡しているexposureWindowListを使っていないですが後日利用予定でしょう?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
はい。後々ScanInstanceとかも使う予定があるので渡します
@kazuhiro4949 調整しました! |
kazuhiro4949
approved these changes
Jan 12, 2022
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Issue 番号 / Issue ID
#668 に依存する変更。接触通知を発生させるリスクスコアの閾値を変更しやすくする #646これは一旦外す目的 / Purpose
破壊的変更をもたらしますか / Does this introduce a breaking change?
Pull Request の種類 / Pull Request type
検証方法 / How to test
コードの入手 / Get the code
コードの検証 / Test the code
確認事項 / What to check
その他 / Other information