Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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: 5 days 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 (over 12 years ago)
- Default Branch: main
- Last Pushed: 2024-12-24T14:37:37.000Z (14 days ago)
- Last Synced: 2024-12-26T09:06:17.482Z (12 days ago)
- Language: C#
- Homepage: https://aarnott.github.io/Validation/
- Size: 4.49 MB
- Stars: 132
- Watchers: 13
- Forks: 22
- Open Issues: 0
-
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.*[![NuGet package](https://img.shields.io/nuget/v/Validation.svg)](https://nuget.org/packages/Validation)
[![🏭 Build](https://github.com/AArnott/Validation/actions/workflows/build.yml/badge.svg)](https://github.com/AArnott/Validation/actions/workflows/build.yml)
[![codecov](https://codecov.io/gh/AArnott/Validation/branch/main/graph/badge.svg)](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"