Skip to content

Conversation

@NathanaelRorberg
Copy link

No description provided.

Copy link
Contributor

@Bansenauer-Cascadia Bansenauer-Cascadia left a comment

Choose a reason for hiding this comment

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

A good start on the Service logic, but missing the other situation, when the spin is a losing spin.

return .1;
double wins = spinRepository.GetSpins()
.Count(w => w.IsWinning == true);
return (wins + 1) / (spinRepository.GetCount() + 1);
Copy link
Contributor

Choose a reason for hiding this comment

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

This assumption in line 25 is that the spin ALWAYS wins. While this is acceptable in our unit test code where we can handle each case (win or lose) with a different test, our service code has manage both.
Line 25 needs to find some way to check if the current spin is a winner.

double wins = 4 + 1, count = SpinListData.GetCount() + 1;
double expected = wins / count;
Assert.Equal(expected, result);
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Also include the test for
public void SpinService_CalculateAvgWins_LosingSpin() { /* mostly the same code as above, but different expected value */ }

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.

2 participants