< Summary

Information
Class: Pomodoro.Web.Models.ImportResult
Assembly: Pomodoro.Web
File(s): /home/runner/work/Pomodoro/Pomodoro/src/Pomodoro.Web/Models/ImportResult.cs
Line coverage
100%
Covered lines: 23
Uncovered lines: 0
Coverable lines: 23
Total lines: 75
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
get_Success()100%11100%
get_ErrorMessage()100%11100%
get_ActivitiesImported()100%11100%
get_ActivitiesSkipped()100%11100%
get_TasksImported()100%11100%
get_TasksSkipped()100%11100%
get_SettingsImported()100%11100%
get_TotalImported()100%11100%
get_TotalSkipped()100%11100%
Failed(...)100%11100%
Succeeded(...)100%11100%

File(s)

/home/runner/work/Pomodoro/Pomodoro/src/Pomodoro.Web/Models/ImportResult.cs

#LineLine coverage
 1namespace Pomodoro.Web.Models;
 2
 3/// <summary>
 4/// Represents the result of an import operation with detailed statistics
 5/// </summary>
 6public class ImportResult
 7{
 8    /// <summary>
 9    /// Indicates whether the import operation was successful
 10    /// </summary>
 15611    public bool Success { get; set; }
 12
 13    /// <summary>
 14    /// Error message if the import failed
 15    /// </summary>
 4016    public string? ErrorMessage { get; set; }
 17
 18    /// <summary>
 19    /// Number of activities that were successfully imported
 20    /// </summary>
 13921    public int ActivitiesImported { get; set; }
 22
 23    /// <summary>
 24    /// Number of activities that were skipped due to duplicates
 25    /// </summary>
 12926    public int ActivitiesSkipped { get; set; }
 27
 28    /// <summary>
 29    /// Number of tasks that were successfully imported
 30    /// </summary>
 13431    public int TasksImported { get; set; }
 32
 33    /// <summary>
 34    /// Number of tasks that were skipped due to duplicates
 35    /// </summary>
 13036    public int TasksSkipped { get; set; }
 37
 38    /// <summary>
 39    /// Indicates whether settings were imported
 40    /// </summary>
 9141    public bool SettingsImported { get; set; }
 42
 43    /// <summary>
 44    /// Total number of records imported (activities + tasks)
 45    /// </summary>
 1246    public int TotalImported => ActivitiesImported + TasksImported;
 47
 48    /// <summary>
 49    /// Total number of records skipped due to duplicates
 50    /// </summary>
 1051    public int TotalSkipped => ActivitiesSkipped + TasksSkipped;
 52
 53    /// <summary>
 54    /// Creates a failed import result with an error message
 55    /// </summary>
 1456    public static ImportResult Failed(string errorMessage) => new()
 1457    {
 1458        Success = false,
 1459        ErrorMessage = errorMessage
 1460    };
 61
 62    /// <summary>
 63    /// Creates a successful import result
 64    /// </summary>
 65    public static ImportResult Succeeded(int activitiesImported, int activitiesSkipped,
 7466        int tasksImported, int tasksSkipped, bool settingsImported) => new()
 7467    {
 7468        Success = true,
 7469        ActivitiesImported = activitiesImported,
 7470        ActivitiesSkipped = activitiesSkipped,
 7471        TasksImported = tasksImported,
 7472        TasksSkipped = tasksSkipped,
 7473        SettingsImported = settingsImported
 7474    };
 75}