mirror of
https://github.com/aphrody-labs/NuGet.Client.git
synced 2026-10-15 22:09:04 +00:00
25 lines
667 B
C#
25 lines
667 B
C#
using System;
|
|||
|
|
|
||
|
|
namespace API.Test
|
||
|
|
{
|
||
|
|
public static class Utils
|
||
|
|
{
|
||
|
|
public static void ThrowStringArgException(string value, string paramName)
|
||
|
|
{
|
||
|
|
if (string.IsNullOrEmpty(paramName))
|
||
|
|
{
|
||
|
|
throw new ArgumentException("string cannot be null or empty", nameof(paramName));
|
||
|
|
}
|
||
|
|
|
||
|
|
if (string.IsNullOrEmpty(value))
|
||
|
|
{
|
||
|
|
throw new ArgumentException("string cannot be null or empty", paramName);
|
||
|
|
}
|
||
|
|
}
|
||
|
|
|
||
|
|
public static string GetNewGUID()
|
||
|
|
{
|
||
|
|
return Guid.NewGuid().ToString("d").Substring(0, 4).Replace("-", "");
|
||
|
|
}
|
||
|
|
}
|
||
|
|
}
|