< Summary

Information
Class: MyNet.UI.Toasting.Models.Toast
Assembly: MyNet.UI
File(s): https://raw.githubusercontent.com/sandre58/MyNet/85372080fe102cd9ee155ceab49ae000e7f66103/src/MyNet.UI/Toasting/Models/Toast.cs
Tag: 323_28699572109
Line coverage
100%
Covered lines: 1
Uncovered lines: 0
Coverable lines: 1
Total lines: 37
Line coverage: 100%
Branch coverage
50%
Covered branches: 1
Total branches: 2
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(...)50%22100%

File(s)

https://raw.githubusercontent.com/sandre58/MyNet/85372080fe102cd9ee155ceab49ae000e7f66103/src/MyNet.UI/Toasting/Models/Toast.cs

#LineLine coverage
 1// -----------------------------------------------------------------------
 2// <copyright file="Toast.cs" company="Stéphane ANDRE">
 3// Copyright (c) Stéphane ANDRE. All rights reserved.
 4// </copyright>
 5// -----------------------------------------------------------------------
 6
 7using System.Windows.Input;
 8using MyNet.UI.Notifications.Models;
 9using MyNet.UI.Toasting.Settings;
 10
 11namespace MyNet.UI.Toasting.Models;
 12
 13/// <summary>
 14/// Default immutable toast implementation used by the built-in toast factory.
 15/// </summary>
 16public sealed class Toast(
 17    INotification notification,
 18    ToastSettings? settings = null,
 19    ICommand? clickCommand = null,
 20    ICommand? closeCommand = null) : IToast
 21{
 22    /// <inheritdoc />
 23    public INotification Notification { get; } = notification;
 24
 25    /// <inheritdoc />
 3026    public ToastSettings Settings { get; } = settings ?? ToastSettings.Default;
 27
 28    /// <inheritdoc />
 29    public bool IsVisible { get; } = true;
 30
 31    /// <inheritdoc />
 32    public ICommand? ClickCommand { get; } = clickCommand;
 33
 34    /// <inheritdoc />
 35    public ICommand? CloseCommand { get; } = closeCommand;
 36}
 37