Skip to content

UnitAbbreviationsCache: GetDefaultAbbreviation should throw when no abbreviations are mapped #1539

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 11, 2025

Conversation

lipchev
Copy link
Collaborator

@lipchev lipchev commented Apr 11, 2025

fixes the first part of #1509

  • UnitAbbreviationsCache: GetDefaultAbbreviation should throw when no abbreviations are mapped
  • Volume: added the missing abbreviation mappings

… abbreviations are mapped

- Volume: added the missing abbreviation mappings
@lipchev
Copy link
Collaborator Author

lipchev commented Apr 11, 2025

This is missing a test for the unhappy path:

        [Fact]
        public void GetDefaultAbbreviation_ForUnitWithoutAbbreviations_ThrowsInvalidOperationException()
        {
            Assert.Throws<InvalidOperationException>(() => new UnitAbbreviationsCache([HowMuch.Info]).GetDefaultAbbreviation(HowMuchUnit.AShitTon));
        }

But this doesn't work just yet.. I'll add it later, probably after the little refactoring I got planned for the the UnitAbbreviationsCacheTests.

@angularsen angularsen merged commit c02b189 into angularsen:master Apr 11, 2025
1 check passed
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.

None yet

2 participants