Skip to content

Conversation

@nateptay
Copy link

@nateptay nateptay commented May 6, 2020

pair programming with @edmundchan8

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.

Fine work on your unit test. See my suggesting for refactoring your logic code.

Comment on lines +21 to +23
double wins = 0;
if (winning)
wins = 1;
Copy link
Contributor

Choose a reason for hiding this comment

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

Consider using the conditional operator ?: to assign the wins start value which takes a boolean and returns either the first if true or second value if not.
double wins = winning ? 1 : 0;

Comment on lines +24 to +28
foreach (Spin s in spinRepository.GetSpins())
{
if (s.IsWinning == true)
wins++;
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Consider using the Lamda Extension method Count() on the spins collection returned by GetSpins()

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