✅ Nullable<int> and xUnit
I'm writing unit tests for a method that has
When I do:
xUnit tells me
When I do
It tells me
What is happening? What should I do?
int? as a return type.When I do:
Assert.Equal(null, parser.GetNumber(myArguments));xUnit tells me
xUnit2003: Do not use Assert. Equal() to check for null value. Use Assert.Null instead.When I do
Assert.Null(parser.GetNumber(myArguments));It tells me
xUnit2002: Do not use Assert.Null() on value type 'int'. Remove this assert.What is happening? What should I do?