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

IANA TZs should resolve in a case-insensitive way #7

Open
sandrock opened this issue Apr 22, 2016 · 1 comment
Open

IANA TZs should resolve in a case-insensitive way #7

sandrock opened this issue Apr 22, 2016 · 1 comment

Comments

@sandrock
Copy link

Hi. I found this promising project 15 minutes ago. I think a found a bug.

I think the library should resolve IANA time zones in a case insensitive way. The following unit tests show the problem.

[TestMethod]
public void TZDB_GetTimeZoneWithIanaId_EuropeParis_WrongCase_ShouldResolve()
{
    string input = "europe/paris";
    var result = TZDB.DB.GetTimeZoneWithIanaId(input);
    Assert.IsNotNull(result);
    Assert.AreEqual("Romance Standard Time", result.MicrosoftId);

    // FAILED
    // threw exception:
    // System.Collections.Generic.KeyNotFoundException:
    // The given key was not present in the dictionary.
}

[TestMethod]
public void TZDB_GetTimeZoneWithIanaId_EuropeParis_ShouldResolve()
{
    string input = "Europe/Paris";
    var result = TZDB.DB.GetTimeZoneWithIanaId(input);
    Assert.IsNotNull(result);
    Assert.AreEqual("Romance Standard Time", result.MicrosoftId);
    // PASS
}

Am I wrong?

@chrisdostert
Copy link
Owner

hmm. this is a tricky one. If we are taking the lead of for example, java 8, the current behavior of being case sensitive is consistent with that implementation.

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

No branches or pull requests

2 participants