< Summary

Information
Class: MyNet.UI.Navigation.Models.NavigationContext
Assembly: MyNet.UI
File(s): https://raw.githubusercontent.com/sandre58/MyNet/85372080fe102cd9ee155ceab49ae000e7f66103/src/MyNet.UI/Navigation/Models/NavigationContext.cs
Tag: 323_28699572109
Line coverage
100%
Covered lines: 1
Uncovered lines: 0
Coverable lines: 1
Total lines: 41
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
Create(...)100%11100%

File(s)

https://raw.githubusercontent.com/sandre58/MyNet/85372080fe102cd9ee155ceab49ae000e7f66103/src/MyNet.UI/Navigation/Models/NavigationContext.cs

#LineLine coverage
 1// -----------------------------------------------------------------------
 2// <copyright file="NavigationContext.cs" company="Stéphane ANDRE">
 3// Copyright (c) Stéphane ANDRE. All rights reserved.
 4// </copyright>
 5// -----------------------------------------------------------------------
 6
 7using System;
 8
 9namespace MyNet.UI.Navigation.Models;
 10
 11/// <summary>
 12/// Represents the context of a navigation operation, including the source and destination pages, navigation mode, param
 13/// </summary>
 14/// <param name="From">The source page of the navigation.</param>
 15/// <param name="To">The destination page of the navigation.</param>
 16/// <param name="Mode">The mode of the navigation.</param>
 17/// <param name="Parameters">The parameters associated with the navigation.</param>
 18/// <param name="Timestamp">The timestamp when the navigation occurred.</param>
 19public sealed record NavigationContext(
 20    INavigationPage? From,
 21    INavigationPage To,
 22    NavigationMode Mode,
 23    INavigationParameters? Parameters,
 24    DateTimeOffset Timestamp)
 25{
 26    /// <summary>
 27    /// Creates a new instance of the NavigationContext record with the specified parameters and the current timestamp.
 28    /// </summary>
 29    /// <param name="from">The source page of the navigation.</param>
 30    /// <param name="to">The destination page of the navigation.</param>
 31    /// <param name="mode">The mode of the navigation.</param>
 32    /// <param name="parameters">The parameters associated with the navigation.</param>
 33    /// <returns>A new instance of the NavigationContext record with the specified parameters and the current timestamp.
 34    public static NavigationContext Create(
 35        INavigationPage? from,
 36        INavigationPage to,
 37        NavigationMode mode,
 38        INavigationParameters? parameters)
 7239        => new(from, to, mode, parameters, DateTimeOffset.UtcNow);
 40}
 41