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
{{ message }}
Repository navigation
Commit 66e368e
Browse filesBrowse the repository at this point in the historyBrowse files
DateOnly and TimeOnly: retarget net10.0, add conversion samples and tests (#2152)
Retarget both projects from net6.0 to net10.0 and bring the test packages
up to the versions a net10.0 test project needs (Microsoft.NET.Test.Sdk
18.9.0, xunit 2.9.3, xunit.runner.visualstudio 4.0.0, coverlet.collector
10.0.1).
Add DemonstrateConversions() covering the DateOnly-to-DateTime direction
the sample did not have: ToDateTime(TimeOnly), ToDateTime(TimeOnly.MinValue),
ToDateTime(TimeOnly, DateTimeKind), FromDateTime(DateTime.Now) on both
types, TimeOnly.FromTimeSpan/ToTimeSpan, DayNumber/FromDayNumber,
ParseExact with a fixed format, and AddHours(double, out int).
Set CurrentCulture to en-US in Main so the printed output is the same on
every machine instead of depending on the host culture.
Eleven new xUnit facts cover the additions. The DateTime.Now facts assert
round-trip consistency rather than an exact value, because the suite runs
at an arbitrary instant.
Copy file name to clipboardExpand all lines: dotnet-datetime/DateOnlyAndTimeOnlyInCSharp/DateOnlyAndTimeOnlyInCSharpExample/DateOnlyAndTimeOnlyInCSharpExample.csproj
0 commit comments