Created
August 15, 2020 13:28
-
-
Save samueleresca/489245d38336f3d6aef7085630a3d2c5 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
VerificationResult result; | |
//... | |
if (result.Status == CheckStatus.Success) { | |
Console.WriteLine("Success"); | |
} else { | |
Console.WriteLine("Errors:"); | |
IEnumerable<ConstraintResult> constraints = result | |
.CheckResults | |
.SelectMany(pair => pair.Value.ConstraintResults) | |
.Where(c=> c.Status == ConstraintStatus.Failure); | |
constraints | |
.Select(constraintResult => constraintResult | |
.Message.GetOrElse(string.Empty)) | |
.ToList().ForEach(Console.WriteLine); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment