Common input and integrity validation routines for Visual Studio and other applications
Перейти к файлу
Andrew Arnott b4b4ab0b2b
Merge remote-tracking branch 'libtemplate/microbuild' into libtemplateUpdate
2024-08-22 09:20:38 -06:00
.azuredevops
.config
.github
.vscode
azure-pipelines Merge remote-tracking branch 'libtemplate/microbuild' into libtemplateUpdate 2024-08-22 09:20:38 -06:00
loc
src Merge remote-tracking branch 'libtemplate/microbuild' into libtemplateUpdate 2024-08-21 10:06:51 -06:00
test
tools
.editorconfig
.gitattributes
.gitignore
.prettierrc.yaml
CONTRIBUTING.md
Directory.Build.props
Directory.Build.rsp
Directory.Build.targets
Directory.Packages.props Merge remote-tracking branch 'libtemplate/microbuild' into libtemplateUpdate 2024-08-22 09:20:38 -06:00
LICENSE
Microsoft.VisualStudio.Validation.sln
README.md
SECURITY.md
azure-pipelines.yml
azurepipelines-coverage.yml
global.json
init.cmd
init.ps1
nuget.config
settings.VisualStudio.json
stylecop.json
version.json

README.md

Microsoft.VisualStudio.Validation

NuGet package Build Status codecov

This project is available as the Microsoft.VisualStudio.Validation NuGet package.

Basic input validation via the Requires class throws an ArgumentException.

Requires.NotNull(arg1, nameof(arg1));
Requires.NotNullOrEmpty(arg2, nameof(arg2));

State validation via the Verify class throws an InvalidOperationException.

Verify.Operation(condition, "some error occurred.");

Internal integrity checks via the Assumes class throws an InternalErrorException.

Assumes.True(condition, "some error");

Warning signs that should not throw exceptions via the Report class.

Report.IfNot(condition, "some error");