I have a property in a class
public class User {
public string FiscalCode {get; set;}
}
And i want test the property fiscal code with two condition. The test is ok if fiscalcode is null or fiscalcode is verified by a method
public bool FiscalCodeIsCorrect(string fiscalcode)
{
....
}
How can i test in a single line with shouldly if one of the two conditions is verified ?
I want use this condition in a test project so the line of code could be
user.FiscalCode.ShouldBeOneOf()
But i can't because null
and string
are two different types.