DEV Community

Discussion on: Code Smell 82 - Tests Violating Encapsulation

Collapse
yoursunny profile image
Junxiao Shi

Is it Hangman (implementation) or Hagnman (in test case)?

Collapse
mcsee profile image
Maxi Contieri Author • Edited

i don't undestand the question.

Test creates a new hangman game

´´´
$hangmanGame = new Hangman
´´´

Collapse
yoursunny profile image
Junxiao Shi

Test creates an instance of Hagnman, not Hangman.

 $hangmanGame = new Hagnman(new MockRandomizer());
Enter fullscreen mode Exit fullscreen mode
Thread Thread
mcsee profile image
Maxi Contieri Author

corrected ! thank you very much!