refactoring-code_smells-design_patterns icon indicating copy to clipboard operation
refactoring-code_smells-design_patterns copied to clipboard

Code Smells in BookingShould Duplicate Code

Open Mykyta-Panchenko opened this issue 8 months ago • 0 comments

Problem: Each test method repeats the same object instantiation for the Booking class. This makes it harder to maintain and increases the chances of errors when updating the test data.

Fix: Extract the Booking creation logic into a separate private method. Allow passing custom dates to make tests more readable.

Mykyta-Panchenko avatar Feb 07 '25 10:02 Mykyta-Panchenko