Skip to content

Refactor duplicate player data definitions between PlayerData and PlayerFakes #210

Open
@coderabbitai

Description

@coderabbitai

Description

Code duplication was identified between src/Dotnet.Samples.AspNetCore.WebApi/Utilities/PlayerData.cs and test/Dotnet.Samples.AspNetCore.WebApi.Tests/Utilities/PlayerFakes.cs. Both files contain nearly identical player data definitions with only minor differences (like using fixed GUIDs versus generating new ones).

This duplication increases maintenance overhead and risk of inconsistencies when player data needs to be updated.

Proposed Solutions

Consider one of the following approaches:

  1. Extract a Shared Player Data Module: Consolidate the common player data definitions into a single shared module that both production and test utilities can reference.

  2. Reference the Existing Production Data: Update the test utilities to directly reference the production implementation, ensuring a single source of truth.

Context

This issue was identified during a code review of PR #208.

References

Metadata

Metadata

Assignees

No one assigned

    Labels

    .NETPull requests that update .NET codeenhancementNew feature or requestgood first issueGood for newcomers

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions