Exemple #1
0
        public void For_Id_FixedOffset_NonCanonicalId()
        {
            string       id   = "UTC+05:00:00";
            DateTimeZone zone = FixedDateTimeZone.GetFixedZoneOrNull(id) !;

            Assert.AreEqual(zone, DateTimeZone.ForOffset(Offset.FromHours(5)));
            Assert.AreEqual("UTC+05", zone.Id);
        }
Exemple #2
0
        public void For_Id_FixedOffset()
        {
            string       id   = "UTC+05:30";
            DateTimeZone zone = FixedDateTimeZone.GetFixedZoneOrNull(id) !;

            Assert.AreEqual(DateTimeZone.ForOffset(Offset.FromHoursAndMinutes(5, 30)), zone);
            Assert.AreEqual(id, zone.Id);
        }
Exemple #3
0
 public void For_Id_InvalidFixedOffset()
 {
     Assert.IsNull(FixedDateTimeZone.GetFixedZoneOrNull("UTC+5Months"));
 }