Class ConstructorHistory
Class ConstructorHistory.
Implements the IReadOnlyDictionary<TKey, TValue>
Implements
Inherited Members
Namespace: FastMoq.Models
Assembly: FastMoq.Core.dll
Syntax
public class ConstructorHistory : ILookup<Type, IHistoryModel>, IEnumerable<IGrouping<Type, IHistoryModel>>, IReadOnlyDictionary<Type, ReadOnlyCollection<IHistoryModel>>, IReadOnlyCollection<KeyValuePair<Type, ReadOnlyCollection<IHistoryModel>>>, IEnumerable<KeyValuePair<Type, ReadOnlyCollection<IHistoryModel>>>, IEnumerable<KeyValuePair<Type, IEnumerable<IHistoryModel>>>, IEnumerable
Constructors
ConstructorHistory()
Initializes a new instance of the ConstructorHistory class.
Declaration
public ConstructorHistory()
ConstructorHistory(IDictionary<Type, List<IHistoryModel>>)
Initializes a new instance of the ConstructorHistory class.
Declaration
public ConstructorHistory(IDictionary<Type, List<IHistoryModel>> dictionary)
Parameters
| Type | Name | Description |
|---|---|---|
| IDictionary<Type, List<IHistoryModel>> | dictionary | The dictionary. |
Properties
Count
Gets the count.
Declaration
public int Count { get; }
Property Value
| Type | Description |
|---|---|
| int | The count. |
this[int]
Gets the key value pair of IReadOnlyList{IHistoryModel} at the specified index.
Declaration
public KeyValuePair<Type, IReadOnlyList<IHistoryModel>> this[int index] { get; }
Parameters
| Type | Name | Description |
|---|---|---|
| int | index | The index. |
Property Value
| Type | Description |
|---|---|
| KeyValuePair<Type, IReadOnlyList<IHistoryModel>> | System.Collections.Generic.KeyValuePair<System.Type, System.Collections.Generic.IReadOnlyList< FastMoq.Models.IHistoryModel>>. |
this[Type]
Gets the IEnumerable<T> sequence of values indexed by a specified key.
Declaration
public IEnumerable<IHistoryModel> this[Type key] { get; }
Parameters
| Type | Name | Description |
|---|---|---|
| Type | key | The key of the desired sequence of values. |
Property Value
| Type | Description |
|---|---|
| IEnumerable<IHistoryModel> | The IEnumerable<T> sequence of values indexed by the specified key. |
Keys
Gets an enumerable collection that contains the keys in the read-only dictionary.
Declaration
public IEnumerable<Type> Keys { get; }
Property Value
| Type | Description |
|---|---|
| IEnumerable<Type> | An enumerable collection that contains the keys in the read-only dictionary. |
Values
Gets the values.
Declaration
public IEnumerable<IReadOnlyList<IHistoryModel>> Values { get; }
Property Value
| Type | Description |
|---|---|
| IEnumerable<IReadOnlyList<IHistoryModel>> | The values. |
Methods
AsEnumerable()
Converts to list.
Declaration
public IEnumerable<KeyValuePair<Type, IEnumerable<IHistoryModel>>> AsEnumerable()
Returns
| Type | Description |
|---|---|
| IEnumerable<KeyValuePair<Type, IEnumerable<IHistoryModel>>> |
AsLookup()
Converts to a Lookup.
Declaration
public ILookup<Type, IHistoryModel> AsLookup()
Returns
| Type | Description |
|---|---|
| ILookup<Type, IHistoryModel> |
AsReadOnlyDictionary()
Converts to read only dictionary.
Declaration
public IReadOnlyDictionary<Type, ReadOnlyCollection<IHistoryModel>> AsReadOnlyDictionary()
Returns
| Type | Description |
|---|---|
| IReadOnlyDictionary<Type, ReadOnlyCollection<IHistoryModel>> |
Contains(Type)
Determines whether a specified key exists in the ILookup<TKey, TElement>.
Declaration
public bool Contains(Type key)
Parameters
| Type | Name | Description |
|---|---|---|
| Type | key | The key to search for in the ILookup<TKey, TElement>. |
Returns
| Type | Description |
|---|---|
| bool | true if |
ContainsKey(Type)
Determines whether the read-only dictionary contains an element that has the specified key.
Declaration
public bool ContainsKey(Type key)
Parameters
| Type | Name | Description |
|---|---|---|
| Type | key | The key to locate. |
Returns
| Type | Description |
|---|---|
| bool | true if the read-only dictionary contains an element that has the specified key; otherwise, false. |
Exceptions
| Type | Condition |
|---|---|
| ArgumentNullException |
|
GetConstructor(Type)
Gets the constructor.
Declaration
public ConstructorInfo? GetConstructor(Type type)
Parameters
| Type | Name | Description |
|---|---|---|
| Type | type | The type. |
Returns
| Type | Description |
|---|---|
| ConstructorInfo | System ofReflection ofConstructorInfo? of the constructor. |
GetEnumerator()
Returns an enumerator that iterates through the collection.
Declaration
public IEnumerator<KeyValuePair<Type, IEnumerable<IHistoryModel>>> GetEnumerator()
Returns
| Type | Description |
|---|---|
| IEnumerator<KeyValuePair<Type, IEnumerable<IHistoryModel>>> | An enumerator that can be used to iterate through the collection. |
TryGetValue(Type, out ReadOnlyCollection<IHistoryModel>)
Gets the value that is associated with the specified key.
Declaration
public bool TryGetValue(Type key, out ReadOnlyCollection<IHistoryModel> value)
Parameters
| Type | Name | Description |
|---|---|---|
| Type | key | The key to locate. |
| ReadOnlyCollection<IHistoryModel> | value | When this method returns, the value associated with the specified key, if the key is found; otherwise, the default value for the type of the |
Returns
| Type | Description |
|---|---|
| bool | true if the object that implements the IReadOnlyDictionary<TKey, TValue> interface contains an element that has the specified key; otherwise, false. |
Exceptions
| Type | Condition |
|---|---|
| ArgumentNullException |
|