Class EnsureThat
Inheritance
object
EnsureThat
Assembly: solution.dll
Syntax
Methods
Any<T>(ICollection<T>, Func<T, bool>)
Declaration
public void Any<T>(ICollection<T> value, Func<T, bool> predicate)
Parameters
| Type |
Name |
Description |
| ICollection<T> |
value |
|
| Func<T, bool> |
predicate |
|
Type Parameters
Any<T>(IList<T>, Func<T, bool>)
Declaration
public void Any<T>(IList<T> value, Func<T, bool> predicate)
Parameters
| Type |
Name |
Description |
| IList<T> |
value |
|
| Func<T, bool> |
predicate |
|
Type Parameters
Any<T>(T[], Func<T, bool>)
Declaration
public void Any<T>(T[] value, Func<T, bool> predicate)
Parameters
| Type |
Name |
Description |
| T[] |
value |
|
| Func<T, bool> |
predicate |
|
Type Parameters
HasAttribute(Type, Type)
Declaration
public void HasAttribute(Type param, Type attributeType)
Parameters
| Type |
Name |
Description |
| Type |
param |
|
| Type |
attributeType |
|
HasAttribute<TAttribute>(Type)
Declaration
public void HasAttribute<TAttribute>(Type param) where TAttribute : Attribute
Parameters
| Type |
Name |
Description |
| Type |
param |
|
Type Parameters
| Name |
Description |
| TAttribute |
|
HasConstructorAccepting(Type, params Type[])
Declaration
public void HasConstructorAccepting(Type param, params Type[] parameterTypes)
Parameters
| Type |
Name |
Description |
| Type |
param |
|
| Type[] |
parameterTypes |
|
HasItems<T>(ICollection<T>)
Declaration
public void HasItems<T>(ICollection<T> value)
Parameters
| Type |
Name |
Description |
| ICollection<T> |
value |
|
Type Parameters
HasItems<T>(IList<T>)
Declaration
public void HasItems<T>(IList<T> value)
Parameters
| Type |
Name |
Description |
| IList<T> |
value |
|
Type Parameters
HasItems<T>(T)
Declaration
public void HasItems<T>(T value) where T : class, ICollection
Parameters
| Type |
Name |
Description |
| T |
value |
|
Type Parameters
HasItems<T>(T[])
Declaration
public void HasItems<T>(T[] value)
Parameters
| Type |
Name |
Description |
| T[] |
value |
|
Type Parameters
HasItems<TKey, TValue>(IDictionary<TKey, TValue>)
Declaration
public void HasItems<TKey, TValue>(IDictionary<TKey, TValue> value)
Parameters
| Type |
Name |
Description |
| IDictionary<TKey, TValue> |
value |
|
Type Parameters
| Name |
Description |
| TKey |
|
| TValue |
|
HasLengthBetween(string, int, int)
Declaration
public void HasLengthBetween(string value, int minLength, int maxLength)
Parameters
| Type |
Name |
Description |
| string |
value |
|
| int |
minLength |
|
| int |
maxLength |
|
HasNoNullItem<T>(T)
Declaration
public void HasNoNullItem<T>(T value) where T : class, IEnumerable
Parameters
| Type |
Name |
Description |
| T |
value |
|
Type Parameters
HasPublicConstructorAccepting(Type, params Type[])
Declaration
public void HasPublicConstructorAccepting(Type param, params Type[] parameterTypes)
Parameters
| Type |
Name |
Description |
| Type |
param |
|
| Type[] |
parameterTypes |
|
IsEqualTo(string, string)
Declaration
public void IsEqualTo(string value, string expected)
Parameters
IsEqualTo(string, string, StringComparison)
Declaration
public void IsEqualTo(string value, string expected, StringComparison comparison)
Parameters
| Type |
Name |
Description |
| string |
value |
|
| string |
expected |
|
| StringComparison |
comparison |
|
IsFalse(bool)
Declaration
public void IsFalse(bool value)
Parameters
| Type |
Name |
Description |
| bool |
value |
|
IsGt<T>(T, T)
Declaration
public void IsGt<T>(T param, T limit) where T : struct, IComparable<T>
Parameters
| Type |
Name |
Description |
| T |
param |
|
| T |
limit |
|
Type Parameters
IsGte<T>(T, T)
Declaration
public void IsGte<T>(T param, T limit) where T : struct, IComparable<T>
Parameters
| Type |
Name |
Description |
| T |
param |
|
| T |
limit |
|
Type Parameters
IsGuid(string)
Declaration
public void IsGuid(string value)
Parameters
| Type |
Name |
Description |
| string |
value |
|
IsInRange<T>(T, T, T)
Declaration
public void IsInRange<T>(T param, T min, T max) where T : struct, IComparable<T>
Parameters
| Type |
Name |
Description |
| T |
param |
|
| T |
min |
|
| T |
max |
|
Type Parameters
IsKeyOf<TKey, TValue>(IDictionary<TKey, TValue>, TKey, string)
Declaration
public void IsKeyOf<TKey, TValue>(IDictionary<TKey, TValue> value, TKey expectedKey, string keyLabel = null)
Parameters
| Type |
Name |
Description |
| IDictionary<TKey, TValue> |
value |
|
| TKey |
expectedKey |
|
| string |
keyLabel |
|
Type Parameters
| Name |
Description |
| TKey |
|
| TValue |
|
IsLt<T>(T, T)
Declaration
public void IsLt<T>(T param, T limit) where T : struct, IComparable<T>
Parameters
| Type |
Name |
Description |
| T |
param |
|
| T |
limit |
|
Type Parameters
IsLte<T>(T, T)
Declaration
public void IsLte<T>(T param, T limit) where T : struct, IComparable<T>
Parameters
| Type |
Name |
Description |
| T |
param |
|
| T |
limit |
|
Type Parameters
IsNotDefault<T>(T)
Declaration
public void IsNotDefault<T>(T param) where T : struct
Parameters
| Type |
Name |
Description |
| T |
param |
|
Type Parameters
IsNotEmpty(Guid)
Declaration
public void IsNotEmpty(Guid value)
Parameters
| Type |
Name |
Description |
| Guid |
value |
|
IsNotEmpty(string)
Declaration
public void IsNotEmpty(string value)
Parameters
| Type |
Name |
Description |
| string |
value |
|
IsNotEqualTo(string, string)
Declaration
public void IsNotEqualTo(string value, string expected)
Parameters
IsNotEqualTo(string, string, StringComparison)
Declaration
public void IsNotEqualTo(string value, string expected, StringComparison comparison)
Parameters
| Type |
Name |
Description |
| string |
value |
|
| string |
expected |
|
| StringComparison |
comparison |
|
IsNotNull(string)
Declaration
public void IsNotNull(string value)
Parameters
| Type |
Name |
Description |
| string |
value |
|
IsNotNullOrEmpty(string)
Declaration
public void IsNotNullOrEmpty(string value)
Parameters
| Type |
Name |
Description |
| string |
value |
|
IsNotNullOrWhiteSpace(string)
Declaration
public void IsNotNullOrWhiteSpace(string value)
Parameters
| Type |
Name |
Description |
| string |
value |
|
IsNotNull<T>(T?)
Declaration
public void IsNotNull<T>(T? value) where T : struct
Parameters
| Type |
Name |
Description |
| T? |
value |
|
Type Parameters
IsNotNull<T>(T)
Declaration
public void IsNotNull<T>(T value)
Parameters
| Type |
Name |
Description |
| T |
value |
|
Type Parameters
IsNot<T>(T, T)
Declaration
public void IsNot<T>(T param, T expected) where T : struct, IComparable<T>
Parameters
| Type |
Name |
Description |
| T |
param |
|
| T |
expected |
|
Type Parameters
IsNull<T>(T)
Declaration
public void IsNull<T>(T value)
Parameters
| Type |
Name |
Description |
| T |
value |
|
Type Parameters
IsOfType(Type, Type)
Declaration
public void IsOfType(Type param, Type expectedType)
Parameters
| Type |
Name |
Description |
| Type |
param |
|
| Type |
expectedType |
|
IsOfType<T>(object)
Declaration
public void IsOfType<T>(object param)
Parameters
| Type |
Name |
Description |
| object |
param |
|
Type Parameters
IsOfType<T>(Type)
Declaration
public void IsOfType<T>(Type param)
Parameters
| Type |
Name |
Description |
| Type |
param |
|
Type Parameters
IsOfType<T>(T, Type)
Declaration
public void IsOfType<T>(T param, Type expectedType)
Parameters
| Type |
Name |
Description |
| T |
param |
|
| Type |
expectedType |
|
Type Parameters
IsTrue(bool)
Declaration
public void IsTrue(bool value)
Parameters
| Type |
Name |
Description |
| bool |
value |
|
Is<T>(T, T)
Declaration
public void Is<T>(T param, T expected) where T : struct, IComparable<T>
Parameters
| Type |
Name |
Description |
| T |
param |
|
| T |
expected |
|
Type Parameters
Matches(string, Regex)
Declaration
public void Matches(string value, Regex match)
Parameters
| Type |
Name |
Description |
| string |
value |
|
| Regex |
match |
|
Matches(string, string)
Declaration
public void Matches(string value, string match)
Parameters
SizeIs(string, int)
Declaration
public void SizeIs(string value, int expected)
Parameters
| Type |
Name |
Description |
| string |
value |
|
| int |
expected |
|
SizeIs<T>(ICollection<T>, int)
Declaration
public void SizeIs<T>(ICollection<T> value, int expected)
Parameters
| Type |
Name |
Description |
| ICollection<T> |
value |
|
| int |
expected |
|
Type Parameters
SizeIs<T>(ICollection<T>, long)
Declaration
public void SizeIs<T>(ICollection<T> value, long expected)
Parameters
| Type |
Name |
Description |
| ICollection<T> |
value |
|
| long |
expected |
|
Type Parameters
SizeIs<T>(IList<T>, int)
Declaration
public void SizeIs<T>(IList<T> value, int expected)
Parameters
| Type |
Name |
Description |
| IList<T> |
value |
|
| int |
expected |
|
Type Parameters
SizeIs<T>(IList<T>, long)
Declaration
public void SizeIs<T>(IList<T> value, long expected)
Parameters
| Type |
Name |
Description |
| IList<T> |
value |
|
| long |
expected |
|
Type Parameters
SizeIs<T>(T, int)
Declaration
public void SizeIs<T>(T value, int expected) where T : ICollection
Parameters
| Type |
Name |
Description |
| T |
value |
|
| int |
expected |
|
Type Parameters
SizeIs<T>(T, long)
Declaration
public void SizeIs<T>(T value, long expected) where T : ICollection
Parameters
| Type |
Name |
Description |
| T |
value |
|
| long |
expected |
|
Type Parameters
SizeIs<T>(T[], int)
Declaration
public void SizeIs<T>(T[] value, int expected)
Parameters
| Type |
Name |
Description |
| T[] |
value |
|
| int |
expected |
|
Type Parameters
SizeIs<T>(T[], long)
Declaration
public void SizeIs<T>(T[] value, long expected)
Parameters
| Type |
Name |
Description |
| T[] |
value |
|
| long |
expected |
|
Type Parameters
SizeIs<TKey, TValue>(IDictionary<TKey, TValue>, int)
Declaration
public void SizeIs<TKey, TValue>(IDictionary<TKey, TValue> value, int expected)
Parameters
| Type |
Name |
Description |
| IDictionary<TKey, TValue> |
value |
|
| int |
expected |
|
Type Parameters
| Name |
Description |
| TKey |
|
| TValue |
|
SizeIs<TKey, TValue>(IDictionary<TKey, TValue>, long)
Declaration
public void SizeIs<TKey, TValue>(IDictionary<TKey, TValue> value, long expected)
Parameters
| Type |
Name |
Description |
| IDictionary<TKey, TValue> |
value |
|
| long |
expected |
|
Type Parameters
| Name |
Description |
| TKey |
|
| TValue |
|
Extension Methods