< Summary

Information
Class: Elsa.Common.Models.Page
Assembly: Elsa.Common
File(s): /home/runner/work/elsa-core/elsa-core/src/modules/Elsa.Common/Models/Page.cs
Line coverage
50%
Covered lines: 1
Uncovered lines: 1
Coverable lines: 2
Total lines: 25
Line coverage: 50%
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
Of(...)100%11100%
Empty()100%210%

File(s)

/home/runner/work/elsa-core/elsa-core/src/modules/Elsa.Common/Models/Page.cs

#LineLine coverage
 1namespace Elsa.Common.Models;
 2
 3/// <summary>
 4/// Represents a page of items.
 5/// </summary>
 6/// <param name="Items">The items.</param>
 7/// <param name="TotalCount">The total count.</param>
 8/// <typeparam name="T">The type of the items.</typeparam>
 9public record Page<T>(ICollection<T> Items, long TotalCount);
 10
 11/// <summary>
 12/// Provides a way to create a new instance of the <see cref="Page{T}"/> class.
 13/// </summary>
 14public static class Page
 15{
 16    /// <summary>
 17    /// Creates a new instance of the <see cref="Page{T}"/> class.
 18    /// </summary>
 19    /// <param name="items">The items.</param>
 20    /// <param name="totalCount">The total count.</param>
 21    /// <typeparam name="T">The type of the items.</typeparam>
 22    /// <returns>A new instance of the <see cref="Page{T}"/> class.</returns>
 223    public static Page<T> Of<T>(ICollection<T> items, long totalCount) => new(items, totalCount);
 024    public static Page<T> Empty<T>() => new([], 0);
 25}