< Summary

Information
Class: MyNet.UI.Notifications.Models.DeduplicableMessageNotification
Assembly: MyNet.UI
File(s): https://raw.githubusercontent.com/sandre58/MyNet/85372080fe102cd9ee155ceab49ae000e7f66103/src/MyNet.UI/Notifications/Models/DeduplicableMessageNotification.cs
Tag: 323_28699572109
Line coverage
100%
Covered lines: 4
Uncovered lines: 0
Coverable lines: 4
Total lines: 26
Line coverage: 100%
Branch coverage
50%
Covered branches: 2
Total branches: 4
Branch coverage: 50%
Method coverage

Feature is only available for sponsors

Upgrade to PRO version

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity Line coverage
.ctor(...)100%11100%
IsDuplicateOf(...)50%44100%

File(s)

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

#LineLine coverage
 1// -----------------------------------------------------------------------
 2// <copyright file="DeduplicableMessageNotification.cs" company="Stéphane ANDRE">
 3// Copyright (c) Stéphane ANDRE. All rights reserved.
 4// </copyright>
 5// -----------------------------------------------------------------------
 6
 7using System;
 8
 9namespace MyNet.UI.Notifications.Models;
 10
 11/// <summary>
 12/// Represents a message notification that can be deduplicated based on its content and severity.
 13/// </summary>
 14/// <param name="message">The message content.</param>
 15/// <param name="title">The title of the notification.</param>
 16/// <param name="severity">The severity of the notification.</param>
 17public sealed class DeduplicableMessageNotification(string message, string title = "", NotificationSeverity severity = N
 918    : MessageNotification(message, title, severity), IDeduplicableNotification
 19{
 20    /// <inheritdoc/>
 21    public bool IsDuplicateOf(INotification other) =>
 322        other is MessageNotification m &&
 323        string.Equals(Message, m.Message, StringComparison.OrdinalIgnoreCase) &&
 324        Severity == m.Severity;
 25}
 26