mirror of
https://github.com/aphrody-labs/NuGet.Client.git
synced 2026-10-15 05:49:05 +00:00
26 lines
667 B
C#
26 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("-", "");
|
|
}
|
|
}
|
|
}
|