You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Lidarr/NzbDrone.Common/EnsureThat/EnsureBoolExtensions.cs

26 lines
760 B

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;
}
}
}