public void UserIsUtc_ArgIsUtc_ResultIsUtc() { Thread.CurrentThread.CurrentCulture = TestCulture1; DateTime source = new DateTime(2013, 1, 29, 13, 28, 21, 1, DateTimeKind.Utc); TimeZoneInfo tz = null; string expected = "<time datetime=\"2013-01-29T13:28:21.0010000Z\" title=\"29 January 2013\" class=\"past not-today display-date\">29 January 2013</time>"; var html = CreateHtmlHelper(new ViewDataDictionary()); html.SetTimezone(tz); var result = SrkHtmlExtensions.DisplayDate(html, source); Assert.AreEqual(expected, result.ToString()); }
public void UserIsRomance_ArgIsUtc_ResultIsRomance() { Thread.CurrentThread.CurrentCulture = TestCulture1; TimeZoneInfo tz = TimeZoneInfo.FindSystemTimeZoneById("Romance Standard Time"); DateTime source = new DateTime(2013, 1, 29, 13, 28, 21, 1, DateTimeKind.Utc); DateTime romance = tz.ConvertFromUtc(source); string expected = "<time datetime=\"2013-01-29T" + source.Hour + ":28:21.0010000Z\" title=\"29 January 2013\" class=\"past not-today display-date\">29 January 2013</time>"; var html = CreateHtmlHelper(new ViewDataDictionary()); html.SetTimezone(tz); var result = SrkHtmlExtensions.DisplayDate(html, source); Assert.AreEqual(expected, result.ToString()); }