< Summary

Information
Class: Syki.Back.Extensions.ListExtensions
Assembly: Back
File(s): /home/runner/work/syki/syki/Back/Extensions/ListExtensions.cs
Tag: 22_11348620282
Line coverage
60%
Covered lines: 3
Uncovered lines: 2
Coverable lines: 5
Total lines: 19
Line coverage: 60%
Branch coverage
100%
Covered branches: 2
Total branches: 2
Branch coverage: 100%
Method coverage

Feature is only available for sponsors

Upgrade to PRO version

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity Line coverage
GetAverageNote(...)100%22100%
Publish(...)100%210%

File(s)

/home/runner/work/syki/syki/Back/Extensions/ListExtensions.cs

#LineLine coverage
 1using Syki.Back.Events;
 2using Syki.Back.Features.Student.CreateStudentEnrollment;
 3
 4namespace Syki.Back.Extensions;
 5
 6public static class ListExtensions
 7{
 8    public static decimal GetAverageNote(this IEnumerable<ExamGrade> examGrades)
 9    {
 5810        if (examGrades.Count() <= 2) return 0;
 22411        var average = examGrades.Select(x => x.Note).OrderDescending().Take(2).Average();
 5612        return Math.Round(average, 2);
 13    }
 14
 15    public static void Publish(this List<DomainEvent> domainEvents, Guid entityId, object data)
 16    {
 017        domainEvents.Add(new DomainEvent(entityId, data));
 018    }
 19}