Skip to content

Refactor PlayerServiceTests to reduce setup code duplication #190

Closed
@coderabbitai

Description

@coderabbitai

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

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions