public void ShouldFindIana(string ianaId)
        {
            var tzInfo = TimeZoneMapping.Get(ianaId);

            tzInfo.Should().NotBeNull();
            tzInfo.Id.Should().Be(ianaId);
        }
        public void ShouldFindWindowsFromIana(string ianaId, string expectedWindowsId)
        {
            var tzInfo = TimeZoneMapping.Get(ianaId);

            tzInfo.Should().NotBeNull();
            tzInfo.Id.Should().Be(expectedWindowsId);
        }
Пример #3
0
        public void ShouldFindIana(string ianaId, string expectedValue = null)
        {
            var tzInfo    = TimeZoneMapping.Get(ianaId);
            var testValue = expectedValue ?? ianaId;

            tzInfo.Should().NotBeNull();
            tzInfo.Id.Should().Be(testValue);
        }
        public void ShouldThrowExceptionWhenNonExistent(string culture)
        {
            var exc = Record.Exception(() =>
                                       ExecuteWithCulture(culture, () => TimeZoneMapping.Get("Some non-existent time zone id")));

            // System.TimeZoneNotFoundException is not public in .net standard 1.3
            exc.Should().NotBeNull();
            exc.GetType().Name.Should().Be("TimeZoneNotFoundException");
        }
        public void ShouldFindIanaFromWindows(string windowsId, string cultureName, string ianaId)
        {
            ExecuteWithCulture(cultureName, () =>
            {
                var tzInfo = TimeZoneMapping.Get(windowsId);

                tzInfo.Should().NotBeNull();
                tzInfo.Id.Should().Be(ianaId);
            });
        }
Пример #6
0
 public static TimeZoneInfo GetTimeZoneInfo(string zoneId)
 {
     return(TimeZoneMapping.Get(zoneId));
 }