public void DateExtension_CurrentTimeZone_ReturnsTimeZoneByCode() { var timeZone = TimeZoneInfo.GetSystemTimeZones().First(); MainApplicationContext.Current.TimeZone = timeZone; Assert.Equal(timeZone, DateExtension.CurrentTimeZone()); }
public void DateExtension_CurrentTimeZone_ReturnsContextTimeZone() { MainApplicationContext.Current.TimeZone = TimeZoneInfo.Utc; Assert.Equal(TimeZoneInfo.Utc, DateExtension.CurrentTimeZone()); }
public void DateExtension_CurrentTimeZone_ReturnsTimeZoneByCode() { MainApplicationContext.Current.TimeZoneId = "Central Standard Time"; MainApplicationContext.Current.TimeZone = null; Assert.AreEqual(TimeZoneInfo.FindSystemTimeZoneById("Central Standard Time"), DateExtension.CurrentTimeZone()); }
public void DateExtension_CurrentTimeZone_ReturnsLocalIfNoneSpecified() { MainApplicationContext.Current.TimeZone = null; Assert.Equal(TimeZoneInfo.Local, DateExtension.CurrentTimeZone()); }
public void DateExtension_CurrentTimeZone_ReturnsContextTimeZone() { MainApplicationContext.Current.TimeZoneId = "something that will be disregarded"; MainApplicationContext.Current.TimeZone = TimeZoneInfo.Utc; Assert.AreEqual(TimeZoneInfo.Utc, DateExtension.CurrentTimeZone()); }