Table of Contents

Class DictionaryExtensions

Namespace
Xunit.Internal

INTERNAL CLASS. DO NOT USE.

public static class DictionaryExtensions
Inheritance
DictionaryExtensions
Inherited Members

Methods

AddOrGet<TKey, TValue>(Dictionary<TKey, TValue>, TKey)

public static TValue AddOrGet<TKey, TValue>(this Dictionary<TKey, TValue> dictionary, TKey key) where TKey : notnull where TValue : new()

Parameters

dictionary Dictionary<TKey, TValue>
key TKey

Returns

TValue

Type Parameters

TKey
TValue

AddOrGet<TKey, TValue>(Dictionary<TKey, TValue>, TKey, Func<TValue>)

public static TValue AddOrGet<TKey, TValue>(this Dictionary<TKey, TValue> dictionary, TKey key, Func<TValue> newValue) where TKey : notnull

Parameters

dictionary Dictionary<TKey, TValue>
key TKey
newValue Func<TValue>

Returns

TValue

Type Parameters

TKey
TValue

AddRange<T>(HashSet<T>, IEnumerable<T>)

public static void AddRange<T>(this HashSet<T> hashSet, IEnumerable<T> values)

Parameters

hashSet HashSet<T>
values IEnumerable<T>

Type Parameters

T

Add<TKey, TValue>(Dictionary<TKey, HashSet<TValue>>, TKey, TValue)

public static void Add<TKey, TValue>(this Dictionary<TKey, HashSet<TValue>> dictionary, TKey key, TValue value) where TKey : notnull

Parameters

dictionary Dictionary<TKey, HashSet<TValue>>
key TKey
value TValue

Type Parameters

TKey
TValue

Contains<TKey, TValue>(IReadOnlyDictionary<TKey, IReadOnlyCollection<TValue>>, TKey, TValue, IEqualityComparer<TValue>)

public static bool Contains<TKey, TValue>(this IReadOnlyDictionary<TKey, IReadOnlyCollection<TValue>> dictionary, TKey key, TValue value, IEqualityComparer<TValue> valueComparer) where TKey : notnull

Parameters

dictionary IReadOnlyDictionary<TKey, IReadOnlyCollection<TValue>>
key TKey
value TValue
valueComparer IEqualityComparer<TValue>

Returns

bool

Type Parameters

TKey
TValue

ToReadOnly<TKey, TValue>(Dictionary<TKey, HashSet<TValue>>)

public static IReadOnlyDictionary<TKey, IReadOnlyCollection<TValue>> ToReadOnly<TKey, TValue>(this Dictionary<TKey, HashSet<TValue>> dictionary) where TKey : notnull

Parameters

dictionary Dictionary<TKey, HashSet<TValue>>

Returns

IReadOnlyDictionary<TKey, IReadOnlyCollection<TValue>>

Type Parameters

TKey
TValue

ToReadOnly<TKey, TValue>(Dictionary<TKey, List<TValue>>)

public static IReadOnlyDictionary<TKey, IReadOnlyCollection<TValue>> ToReadOnly<TKey, TValue>(this Dictionary<TKey, List<TValue>> dictionary) where TKey : notnull

Parameters

dictionary Dictionary<TKey, List<TValue>>

Returns

IReadOnlyDictionary<TKey, IReadOnlyCollection<TValue>>

Type Parameters

TKey
TValue

ToReadWrite<TKey, TValue>(IReadOnlyDictionary<TKey, IReadOnlyCollection<TValue>>, IEqualityComparer<TKey>?)

public static Dictionary<TKey, HashSet<TValue>> ToReadWrite<TKey, TValue>(this IReadOnlyDictionary<TKey, IReadOnlyCollection<TValue>> dictionary, IEqualityComparer<TKey>? comparer) where TKey : notnull

Parameters

dictionary IReadOnlyDictionary<TKey, IReadOnlyCollection<TValue>>
comparer IEqualityComparer<TKey>

Returns

Dictionary<TKey, HashSet<TValue>>

Type Parameters

TKey
TValue