Skip to content
This repository has been archived by the owner on Jan 24, 2021. It is now read-only.

Commit

Permalink
Fixed cookies test that was failing because of localization issues
Browse files Browse the repository at this point in the history
  • Loading branch information
thecodejunkie committed Mar 3, 2011
1 parent b0c0724 commit d6cd496
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/Nancy.Tests/Unit/NancyCookieFixture.cs
Original file line number Diff line number Diff line change
Expand Up @@ -86,8 +86,8 @@ public void Should_stringify_everyting()
{
// Given
var date = new DateTime(2016, 11, 8, 9, 10, 11, DateTimeKind.Utc);
var tuesday = GetLocalizedAbbreviatedWeekdayName(date);
var november = GetLocalizedAbbreviatedMonthName(date);
var tuesday = GetInvariantAbbreviatedWeekdayName(date);
var november = GetInvariantAbbreviatedMonthName(date);
var cookie = new NancyCookie("paul", "blind") { Expires = date, Path = "/frank", Domain = "gmail.com" };

// When
Expand All @@ -97,14 +97,14 @@ public void Should_stringify_everyting()
stringified.ShouldEqual(string.Format("paul=blind; path=/frank; expires={0}, 08-{1}-2016 09:10:11 GMT; domain=gmail.com", tuesday, november));
}

public static string GetLocalizedAbbreviatedMonthName(DateTime dateTime)
public static string GetInvariantAbbreviatedMonthName(DateTime dateTime)
{
return CultureInfo.CurrentCulture.DateTimeFormat.AbbreviatedMonthNames[dateTime.Month - 1];
return CultureInfo.InvariantCulture.DateTimeFormat.AbbreviatedMonthNames[dateTime.Month - 1];
}

public static string GetLocalizedAbbreviatedWeekdayName(DateTime dateTime)
public static string GetInvariantAbbreviatedWeekdayName(DateTime dateTime)
{
return CultureInfo.CurrentCulture.DateTimeFormat.AbbreviatedDayNames[(int)dateTime.DayOfWeek];
return CultureInfo.InvariantCulture.DateTimeFormat.AbbreviatedDayNames[(int)dateTime.DayOfWeek];
}

}
Expand Down

0 comments on commit d6cd496

Please sign in to comment.