Class ExceptionCondition<TException>
Provides a fluent and generic way to setup a condition for raising an Exception.
Namespace: Cuemon
Assembly: Cuemon.Core.dll
Syntax
public class ExceptionCondition<TException>
where TException : Exception
Type Parameters
Name | Description |
---|---|
TException | The type of the Exception. |
Methods
| Improve this Doc View SourceIsFalse(Func<Boolean>)
Indicates that the specified function delegate condition
must evaluate false
.
Declaration
public ExceptionHandler<TException> IsFalse(Func<bool> condition)
Parameters
Type | Name | Description |
---|---|---|
Func<Boolean> | condition | The function delegate that determines if an Exception is thrown. |
Returns
Type | Description |
---|---|
ExceptionHandler<TException> | An ExceptionHandler<TException> with the specified |
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
IsFalse<TResult>(TesterFunc<TResult, Boolean>)
Indicates that the specified function delegate condition
must evaluate false
.
Declaration
public ExceptionHandler<TException, TResult> IsFalse<TResult>(TesterFunc<TResult, bool> condition)
Parameters
Type | Name | Description |
---|---|---|
TesterFunc<TResult, Boolean> | condition | The function delegate that determines if an Exception is thrown. |
Returns
Type | Description |
---|---|
ExceptionHandler<TException, TResult> | An ExceptionHandler<TException> with the specified |
Type Parameters
Name | Description |
---|---|
TResult | The type of the out result value of the function delegate |
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
IsTrue(Func<Boolean>)
Indicates that the specified function delegate condition
must evaluate true
.
Declaration
public ExceptionHandler<TException> IsTrue(Func<bool> condition)
Parameters
Type | Name | Description |
---|---|---|
Func<Boolean> | condition | The function delegate that determines if an Exception is thrown. |
Returns
Type | Description |
---|---|
ExceptionHandler<TException> | An ExceptionHandler<TException> with the specified |
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
IsTrue<TResult>(TesterFunc<TResult, Boolean>)
Indicates that the specified function delegate condition
must evaluate true
.
Declaration
public ExceptionHandler<TException, TResult> IsTrue<TResult>(TesterFunc<TResult, bool> condition)
Parameters
Type | Name | Description |
---|---|---|
TesterFunc<TResult, Boolean> | condition | The function delegate that determines if an Exception is thrown. |
Returns
Type | Description |
---|---|
ExceptionHandler<TException, TResult> | An ExceptionHandler<TException> with the specified |
Type Parameters
Name | Description |
---|---|
TResult | The type of the out result value of the function delegate |
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|