Class DictionaryAsserts
- Namespace
- Asserts
- Assembly
- xunit.v3.assert.dll
public class DictionaryAsserts
- Inheritance
-
DictionaryAsserts
- Inherited Members
Methods
Contains<TKey, TValue>(TKey, ConcurrentDictionary<TKey, TValue>)
Verifies that a dictionary contains a given key.
public static TValue Contains<TKey, TValue>(TKey expected, ConcurrentDictionary<TKey, TValue> collection) where TKey : notnull
Parameters
expectedTKeyThe object expected to be in the collection.
collectionConcurrentDictionary<TKey, TValue>The collection to be inspected.
Returns
- TValue
The value associated with
expected.
Type Parameters
TKeyThe type of the keys of the object to be verified.
TValueThe type of the values of the object to be verified.
Examples
Add an example for this method ?
Contribution guide.
Exceptions
- ContainsException
Thrown when the object is not present in the collection
Contains<TKey, TValue>(TKey, Dictionary<TKey, TValue>)
Verifies that a dictionary contains a given key.
public static TValue Contains<TKey, TValue>(TKey expected, Dictionary<TKey, TValue> collection) where TKey : notnull
Parameters
expectedTKeyThe object expected to be in the collection.
collectionDictionary<TKey, TValue>The collection to be inspected.
Returns
- TValue
The value associated with
expected.
Type Parameters
TKeyThe type of the keys of the object to be verified.
TValueThe type of the values of the object to be verified.
Examples
Add an example for this method ?
Contribution guide.
Exceptions
- ContainsException
Thrown when the object is not present in the collection
Contains<TKey, TValue>(TKey, IDictionary<TKey, TValue>)
Verifies that a dictionary contains a given key.
public static TValue Contains<TKey, TValue>(TKey expected, IDictionary<TKey, TValue> collection) where TKey : notnull
Parameters
expectedTKeyThe object expected to be in the collection.
collectionIDictionary<TKey, TValue>The collection to be inspected.
Returns
- TValue
The value associated with
expected.
Type Parameters
TKeyThe type of the keys of the object to be verified.
TValueThe type of the values of the object to be verified.
Examples
Add an example for this method ?
Contribution guide.
Exceptions
- ContainsException
Thrown when the object is not present in the collection
Contains<TKey, TValue>(TKey, IReadOnlyDictionary<TKey, TValue>)
Verifies that a read-only dictionary contains a given key.
public static TValue Contains<TKey, TValue>(TKey expected, IReadOnlyDictionary<TKey, TValue> collection) where TKey : notnull
Parameters
expectedTKeyThe object expected to be in the collection.
collectionIReadOnlyDictionary<TKey, TValue>The collection to be inspected.
Returns
- TValue
The value associated with
expected.
Type Parameters
TKeyThe type of the keys of the object to be verified.
TValueThe type of the values of the object to be verified.
Examples
Add an example for this method ?
Contribution guide.
Exceptions
- ContainsException
Thrown when the object is not present in the collection
Contains<TKey, TValue>(TKey, ImmutableDictionary<TKey, TValue>)
Verifies that a dictionary contains a given key.
public static TValue Contains<TKey, TValue>(TKey expected, ImmutableDictionary<TKey, TValue> collection) where TKey : notnull
Parameters
expectedTKeyThe object expected to be in the collection.
collectionImmutableDictionary<TKey, TValue>The collection to be inspected.
Returns
- TValue
The value associated with
expected.
Type Parameters
TKeyThe type of the keys of the object to be verified.
TValueThe type of the values of the object to be verified.
Examples
Add an example for this method ?
Contribution guide.
Exceptions
- ContainsException
Thrown when the object is not present in the collection
Contains<TKey, TValue>(TKey, ReadOnlyDictionary<TKey, TValue>)
Verifies that a dictionary contains a given key.
public static TValue Contains<TKey, TValue>(TKey expected, ReadOnlyDictionary<TKey, TValue> collection) where TKey : notnull
Parameters
expectedTKeyThe object expected to be in the collection.
collectionReadOnlyDictionary<TKey, TValue>The collection to be inspected.
Returns
- TValue
The value associated with
expected.
Type Parameters
TKeyThe type of the keys of the object to be verified.
TValueThe type of the values of the object to be verified.
Examples
Add an example for this method ?
Contribution guide.
Exceptions
- ContainsException
Thrown when the object is not present in the collection
DoesNotContain<TKey, TValue>(TKey, ConcurrentDictionary<TKey, TValue>)
Verifies that a dictionary does not contain a given key.
public static void DoesNotContain<TKey, TValue>(TKey expected, ConcurrentDictionary<TKey, TValue> collection) where TKey : notnull
Parameters
expectedTKeyThe object expected to be in the collection.
collectionConcurrentDictionary<TKey, TValue>The collection to be inspected.
Type Parameters
TKeyThe type of the keys of the object to be verified.
TValueThe type of the values of the object to be verified.
Examples
Add an example for this method ?
Contribution guide.
Exceptions
- DoesNotContainException
Thrown when the object is present in the collection
DoesNotContain<TKey, TValue>(TKey, Dictionary<TKey, TValue>)
Verifies that a dictionary does not contain a given key.
public static void DoesNotContain<TKey, TValue>(TKey expected, Dictionary<TKey, TValue> collection) where TKey : notnull
Parameters
expectedTKeyThe object expected to be in the collection.
collectionDictionary<TKey, TValue>The collection to be inspected.
Type Parameters
TKeyThe type of the keys of the object to be verified.
TValueThe type of the values of the object to be verified.
Examples
Add an example for this method ?
Contribution guide.
Exceptions
- DoesNotContainException
Thrown when the object is present in the collection
DoesNotContain<TKey, TValue>(TKey, IDictionary<TKey, TValue>)
Verifies that a dictionary does not contain a given key.
public static void DoesNotContain<TKey, TValue>(TKey expected, IDictionary<TKey, TValue> collection) where TKey : notnull
Parameters
expectedTKeyThe object expected to be in the collection.
collectionIDictionary<TKey, TValue>The collection to be inspected.
Type Parameters
TKeyThe type of the keys of the object to be verified.
TValueThe type of the values of the object to be verified.
Examples
Add an example for this method ?
Contribution guide.
Exceptions
- DoesNotContainException
Thrown when the object is present in the collection
DoesNotContain<TKey, TValue>(TKey, IReadOnlyDictionary<TKey, TValue>)
Verifies that a dictionary does not contain a given key.
public static void DoesNotContain<TKey, TValue>(TKey expected, IReadOnlyDictionary<TKey, TValue> collection) where TKey : notnull
Parameters
expectedTKeyThe object expected to be in the collection.
collectionIReadOnlyDictionary<TKey, TValue>The collection to be inspected.
Type Parameters
TKeyThe type of the keys of the object to be verified.
TValueThe type of the values of the object to be verified.
Examples
Add an example for this method ?
Contribution guide.
Exceptions
- DoesNotContainException
Thrown when the object is present in the collection
DoesNotContain<TKey, TValue>(TKey, ImmutableDictionary<TKey, TValue>)
Verifies that a dictionary does not contain a given key.
public static void DoesNotContain<TKey, TValue>(TKey expected, ImmutableDictionary<TKey, TValue> collection) where TKey : notnull
Parameters
expectedTKeyThe object expected to be in the collection.
collectionImmutableDictionary<TKey, TValue>The collection to be inspected.
Type Parameters
TKeyThe type of the keys of the object to be verified.
TValueThe type of the values of the object to be verified.
Examples
Add an example for this method ?
Contribution guide.
Exceptions
- DoesNotContainException
Thrown when the object is present in the collection
DoesNotContain<TKey, TValue>(TKey, ReadOnlyDictionary<TKey, TValue>)
Verifies that a dictionary does not contain a given key.
public static void DoesNotContain<TKey, TValue>(TKey expected, ReadOnlyDictionary<TKey, TValue> collection) where TKey : notnull
Parameters
expectedTKeyThe object expected to be in the collection.
collectionReadOnlyDictionary<TKey, TValue>The collection to be inspected.
Type Parameters
TKeyThe type of the keys of the object to be verified.
TValueThe type of the values of the object to be verified.
Examples
Add an example for this method ?
Contribution guide.
Exceptions
- DoesNotContainException
Thrown when the object is present in the collection