예제 #1
0
        public void TestConvertUtcToUk()
        {
            System.DateTime utcNow = System.DateTime.UtcNow;

            IDateTimeProvider dateTimeProvider = new DateTimeProvider();

            System.DateTime dateTest = dateTimeProvider.ConvertUtcToUk(utcNow);

            // https://stackoverflow.com/questions/4034923/how-to-represent-the-current-uk-time
            TimeZoneInfo britishZone = TimeZoneInfo.FindSystemTimeZoneById("GMT Standard Time");

            System.DateTime dateBaseline = TimeZoneInfo.ConvertTime(utcNow, TimeZoneInfo.Utc, britishZone);

            dateTest.Should().Be(dateBaseline);
        }