Skip to content

Instantly share code, notes, and snippets.

@selcukusta
Created December 20, 2017 13:35
Show Gist options
  • Select an option

  • Save selcukusta/961175785928e1e744909e35f7f77746 to your computer and use it in GitHub Desktop.

Select an option

Save selcukusta/961175785928e1e744909e35f7f77746 to your computer and use it in GitHub Desktop.
[Theory, InlineData(new object[] { "de-DE", "2017.12.19", "19 Dezember 2017" })]
public void ToPrettyDate_ShouldAssertTrue_WhenCultureIsGerman(string cultureCode, string textDate, string expected)
{
var culture = CultureInfo.CreateSpecificCulture(cultureCode);
var date = DateTime.ParseExact(textDate, "yyyy.MM.dd", culture);
var actual = date.ToPrettyDate(culture);
Assert.Equal(expected, actual);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment