< Summary

Information
Class: Chronicis.Client.Infrastructure.ConfirmationService
Assembly: Chronicis.Client
File(s): /home/runner/work/chronicis/chronicis/src/Chronicis.Client/Infrastructure/ConfirmationService.cs
Line coverage
100%
Covered lines: 2
Uncovered lines: 0
Coverable lines: 2
Total lines: 34
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
.ctor(...)100%11100%

File(s)

/home/runner/work/chronicis/chronicis/src/Chronicis.Client/Infrastructure/ConfirmationService.cs

#LineLine coverage
 1using Chronicis.Client.Abstractions;
 2using MudBlazor;
 3
 4namespace Chronicis.Client.Infrastructure;
 5
 6/// <summary>
 7/// Implements <see cref="IConfirmationService"/> using MudBlazor's
 8/// <see cref="IDialogService.ShowMessageBox"/> for consistent, styled confirmations.
 9/// </summary>
 10public sealed class ConfirmationService : IConfirmationService
 11{
 12    private readonly IDialogService _dialogService;
 13
 14    public ConfirmationService(IDialogService dialogService)
 15    {
 716        _dialogService = dialogService;
 717    }
 18
 19    /// <inheritdoc />
 20    public async Task<bool> ConfirmAsync(
 21        string title,
 22        string message,
 23        string confirmText = "Confirm",
 24        string cancelText = "Cancel")
 25    {
 26        var result = await _dialogService.ShowMessageBox(
 27            title,
 28            message,
 29            yesText: confirmText,
 30            cancelText: cancelText);
 31
 32        return result == true;
 33    }
 34}

Methods/Properties

.ctor(MudBlazor.IDialogService)