Skip to content

refactor: simplify test cases with proper AutoFixture and NSubstitute usage #180

@j-d-ha

Description

@j-d-ha

Description

Clean up and simplify test cases across the codebase to make better use of AutoFixture and NSubstitute with the [AutoNSubstituteData] attribute pattern.

Objectives

  • Consolidate test setup using [AutoNSubstituteData] where appropriate
  • Remove manual fixture and mock creation where AutoFixture can generate test data
  • Simplify test logic by leveraging NSubstitute integration
  • Reduce boilerplate and improve readability

Scope

  • Review existing test files across all unit test projects
  • Identify opportunities to simplify using the AutoNSubstituteData pattern
  • Update tests to follow the established patterns in CLAUDE.md

Notes

  • Refer to CLAUDE.md AutoNSubstituteData pattern documentation
  • Use [Frozen] attribute on mocks that need assertion verification
  • Use manual Fixture helper only when mocks need complex SetupDefaults() configuration

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions