Bug fixing and making test project compatible#2459
Open
emmche wants to merge 15 commits into
Open
Conversation
- Remove broken MetadataDirectories from CalcManager.Interop.vcxproj (CppWinRT NuGet handles metadata automatically) - Add AssetTargetFallback=native to Calculator.ViewModels and Calculator projects to fix NU1201 errors with native project references - Convert Calculator.Tests from net8.0 SDK-style to UWP test project: - Use SDKReference TestPlatform.Universal for protocol-matched testhost - Add Package.appxmanifest, UnitTestApp.xaml/.cs, and Assets - Keep MSTest NuGet packages for test attributes/adapter - Update Calculator.sln platform mappings for Calculator.Tests Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Port the C++ GetTokenToReadableNameMap logic to C# LocalizationSettings.
Maps engine display tokens (e.g. 'sqr(', '-') to narrator-friendly
names (e.g. 'square (', 'Minus (') for the expression automation name.
This fixes UI test failures where tests expected readable names like
'square (9)' and '4 Minus (' but got raw engine strings 'sqr(9)' and '4 -'.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
The CurrencyHttpClient was hitting dead Microsoft fwlink URLs that now redirect to Bing HTML pages instead of returning JSON currency data. The upstream C++ code uses hardcoded mock data (fictional currencies) since the real currency service is internal to Microsoft. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Refactor GetTokenToReadableNameMap to use simple helper methods instead of ValueTuple arrays to avoid potential .NET Native AOT compilation issues in Release builds. Add double-checked locking pattern to prevent race conditions during lazy initialization. Wrap initialization in try-catch to prevent app crash if resources are unavailable. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
The previous commit removed the Windows.Web.Http.HttpClient static field, which caused the app to crash on startup when compiled with .NET Native AOT (Release mode). This retains the HttpClient field for assembly reference stability while still returning mock currency data (matching C++ behavior). Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
- Fix same-currency conversion returning wrong values by wiring GetOrderedUnits/LoadOrderedRatios delegation to CurrencyDataLoader - Always call SetCurrentUnitTypes in OnUnitChanged (matching C++) - Add ResetCategoriesAndRatios + Calculate in OnCurrencyDataLoadFinished - Implement ConvertToLocalizedString with CurrencyFormatter to pad decimal places (e.g. '20.' displays as '20.00') - Implement UpdateInputBlocked to limit decimal digit entry - Add input blocking check in OnButtonPressed - Implement UpdateIsDecimalEnabled based on FractionDigits - Add UpdateCurrencyFormatter call in OnUnitChanged - Add value1cp switching in OnSwitchActive Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
- Build unit display name as 'CountryName - CurrencyName' matching C++ - Build accessible name as 'CountryName CurrencyName' matching C++ - Add TruncateFractionDigits to truncate (not round) decimal digits - Call OnPaste with truncated value in UpdateCurrencyFormatter when switching currencies (matching C++ behavior) Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Replace nuget restore with msbuild -t:Restore to properly handle mixed native C++ and managed C# project references without needing AssetTargetFallback or SkipGetTargetFrameworkProperties workarounds. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…perties NuGet restore fails with NU1201 when a managed UAP project references a native vcxproj. Two properties are needed: - AssetTargetFallback=native: tells NuGet to accept 'native' as a compatible framework for UAP projects - SkipGetTargetFrameworkProperties=true: prevents MSBuild from querying native projects for their target framework during restore Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
edwcry
approved these changes
May 14, 2026
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.
Fixes
Description of the changes:
Currency conversion & formatting (UnitConverterViewModel.cs, CurrencyHttpClient.cs, UnitConverterDataLoader.cs):
Programmer mode paste error (StandardCalculatorViewModel.cs):
CCalcEngine::DisplayError(CALC_E_DOMAIN))
Accessibility (StandardCalculatorViewModel.cs, LocalizationSettings.cs):
Build & CI (.github/workflows/action-ci.yml, Calculator.Tests.csproj, Calculator.sln):
UI test updates (UnitConverterPage.cs):
How changes were validated:
Before


After