Open Bartleby2718 opened 5 months ago
Not sure if we want to go that far rewriting code. The user might like the ternary operator. It could also be written as:
var japanese = new Japanese(IsRoyal: false, FirstName: "Hayao", LastName: "Miyazaki");
Assert.That(japanese.LastName, japanese.IsRoyal ? Is.Null : Is.Not.Null);
We can take a step further and add a new diagnostic: "Split up ternaries for better assertion messages in case of failure"
Consider the following setup (context):
Now, suppose there's an assertion like this:
The new diagnostic can convert this to
Once #746 is complete, NUnit2010 will again suggest
which will eventually give you a good error message.