< Summary

Information
Class: MyNet.UI.Notifications.Models.NotificationBase
Assembly: MyNet.UI
File(s): https://raw.githubusercontent.com/sandre58/MyNet/85372080fe102cd9ee155ceab49ae000e7f66103/src/MyNet.UI/Notifications/Models/NotificationBase.cs
Tag: 323_28699572109
Line coverage
66%
Covered lines: 2
Uncovered lines: 1
Coverable lines: 3
Total lines: 44
Line coverage: 66.6%
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%
ToString()100%210%

File(s)

https://raw.githubusercontent.com/sandre58/MyNet/85372080fe102cd9ee155ceab49ae000e7f66103/src/MyNet.UI/Notifications/Models/NotificationBase.cs

#LineLine coverage
 1// -----------------------------------------------------------------------
 2// <copyright file="NotificationBase.cs" company="Stéphane ANDRE">
 3// Copyright (c) Stéphane ANDRE. All rights reserved.
 4// </copyright>
 5// -----------------------------------------------------------------------
 6
 7using System;
 8using MyNet.Observable;
 9using MyNet.Primitives;
 10using MyNet.UI.Toasting.Settings;
 11
 12namespace MyNet.UI.Notifications.Models;
 13
 14/// <summary>
 15/// Represents the base class for notifications, providing common properties and functionality for all types of notifica
 16/// </summary>
 17/// <param name="message">The message content of the notification.</param>
 18/// <param name="title">The title of the notification.</param>
 19/// <param name="severity">The severity level of the notification.</param>
 16220public abstract class NotificationBase(string message, string? title = "", NotificationSeverity severity = NotificationS
 21    : ObservableObject, INotification, IHasToastSettings
 22{
 23    /// <inheritdoc/>
 24    public Guid Id { get; } = Guid.NewGuid();
 25
 26    /// <inheritdoc/>
 16227    public string Title { get; } = title.OrEmpty();
 28
 29    /// <inheritdoc/>
 30    public string Message { get; } = message;
 31
 32    /// <inheritdoc/>
 33    public NotificationSeverity Severity { get; } = severity;
 34
 35    /// <inheritdoc/>
 36    public DateTime Timestamp { get; } = DateTime.UtcNow;
 37
 38    /// <inheritdoc />
 39    public ToastSettingsOverrides? ToastSettings { get; init; }
 40
 41    /// <inheritdoc/>
 042    public override string ToString() => Message;
 43}
 44