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
Describe the bug
After ensuring that an instance of Nullable<T> is not null via .HasValue, coverlet still assumes the instance to be nullable and therefore the branch coverage indicates a missing test branch.
Describe the bug
After ensuring that an instance of
Nullable<T>
is notnull
via.HasValue
, coverlet still assumes the instance to be nullable and therefore the branch coverage indicates a missing test branch.To Reproduce
Here you find a complete repro case.
Expected behavior
Branch coverage is 100% for the line
var isInPast = timeFromService < TimeOnly.FromDateTime(DateTime.UtcNow);
.Actual behavior
Coverlet complains that only 1 out of 2 branches is tested as it assumes that
timeFromService
can still benull
:Configuration (please complete the following information):
Please provide more information on your .NET configuration:
coverlet.msbuild v6.0.2
Additional context
Using
timeFromService.Value
rather thantimeFromService
can be used as a workaround.The text was updated successfully, but these errors were encountered: