public void WorksWhenSetInHttpContext2() { var data = new ViewDataDictionary(); var tzName = "Russia Time Zone 3"; var tz = TimeZoneInfo.FindSystemTimeZoneById(tzName); var html = CreateHtmlHelper(data); html.ViewContext.HttpContext.SetTimezone(tz); var result = SrkHtmlExtensions.GetTimezone(html); Assert.IsNotNull(result); Assert.AreEqual(tz, result); }
public void GetterWorks2() { var data = new ViewDataDictionary(); var tzName = "Russia Time Zone 3"; var tz = TimeZoneInfo.FindSystemTimeZoneById(tzName); var html = CreateHtmlHelper(data); SrkHtmlExtensions.SetTimezone(html, tzName); var result = SrkHtmlExtensions.GetTimezone(html); Assert.IsNotNull(result); Assert.AreEqual(tz, result); }