And I mean this in the easiest way. Say you have a function with the following signature:
public static Expression<Func<T, bool>> CreateExpression<T>(string value)
{
// ...
}
Usually it will create a more complex expression of some sort, but if the value
is null
the method should return a constant, always true expression. In other words:
public static Expression<Func<T, bool>> CreateExpression<T>(string value)
{
if(value == null)
return x => true;
// ...
}
Is this something I can create a unit test for? That when I send in null
as the value, I do get back a constant true expression?