Interface ICollectionGuardable
This interface provides methods for
Namespace: TeleScope.GuardClauses.Abstractions
Assembly: TeleScope.GuardClauses.dll
Syntax
public interface ICollectionGuardable
Methods
| Improve this Doc View SourceAll<T>(IEnumerable<T>, Func<T, Boolean>, String, String)
The implementation shall check, if all elements of the input enumeration meet a predicate function.
Declaration
IEnumerable<T> All<T>(IEnumerable<T> input, Func<T, bool> predicate, string expression = null, string message = null)
Parameters
Type | Name | Description |
---|---|---|
IEnumerable<T> | input | The instance under test. |
Func<T, System.Boolean> | predicate | The test function, every element must meet. |
System.String | expression | The optional parameter name under test. |
System.String | message | The optional exception message that wil be used, if the method implementation throws. |
Returns
Type | Description |
---|---|
IEnumerable<T> | The input data, if no exception will be thrown. |
Type Parameters
Name | Description |
---|---|
T | The type param under test. |
Contains<T>(IEnumerable<T>, T, String, String)
The implementation shall check, if the input enumeration contains a specific element.
Declaration
IEnumerable<T> Contains<T>(IEnumerable<T> input, T item, string expression = null, string message = null)
Parameters
Type | Name | Description |
---|---|---|
IEnumerable<T> | input | The instance under test. |
T | item | The test item, used for compare opertations. |
System.String | expression | The optional parameter name under test. |
System.String | message | The optional exception message that wil be used, if the method implementation throws. |
Returns
Type | Description |
---|---|
IEnumerable<T> | The input data, if no exception will be thrown. |
Type Parameters
Name | Description |
---|---|
T | The type param under test. |
ContainsNot<T>(IEnumerable<T>, T, String, String)
The implementation shall check, if the input enumeration doesn't contain a specific element.
Declaration
IEnumerable<T> ContainsNot<T>(IEnumerable<T> input, T item, string expression = null, string message = null)
Parameters
Type | Name | Description |
---|---|---|
IEnumerable<T> | input | The instance under test. |
T | item | The test item, used for compare opertations. |
System.String | expression | The optional parameter name under test. |
System.String | message | The optional exception message that wil be used, if the method implementation throws. |
Returns
Type | Description |
---|---|
IEnumerable<T> | The input data, if no exception will be thrown. |
Type Parameters
Name | Description |
---|---|
T | The type param under test. |
IsFilled<T>(IEnumerable<T>, String, String)
The implementation shall check, if all elements of the input enumeration are not null.
Declaration
IEnumerable<T> IsFilled<T>(IEnumerable<T> input, string expression = null, string message = null)
Parameters
Type | Name | Description |
---|---|---|
IEnumerable<T> | input | The instance under test. |
System.String | expression | The optional parameter name under test. |
System.String | message | The optional exception message that wil be used, if the method implementation throws. |
Returns
Type | Description |
---|---|
IEnumerable<T> | The input data, if no exception will be thrown. |
Type Parameters
Name | Description |
---|---|
T | The type param under test. |
IsNotEmpty<T>(IEnumerable<T>, String, String)
The implementation shall check, if the input enumeration is not empty.
Declaration
IEnumerable<T> IsNotEmpty<T>(IEnumerable<T> input, string expression = null, string message = null)
Parameters
Type | Name | Description |
---|---|---|
IEnumerable<T> | input | The instance under test. |
System.String | expression | The optional parameter name under test. |
System.String | message | The optional exception message that wil be used, if the method implementation throws. |
Returns
Type | Description |
---|---|
IEnumerable<T> | The input data, if no exception will be thrown. |
Type Parameters
Name | Description |
---|---|
T | The type param under test. |