private void verifyTz(string name, params string[] dntzIds)
        {
            HTimeZone tz = HTimeZone.make(name, false);

            // Ignore issues with locally installed timezones.
            if (tz == null)
            {
                return;
            }
            TimeZoneInfo dntz = tz.dntz;

            Assert.AreEqual(tz.ToString(), name);
            Assert.IsTrue(dntzIds.Contains(dntz.Id), $"{dntz.Id} not in [{string.Join(", ", dntzIds)}]");
            // TODO: What is this testing? Move into another test?
            //TimeZoneInfo dntzByID = TimeZoneConverter.TZConvert.GetTimeZoneInfo(dntz.Id);
            //Assert.IsTrue(tz.hequals(HTimeZone.make(dntzByID, false)), $"{tz} does not equal {dntzByID}");
        }
示例#2
0
        private void verifyTz(string name, string dntzId)
        {
            HTimeZone tz = HTimeZone.make(name, false);

            // Ignore issues with locally installed timezones.
            if (tz == null)
            {
                return;
            }
            TimeZoneInfo dntz = tz.dntz;

            Assert.AreEqual(tz.ToString(), name);
            Assert.AreEqual(dntz.Id, dntzId);
            try
            {
                TimeZoneInfo dntzByID = TimeZoneInfo.FindSystemTimeZoneById(dntzId);
                Assert.IsTrue(tz.hequals(HTimeZone.make(dntzByID, false)));
            }
            catch (Exception)
            {
                Assert.Fail();
            }
        }