dinosaur-exploder icon indicating copy to clipboard operation
dinosaur-exploder copied to clipboard

[Feature]: add tests

Open jvondermarck opened this issue 8 months ago • 4 comments

👉 Please confirm the following

🤔 Is your proposal related to a problem?

Anyone can implement a feature or fix a problem that could break the game logic.

😍 Describe the solution you'd like

I would like to add test for most of the files, obviously not everything but where you have some logic. Please have some experience with tests before working on this, you can create Mock classes, and so on. You're free to do anything you want, and even refactor some methods to make it easier to test the game. Please do some clean code.

👍️ Describe alternatives you've considered

Since it might take some time, maybe don't do everything, someone else could continue and finish the work.

✍ Additional context

No response

jvondermarck avatar Mar 30 '25 12:03 jvondermarck

I'd like to take this issue if that's okay 😀 @jvondermarck

dybyte avatar Apr 20 '25 00:04 dybyte

@dy102 Hello, awesome!! Good luck ! Remember : no need to test every single method, what's important is just to test the logic of the game ! 👌🏽

jvondermarck avatar Apr 21 '25 07:04 jvondermarck

@jvondermarck Hi! While writing tests for the core logic, I found some parts of the structure a bit tricky to test (e.g. tightly coupled methods or non-injected dependencies). Would it be okay if I propose some lightweight refactoring alongside the test additions to improve testability? Of course, I’ll keep the changes minimal and focused. Just wanted to check first!

dybyte avatar Apr 30 '25 02:04 dybyte

Hello @dy102, the answer is YES, refactor as much as you can the code, I mean, mainly the DinosaurController that is HUGE and mainly coupled, so that's a mess (the goal would be to split this code into some classes that will have only ONE responsibility). So yes, you can refactor whatever you want in the code, it will be easier for you to refactor ! :) Thanks so much !! :)

jvondermarck avatar Apr 30 '25 06:04 jvondermarck