Table of Contents

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

expected TKey

The object expected to be in the collection.

collection ConcurrentDictionary<TKey, TValue>

The collection to be inspected.

Returns

TValue

The value associated with expected.

Type Parameters

TKey

The type of the keys of the object to be verified.

TValue

The 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

expected TKey

The object expected to be in the collection.

collection Dictionary<TKey, TValue>

The collection to be inspected.

Returns

TValue

The value associated with expected.

Type Parameters

TKey

The type of the keys of the object to be verified.

TValue

The 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

expected TKey

The object expected to be in the collection.

collection IDictionary<TKey, TValue>

The collection to be inspected.

Returns

TValue

The value associated with expected.

Type Parameters

TKey

The type of the keys of the object to be verified.

TValue

The 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

expected TKey

The object expected to be in the collection.

collection IReadOnlyDictionary<TKey, TValue>

The collection to be inspected.

Returns

TValue

The value associated with expected.

Type Parameters

TKey

The type of the keys of the object to be verified.

TValue

The 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

expected TKey

The object expected to be in the collection.

collection ImmutableDictionary<TKey, TValue>

The collection to be inspected.

Returns

TValue

The value associated with expected.

Type Parameters

TKey

The type of the keys of the object to be verified.

TValue

The 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

expected TKey

The object expected to be in the collection.

collection ReadOnlyDictionary<TKey, TValue>

The collection to be inspected.

Returns

TValue

The value associated with expected.

Type Parameters

TKey

The type of the keys of the object to be verified.

TValue

The 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

expected TKey

The object expected to be in the collection.

collection ConcurrentDictionary<TKey, TValue>

The collection to be inspected.

Type Parameters

TKey

The type of the keys of the object to be verified.

TValue

The 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

expected TKey

The object expected to be in the collection.

collection Dictionary<TKey, TValue>

The collection to be inspected.

Type Parameters

TKey

The type of the keys of the object to be verified.

TValue

The 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

expected TKey

The object expected to be in the collection.

collection IDictionary<TKey, TValue>

The collection to be inspected.

Type Parameters

TKey

The type of the keys of the object to be verified.

TValue

The 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

expected TKey

The object expected to be in the collection.

collection IReadOnlyDictionary<TKey, TValue>

The collection to be inspected.

Type Parameters

TKey

The type of the keys of the object to be verified.

TValue

The 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

expected TKey

The object expected to be in the collection.

collection ImmutableDictionary<TKey, TValue>

The collection to be inspected.

Type Parameters

TKey

The type of the keys of the object to be verified.

TValue

The 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

expected TKey

The object expected to be in the collection.

collection ReadOnlyDictionary<TKey, TValue>

The collection to be inspected.

Type Parameters

TKey

The type of the keys of the object to be verified.

TValue

The 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