Add quantity selection factories#1691
Conversation
Extracted from #1544 (#1544) because composing an isolated quantity catalog is useful for custom quantities without depending on QuantityValue. Moving this API out gives the catalog design focused review and reduces the feature PR's size and initialization surface. Changes: - Add QuantitiesSelector for appending external quantity definitions to a base catalog. - Add configured factory overloads for QuantityInfoLookup, UnitAbbreviationsCache, and UnitParser. - Allow parser factories to configure abbreviations before parser construction. - Add UnitsNetSetup.Create and a selection builder for isolated, consistently wired setups. - Keep UnitsNetSetup.Default behavior unchanged. Tests: - Add QuantitiesSelector coverage for base, chained additions, ordering, and null input. - Add cache factory coverage for default and custom base catalogs. - Add parser factory coverage for external quantities and custom abbreviations. - Add isolated setup coverage for component wiring, catalog selection, additions, and duplicate base selection. - Verify all affected tests on net10.0 and net48 (118 tests per target).
ReviewScope: purely additive (321 additions / 0 deletions), no changes to generated code or Breaking changesNone found. All changes are new members; Design concern:
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #1691 +/- ##
=======================================
Coverage 96% 96%
=======================================
Files 456 455 -1
Lines 30107 29540 -567
=======================================
- Hits 29043 28502 -541
+ Misses 1064 1038 -26
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Cover the setup and parser factory overloads missed by Codecov, and verify null argument contracts across the new public factory APIs.
Review: Add quantity selection factories (#1691)Scope: purely additive custom-code API (no changes to Breaking changesNone. All changes are new public members (new Potential bug:
|
Extracted from #1544 because composing an isolated quantity catalog is useful for custom quantities without depending on QuantityValue. Moving this API out gives the catalog design focused review and reduces the feature PR's size and initialization surface.
Changes:
Tests: