-
Notifications
You must be signed in to change notification settings - Fork 259
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
0ee0586
commit 4d52f05
Showing
3 changed files
with
37 additions
and
53 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
// Copyright (c) Microsoft Corporation. All rights reserved. | ||
// Licensed under the MIT license. See LICENSE file in the project root for full license information. | ||
|
||
using System; | ||
|
||
namespace Microsoft.VisualStudio.TestTools.UnitTesting; | ||
|
||
/// <summary> | ||
/// A guard helper class to help validate preconditions. | ||
/// </summary> | ||
internal static class Guard | ||
{ | ||
internal static void IsNotNull(object? param, string parameterName, string? message) | ||
{ | ||
if (param is not null) | ||
{ | ||
return; | ||
} | ||
|
||
if (message is null) | ||
{ | ||
throw new ArgumentNullException(parameterName); | ||
} | ||
|
||
throw new ArgumentNullException(parameterName, message); | ||
} | ||
|
||
internal static void IsNotNullOrEmpty(string? argument, string parameterName, string message) | ||
{ | ||
if (StringEx.IsNullOrEmpty(argument)) | ||
{ | ||
throw new ArgumentException(message, parameterName); | ||
} | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.