1
0
Fork 0
mirror of https://github.com/lidarr/Lidarr synced 2024-12-26 17:47:08 +00:00
Lidarr/NzbDrone.Common/EnsureThat/EnsureBoolExtensions.cs

26 lines
No EOL
760 B
C#

using System.Diagnostics;
using NzbDrone.Common.EnsureThat.Resources;
namespace NzbDrone.Common.EnsureThat
{
public static class EnsureBoolExtensions
{
[DebuggerStepThrough]
public static Param<bool> IsTrue(this Param<bool> param)
{
if (!param.Value)
throw ExceptionFactory.CreateForParamValidation(param.Name, ExceptionMessages.EnsureExtensions_IsNotTrue);
return param;
}
[DebuggerStepThrough]
public static Param<bool> IsFalse(this Param<bool> param)
{
if (param.Value)
throw ExceptionFactory.CreateForParamValidation(param.Name, ExceptionMessages.EnsureExtensions_IsNotFalse);
return param;
}
}
}