Example #1
0
        public void GetRegionTimeZonesTest()
        {
            var timezones = TimeZone.GetTimeZones(USystemTimeZoneType.Any, "PL");

            Assert.AreEqual(2, timezones.Count());
            Assert.AreEqual(1, timezones.Count(tz => tz.Id == "Poland"));
            Assert.AreEqual(1, timezones.Count(tz => tz.Id == "Europe/Warsaw"));
        }
Example #2
0
        public void GetOffsetTimeZonesTest()
        {
            var timezones = TimeZone.GetTimeZones(USystemTimeZoneType.Any, null, -1 * 3600 * 1000);

            Assert.GreaterOrEqual(timezones.Count(), 4);
            Assert.AreEqual(1, timezones.Count(tz => tz.Id == "Atlantic/Azores"));
            Assert.AreEqual(1, timezones.Count(tz => tz.Id == "America/Scoresbysund"));
            Assert.AreEqual(1, timezones.Count(tz => tz.Id == "Atlantic/Cape_Verde"));
            Assert.AreEqual(1, timezones.Count(tz => tz.Id == "Etc/GMT+1"));
        }
Example #3
0
        public void GetTimeZonesTest()
        {
            var timezones = TimeZone.GetTimeZones();

            Assert.GreaterOrEqual(timezones.Count(), 400);
            Assert.AreEqual(1, timezones.Count(tz => tz.Id == "Asia/Seoul"));
            Assert.AreEqual(1, timezones.Count(tz => tz.Id == "Europe/London"));
            Assert.AreEqual(1, timezones.Count(tz => tz.Id == "Etc/GMT-10"));
            Assert.AreEqual(1, timezones.Count(tz => tz.Id == "Etc/GMT+3"));
            Assert.AreEqual(1, timezones.Count(tz => tz.Id == "Etc/UTC"));
        }