You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi! Thank you for providing this awesome implementation!
There seems to be a datetime related issue if I run for example the unit test EncodeDecode_WrongPublicKey which throws the error
System.FormatException: The UTC representation of the date '0001-01-01' falls outside the year range 1-9999.
...
Explicitly adding datetime values for SampleTakenDate and VaccinationDate in CreateCWTTestData() seems to fix that:
var d = new DateTime(DateTime.UtcNow.Year, DateTime.UtcNow.Month, DateTime.UtcNow.Day, DateTime.UtcNow.Hour, DateTime.UtcNow.Minute, DateTime.UtcNow.Second, DateTimeKind.Unspecified);
var o = new DateTimeOffset(d, TimeSpan.FromHours(0));
var tests = new List<TestEntry>
{
new()
{
CountryOfTest = "IS",
NAATTestName = "PCR Covid-19",
SampleTakenDate = o
}
};
var d1 = new DateTime(DateTime.UtcNow.Year, DateTime.UtcNow.Month, DateTime.UtcNow.Day, 0,0,0, DateTimeKind.Unspecified);
var o1 = new DateTimeOffset(d1, TimeSpan.FromHours(0));
var vacs = new List<VaccinationEntry>
{
new()
{
Issuer = "Test Issuer",
VaccinationDate = o1
}
};
But afterwards the JToken.DeepEquals fails because of differences regarding timezones of the property VaccinationDate. See the following json serializations:
Hi! Thank you for providing this awesome implementation!
There seems to be a datetime related issue if I run for example the unit test
EncodeDecode_WrongPublicKey
which throws the errorExplicitly adding datetime values for
SampleTakenDate
andVaccinationDate
inCreateCWTTestData()
seems to fix that:But afterwards the
JToken.DeepEquals
fails because of differences regarding timezones of the propertyVaccinationDate
. See the following json serializations:cwtToTest.DGCv1
:cwt.DGCv1
:Or is there something I am missing which I have to configure accordingly? My PCs timezone:
UTC +2 CEST Central European Summer Time Berlin
The text was updated successfully, but these errors were encountered: