Interface INumericGuardable
This interface provides methods for numeric related guard clauses. The implementation of these methods should succeed, if they approve the statement of the method name.
Namespace: TeleScope.GuardClauses.Abstractions
Assembly: TeleScope.GuardClauses.dll
Syntax
public interface INumericGuardable
Methods
| Improve this Doc View SourceIsExact<T>(T, T, String, String)
The implementation shall check, if the input number has exactly the same value of the comparator.
Declaration
T IsExact<T>(T input, T comparator, string expression = null, string message = null)
where T : IComparable
Parameters
Type | Name | Description |
---|---|---|
T | input | The instance under test. |
T | comparator | The instance that shall be compared by an implementation of the method. |
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 |
---|---|
T | The input data, if no exception will be thrown. |
Type Parameters
Name | Description |
---|---|
T | The type param under test. |
IsLarger<T>(T, T, String, String)
The implementation shall check, if the input number is larger than the comparator.
Declaration
T IsLarger<T>(T input, T comparator, string expression = null, string message = null)
where T : IComparable
Parameters
Type | Name | Description |
---|---|---|
T | input | The instance under test. |
T | comparator | The instance that shall be compared by an implementation of the method. |
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 |
---|---|
T | The input data, if no exception will be thrown. |
Type Parameters
Name | Description |
---|---|
T | The type param under test. |
IsLargerThanZero<T>(T, String, String)
The implementation shall check, if the input number is larger than zero.
Declaration
T IsLargerThanZero<T>(T input, string expression = null, string message = null)
where T : IComparable
Parameters
Type | Name | Description |
---|---|---|
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 |
---|---|
T | The input data, if no exception will be thrown. |
Type Parameters
Name | Description |
---|---|
T | The type param under test. |
IsNot<T>(T, String, String, T[])
The implementation shall check, if the input number has not the same value of the comparator.
Declaration
T IsNot<T>(T input, string expression = null, string message = null, params T[] comparators)
where T : IComparable
Parameters
Type | Name | Description |
---|---|---|
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. |
T[] | comparators | The potential multiple instance that shall be compared by an implementation of the method. |
Returns
Type | Description |
---|---|
T | The input data, if no exception will be thrown. |
Type Parameters
Name | Description |
---|---|
T | The type param under test. |
IsNotZero<T>(T, String, String)
The implementation shall check, if the input number is not zero.
Declaration
T IsNotZero<T>(T input, string expression = null, string message = null)
where T : IComparable
Parameters
Type | Name | Description |
---|---|---|
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 |
---|---|
T | The input data, if no exception will be thrown. |
Type Parameters
Name | Description |
---|---|
T | The type param under test. |
IsSmaller<T>(T, T, String, String)
The implementation shall check, if the input number is smaller than the comparator.
Declaration
T IsSmaller<T>(T input, T comparator, string expression = null, string message = null)
where T : IComparable
Parameters
Type | Name | Description |
---|---|---|
T | input | The instance under test. |
T | comparator | The instance that shall be compared by an implementation of the method. |
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 |
---|---|
T | The input data, if no exception will be thrown. |
Type Parameters
Name | Description |
---|---|
T | The type param under test. |