Reputation: 1711
Is it possible to test the return value and out
parametes with the same assert?
Im looking for something like this:
Assert.That(int.TryParse("1", out var number), Is.True.And(// check for number == 1));
Upvotes: 2
Views: 280
Reputation: 16079
You can try
Assert.IsTrue(int.TryParse("1", out var number) && number == 1);
POC: .net fiddle
** without Assert, just to check condition
Upvotes: 2