I´m using FluentAssertions 1.7.0 and the methods HaveValue and NotHaveValue are missing for properties of type Nullable<int>.
For Nullable<DateTime> they are present.
Test:
Nullable<DateTime> date = null;
date.Should().HaveValue(); //Method is present
date.Should().HaveNotValue(); //Method is present
Nullable<int> value= null;
value.Should().HaveValue(); //Method is NOT present
value.Should().HaveNotValue(); //Method is NOT present
I checked the sourcecode and it seems there are assertions available for NullableNumerics, but they are not available.
Comments: ** Comment from web user: jehof **
For Nullable<DateTime> they are present.
Test:
Nullable<DateTime> date = null;
date.Should().HaveValue(); //Method is present
date.Should().HaveNotValue(); //Method is present
Nullable<int> value= null;
value.Should().HaveValue(); //Method is NOT present
value.Should().HaveNotValue(); //Method is NOT present
I checked the sourcecode and it seems there are assertions available for NullableNumerics, but they are not available.
Comments: ** Comment from web user: jehof **
Just checked the code. I think the problem lies in here (class AssertionExtensions)
public static IntegralAssertions<int?> Should(this int? actualValue)
{
return new IntegralAssertions<int?>(actualValue);
}
It should return a something else, cause IntegralAssertions doens´t support HaveValue and HaveNotValue.
For a Nullable<DateTime> a NullableDateTimeAssertions is returned which has the methods HaveValue and HaveNotValue