Skip to content

Replace direct comparisons with TargetMatcher and SourceMatcher#483

Open
konard wants to merge 3 commits into
mainfrom
issue-153-a5aacf2d
Open

Replace direct comparisons with TargetMatcher and SourceMatcher#483
konard wants to merge 3 commits into
mainfrom
issue-153-a5aacf2d

Conversation

@konard

@konard konard commented Sep 14, 2025

Copy link
Copy Markdown
Member

Summary

This PR addresses issue #153 by replacing direct GetTarget and GetSource comparisons with the appropriate criterion matchers (TargetMatcher and SourceMatcher).

Changes Made

Created SourceMatcher class

  • Added SourceMatcher<TLinkAddress> following the same pattern as TargetMatcher
  • Implements ICriterionMatcher<TLinkAddress> interface
  • Provides efficient source matching functionality

Updated ILinksExtensions methods

  • Modified CountUsages method to use SourceMatcher and TargetMatcher instead of direct comparisons
  • Updated Equals method to use criterion matchers for source and target validation
  • Added proper using statement for Platform.Data.Doublets.CriterionMatchers

Comprehensive test coverage

  • Added CriterionMatchersTests with full test suite
  • Tests for both TargetMatcher and SourceMatcher functionality
  • Integration tests for updated CountUsages and Equals methods
  • All tests pass successfully

Test Results

Test Run Successful.
Total tests: 25 (including 4 new tests)
     Passed: 24
     Skipped: 1

Technical Details

  • The solution maintains backward compatibility while improving code organization
  • Uses the established criterion matcher pattern for consistency
  • Follows existing code conventions and documentation style
  • No breaking changes to public APIs

Resolves

Fixes #153

🤖 Generated with Claude Code

Co-Authored-By: Claude noreply@anthropic.com

Adding CLAUDE.md with task information for AI processing.
This file will be removed when the task is complete.

Issue: #153
@konard konard self-assigned this Sep 14, 2025
- Create SourceMatcher class following the same pattern as TargetMatcher
- Update CountUsages method to use SourceMatcher and TargetMatcher instead of direct comparisons
- Update Equals method to use criterion matchers for source and target matching
- Add comprehensive tests for both matchers and updated functionality

This addresses issue #153 by using TargetMatcher (and newly created SourceMatcher)
instead of direct GetTarget/GetSource comparisons in critical methods.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
@konard konard changed the title [WIP] TargetMatcher should be used here instead Replace direct comparisons with TargetMatcher and SourceMatcher Sep 14, 2025
@konard konard marked this pull request as ready for review September 14, 2025 01:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

TargetMatcher should be used here instead

1 participant