Beispiel #1
0
        public async Task ResolveIanaTimeZone()
        {
            Assert.Throws <TimeZoneNotFoundException>(() => TimeZoneInfo.FindSystemTimeZoneById("Canada/Saskatchewan"));

            var plugin = new TimeZoneConverterPlugin();
            await plugin.Initialize("", null);

            Assert.That(TimeZoneUtil.FindTimeZoneById("Canada/Saskatchewan"), Is.Not.Null);

            TimeZoneUtil.CustomResolver = id => null;
        }
Beispiel #2
0
        public async Task ResolveIanaTimeZone()
        {
            Assert.Throws <TimeZoneNotFoundException>(() => TimeZoneUtil.FindTimeZoneById("Canada/Saskatchewan"));

            var plugin = new TimeZoneConverterPlugin();
            await plugin.Start();

            Assert.That(TimeZoneUtil.FindTimeZoneById("Canada/Saskatchewan"), Is.Not.Null);

            await plugin.Shutdown();

            Assert.Throws <TimeZoneNotFoundException>(() => TimeZoneUtil.FindTimeZoneById("Canada/Saskatchewan"));
        }