< Summary

Information
Class: MyNet.Primitives.Providers.ItemsProviderBase<T>
Assembly: MyNet.Primitives
File(s): https://raw.githubusercontent.com/sandre58/MyNet/85372080fe102cd9ee155ceab49ae000e7f66103/src/MyNet.Primitives/Providers/ItemsProviderBase.cs
Tag: 323_28699572109
Line coverage
100%
Covered lines: 1
Uncovered lines: 0
Coverable lines: 1
Total lines: 32
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
GetItemsAsync(...)100%11100%

File(s)

https://raw.githubusercontent.com/sandre58/MyNet/85372080fe102cd9ee155ceab49ae000e7f66103/src/MyNet.Primitives/Providers/ItemsProviderBase.cs

#LineLine coverage
 1// -----------------------------------------------------------------------
 2// <copyright file="ItemsProviderBase.cs" company="Stéphane ANDRE">
 3// Copyright (c) Stéphane ANDRE. All rights reserved.
 4// </copyright>
 5// -----------------------------------------------------------------------
 6
 7using System.Collections.Generic;
 8using System.Linq;
 9using System.Threading;
 10
 11namespace MyNet.Primitives.Providers;
 12
 13/// <summary>
 14/// Defines an abstract base class for implementing the <see cref="IItemsProvider{T}"/> interface, providing a default i
 15/// </summary>
 16/// <typeparam name="T">The type of items provided by the implementing class.</typeparam>
 17public abstract class ItemsProviderBase<T> : IItemsProvider<T>
 18{
 19    /// <summary>
 20    /// Provides a collection of items of type T. This method must be implemented by derived classes to return the items
 21    /// </summary>
 22    /// <returns>A collection of items of type T.</returns>
 23    public abstract IEnumerable<T> GetItems();
 24
 25    /// <summary>
 26    /// Asynchronously retrieves a stream of items of type T by converting the collection provided by the <see cref="Get
 27    /// </summary>
 28    /// <param name="cancellationToken">A cancellation token that can be used to cancel the operation.</param>
 29    /// <returns>An asynchronous stream of items of type T.</returns>
 930    public IAsyncEnumerable<T> GetItemsAsync(CancellationToken cancellationToken = default) => GetItems().ToAsyncEnumera
 31}
 32