Quantcast
Channel: ASPNETWebStack Issue Tracker Rss Feed
Viewing all articles
Browse latest Browse all 7215

Commented Issue: Test ConventionsHelpersTests.GetUriRepresentationForValue_Works fails in different time zones [866]

$
0
0
The test ConventionsHelpersTests.GetUriRepresentationForValue_Works verifies the DateTimeOffset representation using the value "datetimeoffset'1600-12-31T16:00:00-08:00'" which will only work if the test is run in the -8 time zone.

When I run the test ConventionsHelpers.GetUriRepresentationForValue returns "datetimeoffset'1601-01-01T01:00:00+01:00'". This is the same time, just in a different time zone.

In order to fix the test I changed the GetUriRepresentationForValue_DataSet entry to:
{ DateTimeOffset.FromFileTime(0).ToUniversalTime(), "datetimeoffset'1601-01-01T00:00:00Z'" },

This ensures that a universal time is represented correctly. Perhaps it would also be a good idea to test times in a specific time zone but then the DateTimeOffset.FromFileTime(0) should not be used for creating the offset value.

Comments: Added a patch file with my changes to fix this issue

Viewing all articles
Browse latest Browse all 7215

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>