moq.analyzers
moq.analyzers copied to clipboard
Epic 1: InSequence/MockSequence Coordination Validation
trafficstars
Parent Issue
This issue is part of the gap analysis from #614 - Complete Sequence Patterns Analyzer Implementation.
User Story
As a developer using MockSequence with InSequence, I want analyzer validation to ensure proper sequence coordination, so that my sequential mock setups behave predictably.
INVEST Analysis
- Independent: Can be developed separately from other sequence validations
- Negotiable: Implementation approach (cross-statement vs single-call analysis) is flexible
- Valuable: Prevents common MockSequence misuse patterns that cause test failures
- Estimable: Moderate complexity - requires cross-statement analysis infrastructure
- Small: Can be broken into sub-tasks (detection, validation, diagnostics)
- Testable: Clear success criteria with concrete code examples
Acceptance Criteria
- [ ] Analyzer detects MockSequence instantiation patterns
- [ ] Validates that InSequence() calls reference the same MockSequence instance
- [ ] Ensures proper ordering constraints are maintained
- [ ] Provides clear diagnostic messages for sequence coordination errors
- [ ] Handles both valid sequence patterns and common anti-patterns
Technical Requirements
- Extend MoqKnownSymbols for MockSequence and InSequence symbols
- Develop cross-statement analysis capabilities
- Create sequence relationship tracking utilities
- Implement coordination validation analyzer
Definition of Done
- All acceptance criteria completed
- Comprehensive test coverage for coordination patterns
- Clear diagnostic messages implemented
- Compatible with Moq versions 4.8.2 and 4.18.4+
- Performance impact measured and acceptable
References
- Parent Issue: #614
- Original Request: #576
- Foundation PR: #581