Closed
Description
Description
In the PlayerServiceTests.cs file, there's significant duplication in the test setup code. Multiple test methods repeatedly create repository, logger, and memory cache mocks with similar patterns.
Proposed Solution
Refactor the test class to include helper methods that centralize the creation of mocks and service instances.
This would simplify test methods by allowing them to use centralized setup rather than duplicating the mock creation code in each test method.
Benefits
- Reduced code duplication
- Improved test maintenance
- Easier to make changes to setup logic in the future
- Better adherence to DRY principles
References
- File: Dotnet.Samples.AspNetCore.WebApi.Tests/Unit/PlayerServiceTests.cs
- Identified in PR feat(data)!: implement Repository pattern #189
Metadata
Metadata
Assignees
Labels
No labels