https://github.com/aarnott/validation
Method input validation and runtime checks that report errors or throw exceptions when failures are detected.
https://github.com/aarnott/validation
Last synced: 3 months ago
JSON representation
Method input validation and runtime checks that report errors or throw exceptions when failures are detected.
- Host: GitHub
- URL: https://github.com/aarnott/validation
- Owner: AArnott
- License: ms-pl
- Created: 2012-09-15T13:49:05.000Z (almost 13 years ago)
- Default Branch: main
- Last Pushed: 2025-03-20T02:29:05.000Z (4 months ago)
- Last Synced: 2025-04-03T23:07:57.248Z (3 months ago)
- Language: C#
- Homepage: https://aarnott.github.io/Validation/
- Size: 4.59 MB
- Stars: 136
- Watchers: 12
- Forks: 22
- Open Issues: 9
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
Awesome Lists containing this project
README
Validation
==========*Method input validation and runtime checks that report errors or throw
exceptions when failures are detected.*[](https://nuget.org/packages/Validation)
[](https://github.com/AArnott/Validation/actions/workflows/build.yml)
[](https://codecov.io/gh/AArnott/Validation)This project is available as the [Validation][1] NuGet package.
[Check out our full documentation](https://aarnott.github.io/Validation).
Basic input validation via the `Requires` class throws an ArgumentException.
```cs
Requires.NotNull(arg1);
Requires.NotNullOrEmpty(arg2);
```State validation via the `Verify` class throws an InvalidOperationException.
```csharp
Verify.Operation(condition, "some error occurred.");
```Internal integrity checks via the `Assumes` class throws an
InternalErrorException.```csharp
Assumes.True(condition, "some error");
```Warning signs that should not throw exceptions via the `Report` class.
```csharp
Report.IfNot(condition, "some error");
```[1]: http://nuget.org/packages/Validation "Validation NuGet package"