public void TimeZoneGmtIsGmt() { var timezone = Right.AtGmt; var time = new Time (1409473135, TimeContext.Default); var gregorian = time.Projection<Gregorian> (timezone); Assert.AreEqual ("Etc/GMT", timezone.Name); Assert.AreEqual (TimeZoneInfo.Utc, timezone.ToTimeZoneInfo ()); Assert.AreEqual ("31.08.2014 08:18:55", gregorian.ToString ("dd.MM.yyyy hh:mm:ss")); }
public void TimeZoneAtOsloIsAtOslo() { var timezone = Right.At ("Europe/Oslo"); var time = new Time (1409473135, TimeContext.Default); var gregorian = time.Projection<Gregorian> (timezone); var zoneinfo = timezone.ToTimeZoneInfo (); TimeZoneInfo target; try { target = TimeZoneInfo.FindSystemTimeZoneById ("W. Europe Standard Time"); } catch { target = TimeZoneInfo.FindSystemTimeZoneById ("Europe/Oslo"); } Assert.AreEqual ("Europe/Oslo", timezone.Name); Assert.AreEqual (target, zoneinfo); Assert.AreEqual ("31.08.2014 10:18:55", gregorian.ToString ("dd.MM.yyyy hh:mm:ss")); }
public void GregorianPrintsNicely() { var time = new Time (205956690, TimeContext.Default); string result = time.Projection<Gregorian> ().ToString ("yyyy MM dd"); Assert.AreEqual ("1976 07 11", result.ToString ()); }
public void GregorianMonthIsRight() { var time = new Time (205956690, TimeContext.Default); Assert.AreEqual (Month.July, time.Projection<Gregorian> ().Month); }
public void GregorianMinuteIsRight() { var time = new Time (205956690, TimeContext.Default); Assert.AreEqual (11, time.Projection<Gregorian> ().Minute); }
public void GregorianHourIsRight() { var time = new Time (205956690, TimeContext.Default); Assert.AreEqual (18, time.Projection<Gregorian> ().Hour); }
public void GregorianDayOfWeekIsRight() { var time = new Time (205956690, TimeContext.Default); Assert.AreEqual (DayOfWeek.Sunday, time.Projection<Gregorian> ().DayOfWeek); }
public void GregorianSecondIsRight() { var time = new Time (205956690, TimeContext.Default); Assert.AreEqual (30, time.Projection<Gregorian> ().Second); }