Skip to content

All done#1

Open
SkutchWill wants to merge 1 commit intoWebApps-Cascadia:tdd-setupfrom
SkutchWill:Roger_Will
Open

All done#1
SkutchWill wants to merge 1 commit intoWebApps-Cascadia:tdd-setupfrom
SkutchWill:Roger_Will

Conversation

@SkutchWill
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.

Great work on the using the test to build code logic. Bonus is complete

Comment on lines +35 to +43
double wins;
if (isWinning)
{
wins = 4 + 1;
}
else
{
wins = 4;
}
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 ternary conditional operator ?: to assign the wins value - it takes a boolean and returns either the first value, if true or second value if not. So the 9 lines above end up as...
double wins = isWinning ? 5 : 4;

{
//TODO: Write logic to use the "real" spinRepository NOT the test data
return .1;
double wins = spinRepository.GetSpins().Count(s => s.IsWinning) + (IsWinning ? 1 : 0);
Copy link
Contributor

Choose a reason for hiding this comment

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

Nice work on this

{
[Fact] //BONUS: Refactor into a Theory that tests both a winning and losing spin
public void SpinService_CalculateAvgWins_WinningSpin()
[Theory] //BONUS: Refactor into a Theory that tests both a winning and losing spin
Copy link
Contributor

Choose a reason for hiding this comment

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

Good work refactoring the Test to consider both cases

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