mirror of
https://github.com/Radarr/Radarr.git
synced 2024-11-14 15:03:42 +01:00
26 lines
760 B
C#
26 lines
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;
|
||
|
}
|
||
|
}
|
||
|
}
|