Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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: about 1 month 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 (about 8 years ago)
- Default Branch: main
- Last Pushed: 2024-09-16T02:22:52.000Z (about 2 months ago)
- Last Synced: 2024-10-01T04:23:07.848Z (about 1 month ago)
- Topics: dotnet, netstandard, nuget, validation
- Language: C#
- Size: 2.12 MB
- Stars: 96
- Watchers: 16
- Forks: 30
- Open Issues: 7
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
- Security: SECURITY.md
Awesome Lists containing this project
README
Microsoft.VisualStudio.Validation
=================================[![NuGet package](https://img.shields.io/nuget/v/Microsoft.VisualStudio.Validation.svg)](https://nuget.org/packages/Microsoft.VisualStudio.Validation)
[![Build Status](https://dev.azure.com/azure-public/vside/_apis/build/status/vs-validation?branchName=main)](https://dev.azure.com/azure-public/vside/_build/latest?definitionId=11&branchName=main)
[![codecov](https://codecov.io/gh/Microsoft/vs-validation/branch/main/graph/badge.svg)](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://nuget.org/packages/Microsoft.VisualStudio.Validation "Microsoft.VisualStudio.Validation NuGet package"