softwareconstruction240 / chess

Chess project for BYU CS 240
2 stars 4 forks source link

fix() chess moves tests #1

Closed kyfex-uwu closed 10 months ago

kyfex-uwu commented 10 months ago

The previous Assertions.assertEquals required the order of the moves to be the same, not just that validMoves and pieceMoves contained all the same moves. This helper method changes that

The error message sent to the user should be similar, since it uses the same AssertionError as the previous code.

frozenfrank commented 10 months ago

Good job submitting a pull request!

This issue has already been addressed in the repo. See commit c74ccde.

If you will, here is some feedback for you. While you did correctly implement a solution to the problem, the problem is better handled by converting the generic Collection into a Set. Set equality is defined has having exactly the same items without respecting their order. Leveraging the built-in features of the language and it's data structures renders a cleaner final solution.

kyfex-uwu commented 10 months ago

Ahh, thanks! I talked to some TAs about this problem after I made this request, and they helped me see that solution as well. While I knew I needed set equality, I didn't realize there was an easier way to do it 😅

leesjensen commented 10 months ago

I believe this has already been resolved.