< Summary

Information
Class: Amusoft.DotnetNew.Tests.Templating.TemplateInstallationGroup
Assembly: Amusoft.DotnetNew.Tests
File(s): /home/runner/work/Amusoft.DotnetNew.Tests/Amusoft.DotnetNew.Tests/src/Amusoft.DotnetNew.Tests/Templating/TemplateInstallationGroup.cs
Tag: 127_14865883074
Line coverage
100%
Covered lines: 10
Uncovered lines: 0
Coverable lines: 10
Total lines: 43
Line coverage: 100%
Branch coverage
100%
Covered branches: 4
Total branches: 4
Branch coverage: 100%
Method coverage

Feature is only available for sponsors

Upgrade to PRO version

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity Line coverage
.ctor()100%11100%
Add(...)100%11100%
Dispose()75%4.05485.71%

File(s)

/home/runner/work/Amusoft.DotnetNew.Tests/Amusoft.DotnetNew.Tests/src/Amusoft.DotnetNew.Tests/Templating/TemplateInstallationGroup.cs

#LineLine coverage
 1using System;
 2using System.Collections.Generic;
 3using System.Diagnostics.CodeAnalysis;
 4
 5namespace Amusoft.DotnetNew.Tests.Templating;
 6
 7/// <summary>
 8/// Group of installations
 9/// </summary>
 10public class TemplateInstallationGroup : IDisposable
 11{
 312  private List<TemplateInstallation> _installations = new();
 13
 14  /// <summary>
 15  /// Installations which were made
 16  /// </summary>
 17  [ExcludeFromCodeCoverage]
 18  public IReadOnlyList<TemplateInstallation> Installations => _installations;
 19
 20  internal void Add(TemplateInstallation installation)
 21  {
 422    _installations.Add(installation);
 423  }
 24
 25  private bool _disposed;
 26
 27  /// <summary>
 28  /// Dispose
 29  /// </summary>
 30  public void Dispose()
 31  {
 432    if (_disposed)
 133      return;
 334    _disposed = true;
 35
 1436    foreach (var installation in _installations)
 37    {
 438      installation.Dispose();
 39    }
 40
 341    GC.SuppressFinalize(this);
 342  }
 43}