wonderbirds-katas / AdventOfCode2022

Solutions for the Advent of Code '22 puzzles
The Unlicense
0 stars 0 forks source link

Wich way of testing the Rock, Paper, Scissors game logic do you prefer? #1

Open wonderbird opened 1 year ago

wonderbird commented 1 year ago

Hi all,

Your opinion is asked: Which way of testing the logic of a game do you prefer and why?

Left / Right or something different? https://github.com/wonderbirds-katas/AdventOfCode2022/commit/3825f55c6a29521851904688d50b584cd465acba

Background: The second puzzle of the advent of code '22 is about playing Rock, Paper Scissors with special rules for counting points. I want to test the counting logic. More details about the task: https://adventofcode.com/2022/day/2

I am looking forward to reading your answers :-) Have a nice day!

BadWinniePooh commented 1 year ago

I personally like the left one more, even so the names are very long (linebreaks would help possibly). Regarding the enums in the test, why don't you use ones that you use in the business logic and the tests?

wonderbird commented 1 year ago

I deliberately re-specified the values in the tests, because they are the most important part of the business expectations. If I'd use the constants from the implementation I would not detect whether someone accidentially introduced errors.