< Summary

Information
Class: Syki.Shared.CreateAcademicPeriodIn
Assembly: Shared
File(s): /home/runner/work/syki/syki/Shared/Features/Academic/CreateAcademicPeriod/CreateAcademicPeriodIn.cs
Tag: 22_11348620282
Line coverage
100%
Covered lines: 13
Uncovered lines: 0
Coverable lines: 13
Total lines: 21
Line coverage: 100%
Branch coverage
100%
Covered branches: 6
Total branches: 6
Branch coverage: 100%
Method coverage

Feature is only available for sponsors

Upgrade to PRO version

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity Line coverage
get_Id()100%11100%
get_StartAt()100%11100%
get_EndAt()100%11100%
.ctor()100%11100%
.ctor(...)100%66100%

File(s)

/home/runner/work/syki/syki/Shared/Features/Academic/CreateAcademicPeriod/CreateAcademicPeriodIn.cs

#LineLine coverage
 1namespace Syki.Shared;
 2
 3public class CreateAcademicPeriodIn
 4{
 14965    public string? Id { get; set; }
 17306    public DateOnly StartAt { get; set; }
 17307    public DateOnly EndAt { get; set; }
 8
 10049    public CreateAcademicPeriodIn() {}
 10
 24111    public CreateAcademicPeriodIn(string id)
 12    {
 24113        Id = id;
 24114        var numbers = id.OnlyNumbers();
 24815        if (numbers.Length != 5) return;
 23416        var year = int.Parse(numbers.Substring(0, 4));
 23417        var digit = int.Parse(numbers.Substring(4, 1));
 23418        StartAt = digit == 1 ? new DateOnly(year, 02, 01) : new DateOnly(year, 06, 01);
 23419        EndAt = digit == 1 ? new DateOnly(year, 07, 01) : new DateOnly(year, 12, 01);
 23420    }
 21}