microsoft/vs-validation

Assumes.NotNull support Nullable<T> struct

iron9light opened this issue · 3 comments

Now, Assumes.NotNull only supports reference type as a parameter.

Should I use Assumes.Present<T> for this case?

No, Present<T> is meant for service non-null checks so the exception message it would throw would not be appropriate.
You can use Assumes.True(nullableStruct.HasValue); instead.

Actually looking at the API we offer, this was addressed by #45