Add missing converter tests and fix ConvertBack for non-invertible operations#227
Closed
Add missing converter tests and fix ConvertBack for non-invertible operations#227
Conversation
Co-authored-by: Infarh <595602+Infarh@users.noreply.github.com>
…ase class NotSupportedException Co-authored-by: Infarh <595602+Infarh@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Document converters and fix ConvertBack implementations
Add missing converter tests and fix ConvertBack for non-invertible operations
Dec 13, 2025
Infarh
approved these changes
Dec 14, 2025
16 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The converter test suite was incomplete (only 4 of 27 converters had tests), and non-invertible converters incorrectly returned unchanged values instead of throwing exceptions.
Changes
Test Coverage
Added 24 missing test files covering all converter categories:
Each test file validates:
ConvertBack Fixes
Removed incorrect
ConvertBackoverrides from 10 converters that were simply returning input unchanged:Affected converters: Sin, Cos, Tan, Ctg, Abs, Sign, Round, RoundAdaptive, Truncate, Trunc
These now correctly inherit the base
DoubleValueConverter.ConvertBackimplementation which throwsNotSupportedExceptionwith message "Обратное преобразование не поддерживается".Note: The dB converter retains its bidirectional implementation as it supports mathematically valid inverse operations (dB ↔ linear).
Original prompt
📊 Audit Report: Current State of Converters Work
🎯 Executive Summary
This report documents the actual current state of the converters audit and improvement work in branch
copilot/audit-improve-converters-files.✅ What Was Actually Completed
1. Documentation Added
<summary>tags<remarks>2. ConvertBack Fixes
The following converters now have proper ConvertBack implementations:
NotSupportedException✅NotSupportedException✅NotSupportedException✅3. Existing Tests (4 files only)
Located in
Tests\MathCore.WPF.Tests\Converters\:AbsTests.cs- Basic tests for Abs converterMapperTests.cs- Tests for Mapper converterRoundTests.cs- Tests for Round converterSinTests.cs- Tests for Sin converter4. Issues Created
❌ What Was NOT Completed
Missing Test Files (~23 files)
Phase 1 - Math Converters (9 missing):
CosTests.csTanTests.csCtgTests.csSignTests.csSignValueTests.csTruncateTests.csTruncTests.csRoundAdaptiveTests.csModTests.csPhase 1 - Invertible Converters (2 missing):
InverseTests.csdBTests.csPhase 1 - Logical Converters (2 missing):
NotTests.csIsNullTests.csPhase 2.1 - Logical Checks (5 missing):
AndTests.csOrTests.csIsNaNTests.csIsPositiveTests.csIsNegativeTests.csPhase 2.2 - Comparison Converters (6 missing):
GreaterThanTests.csGreaterThanOrEqualTests.csLessThanTests.csLessThanOrEqualTests.csInRangeTests.csOutRangeTests.csTotal Missing: 24 test files
Missing Commits
Missing ConvertBack Fixes
Many converters still need ConvertBack implementation:
📈 Progress Metrics
🔍 Verification Commands
To verify current state:
🎯 Root Cause Analysis
Why Work Was Not Completed:
What Went Wrong:
🚀 Recommended Actions
Immediate (Next 1 hour):
Short Term (Next 1-2 days):
📁 Create all 24 missing test files
✅ Run tests and verify
dotnet test --no-build📦 Create commits for each phase
Medium Term (Next week):
💡 Lessons Learned
For Future Work:
Verify File Creation: Always check that files exist before proceeding
Incremental Commits: Commit after creating each batch of files
Clear Expectations: AI cannot directly create files - user must:
*...
Issue created by Visual Studio Copilot
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.