< Summary

Information
Class: Enjoy.Domain.Shared.Primitives.AggregateRoot
Assembly: Enjoy.Domain
File(s): D:\Dotnet\Propuesta-trabajo\Enjoy Project\EnjoyApp\Enjoy\src\Enjoy.Domain\Shared\Primitives\AggregateRoot.cs
Line coverage
100%
Covered lines: 6
Uncovered lines: 0
Coverable lines: 6
Total lines: 19
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%
.ctor()100%11100%
GetDomainEvents()100%11100%
ClearDomainEvents()100%11100%
RaiseDomainEvent(...)100%11100%

File(s)

D:\Dotnet\Propuesta-trabajo\Enjoy Project\EnjoyApp\Enjoy\src\Enjoy.Domain\Shared\Primitives\AggregateRoot.cs

#LineLine coverage
 1using Enjoy.Domain.Shared.Messaging;
 2
 3namespace Enjoy.Domain.Shared.Primitives;
 4
 5public abstract class AggregateRoot : Entity
 6{
 837    private readonly List<IDomainEvent> _domainEvents = [];
 8
 2379    protected AggregateRoot(string id) : base(id) { }
 10
 1211    protected AggregateRoot(): base() { }
 12
 2413    public IReadOnlyCollection<IDomainEvent> GetDomainEvents() => _domainEvents.ToList();
 14
 1715    public void ClearDomainEvents() => _domainEvents.Clear();
 16
 17    protected void RaiseDomainEvent(IDomainEvent domainEvent) =>
 9018        _domainEvents.Add(domainEvent);
 19}