emilybache / Tennis-Refactoring-Kata

This is a Refactoring Kata based on the rules of Tennis
https://youtu.be/XifUs1FhWRc
MIT License
737 stars 1.27k forks source link

remove hard-coding of "player1" and "player2" to make the Scala code correct before starting refactoring #110

Closed ivanmoore closed 1 year ago

ivanmoore commented 1 year ago

This is for the Scala code only.

The three TennisGame implementations use hardcoded Strings "player1" and "player2" to check which player is playing. This means that those classes only give the correct results if the player names happen to be "player1" and "player2" - which they are in the tests but I believe it is not the intention that only those names should give the correct results.

This change is to make those implementations use the player names which the TennisGame was created with, so they work correctly with any player names.

The test has been updated to introduce randomness in the player names in order to show that the scoring works correctly regardless of the names. The randomness does not introduce any non-determinism.

emilybache commented 1 year ago

Again, same comment. Thanks but no thanks.