https://github.com/microsoft/vs-validation
Common input and integrity validation routines for Visual Studio and other applications
https://github.com/microsoft/vs-validation
dotnet netstandard nuget validation
Last synced: 16 days ago
JSON representation
Common input and integrity validation routines for Visual Studio and other applications
- Host: GitHub
- URL: https://github.com/microsoft/vs-validation
- Owner: microsoft
- License: other
- Created: 2016-10-05T13:37:49.000Z (over 8 years ago)
- Default Branch: main
- Last Pushed: 2025-04-06T05:36:30.000Z (24 days ago)
- Last Synced: 2025-04-06T22:02:58.607Z (24 days ago)
- Topics: dotnet, netstandard, nuget, validation
- Language: C#
- Size: 2.41 MB
- Stars: 116
- Watchers: 15
- Forks: 29
- Open Issues: 8
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
- Security: SECURITY.md
Awesome Lists containing this project
README
Microsoft.VisualStudio.Validation
=================================[](https://www.nuget.org/packages/Microsoft.VisualStudio.Validation)
[](https://dev.azure.com/azure-public/vside/_build/latest?definitionId=11&branchName=main)
[](https://codecov.io/gh/Microsoft/vs-validation)This project is available as the [Microsoft.VisualStudio.Validation][1] NuGet package.
Basic input validation via the `Requires` class throws an ArgumentException.
```csharp
Requires.NotNull(arg1, nameof(arg1));
Requires.NotNullOrEmpty(arg2, nameof(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://www.nuget.org/packages/Microsoft.VisualStudio.Validation "Microsoft.VisualStudio.Validation NuGet package"