Common input and integrity validation routines for Visual Studio and other applications
Перейти к файлу
Andrew Arnott 119f009e26
Merge pull request #268 from microsoft/dev/andarno/libtemplateUpdate
Merge latest Library.Template
2024-10-30 17:47:54 -06:00
.azuredevops
.config Bump powershell from 7.4.5 to 7.4.6 (#301) 2024-10-29 14:20:49 +00:00
.github Merge the microbuild branch from https://github.com/aarnott/Library.Template 2024-10-30 16:48:51 -06:00
.vscode
azure-pipelines Merge remote-tracking branch 'libtemplate/microbuild' into libtemplateUpdate 2024-10-29 18:09:15 -06:00
loc
src Merge remote-tracking branch 'libtemplate/microbuild' into libtemplateUpdate 2024-10-29 18:09:15 -06:00
test Merge remote-tracking branch 'libtemplate/microbuild' into libtemplateUpdate 2024-10-29 18:09:15 -06:00
tools Merge remote-tracking branch 'libtemplate/microbuild' into libtemplateUpdate 2024-10-29 18:09:15 -06:00
.editorconfig
.gitattributes
.gitignore Ignore Rider cache files 2024-10-11 06:46:16 -06:00
.prettierrc.yaml
CONTRIBUTING.md
Directory.Build.props Merge remote-tracking branch 'libtemplate/microbuild' into libtemplateUpdate 2024-10-29 18:09:15 -06:00
Directory.Build.rsp
Directory.Build.targets
Directory.Packages.props Merge remote-tracking branch 'libtemplate/microbuild' into libtemplateUpdate 2024-10-29 18:09:15 -06:00
LICENSE
Microsoft.VisualStudio.Validation.sln
README.md
SECURITY.md
azure-pipelines.yml
azurepipelines-coverage.yml
global.json Merge branch 'main' into microbuild 2024-10-29 17:52:42 -06:00
init.cmd
init.ps1 Merge remote-tracking branch 'libtemplate/microbuild' into libtemplateUpdate 2024-10-29 18:09:15 -06:00
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");