Guard Clauses
Write short checks that reject invalid inputs at the beginning of a function.
ardalis · Code and testing
GitHub projectOpen source Open on GitHubHow to try it
Add Ardalis.GuardClauses 5.0.0 to a .NET project. Reject a sample out-of-range number and confirm valid input is returned unchanged.
What we tested
5.0.0. Reject a sample out-of-range number and confirm valid input is returned unchanged. The negative test value raised the expected error and the valid count stayed 7.