< Summary

Information
Class: MyNet.Collections.ReadOnlyObservableKeyedCollection<T1, T2>
Assembly: MyNet.Collections
File(s): https://raw.githubusercontent.com/sandre58/MyNet/85372080fe102cd9ee155ceab49ae000e7f66103/src/MyNet.Collections/ReadOnlyObservableKeyedCollection.cs
Tag: 323_28699572109
Line coverage
100%
Covered lines: 2
Uncovered lines: 0
Coverable lines: 2
Total lines: 25
Line coverage: 100%
Branch coverage
N/A
Covered branches: 0
Total branches: 0
Branch coverage: N/A
Method coverage

Feature is only available for sponsors

Upgrade to PRO version

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity Line coverage
.ctor(...)100%11100%
get_Item(...)100%11100%

File(s)

https://raw.githubusercontent.com/sandre58/MyNet/85372080fe102cd9ee155ceab49ae000e7f66103/src/MyNet.Collections/ReadOnlyObservableKeyedCollection.cs

#LineLine coverage
 1// -----------------------------------------------------------------------
 2// <copyright file="ReadOnlyObservableKeyedCollection.cs" company="Stéphane ANDRE">
 3// Copyright (c) Stéphane ANDRE. All rights reserved.
 4// </copyright>
 5// -----------------------------------------------------------------------
 6
 7using System.Collections.ObjectModel;
 8
 9namespace MyNet.Collections;
 10
 11/// <summary>
 12/// Read-only wrapper around <see cref="ObservableKeyedCollection{TKey, T}"/> exposing key lookup.
 13/// </summary>
 14/// <typeparam name="TKey">The type of the key.</typeparam>
 15/// <typeparam name="T">The type of items.</typeparam>
 616public class ReadOnlyObservableKeyedCollection<TKey, T>(ObservableKeyedCollection<TKey, T> list) : ReadOnlyObservableCol
 17    where TKey : notnull
 18{
 19    /// <summary>
 20    /// Gets the item associated with the specified key, or null if not found.
 21    /// </summary>
 22    /// <param name="key">The key of the item to get.</param>
 623    public T? this[TKey key] => ((ObservableKeyedCollection<TKey, T>)Items)[key];
 24}
 25