Skip to content
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

Headings cannot be parsed from localized abbreviations #1103

Closed
hangy opened this issue Jul 3, 2021 · 0 comments · Fixed by #1117
Closed

Headings cannot be parsed from localized abbreviations #1103

hangy opened this issue Jul 3, 2021 · 0 comments · Fixed by #1117

Comments

@hangy
Copy link
Contributor

hangy commented Jul 3, 2021

[Fact]
[UseCulture("da")]
public void CanParseLocalizedAbbreviation()
{
    const double heading = 22.5;
    var abbreviation = heading.ToHeading();

    var actual = abbreviation.FromAbbreviatedHeading();

    Assert.Equal(heading, actual);
}

This test fails as of 5c3b134, because FromAbbreviatedHeading only ever looks up the abbreviated heading in the English base array:

var index = Array.IndexOf(headings, heading.ToUpperInvariant());
The translated value "NNØ" is not used. The test works well for the en locale.

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 a pull request may close this issue.

1 participant