Skip to content

Commit

Permalink
🐛 fix risk scoring test (#1233)
Browse files Browse the repository at this point in the history
Signed-off-by: Dominik Richter <[email protected]>
  • Loading branch information
arlimus authored Apr 5, 2024
1 parent 2d9bec6 commit 5045098
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions policy/risk_factor_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -166,18 +166,19 @@ func TestRiskFactor_AdjustRiskScoreMultiple(t *testing.T) {
{Magnitude: 0.3},
{Magnitude: 0.4},
}
a := &Score{RiskScore: 20}
rfs[0].AdjustRiskScore(a, true)
rfs[1].AdjustRiskScore(a, true)
rfs[2].AdjustRiskScore(a, true)
a := &Score{RiskScore: 30}
rfs[0].AdjustRiskScore(a, false)
rfs[1].AdjustRiskScore(a, false)
rfs[2].AdjustRiskScore(a, false)

b := &Score{RiskScore: 20}
rfs[2].AdjustRiskScore(b, true)
rfs[1].AdjustRiskScore(b, true)
rfs[0].AdjustRiskScore(b, true)
b := &Score{RiskScore: 30}
rfs[2].AdjustRiskScore(b, false)
rfs[1].AdjustRiskScore(b, false)
rfs[0].AdjustRiskScore(b, false)

a.RiskFactors = nil
b.RiskFactors = nil
assert.Equal(t, uint32(76), a.RiskScore)
assert.Equal(t, a, b)
}

Expand Down

0 comments on commit 5045098

Please sign in to comment.