< Summary

Information
Class: MRA.WebApi.Models.Responses.CollectionResponse
Assembly: MRA.WebApi
File(s): D:\a\MiguelRomerART\MiguelRomerART\MRA.WebApi\Models\Responses\CollectionResponse.cs
Line coverage
100%
Covered lines: 14
Uncovered lines: 0
Coverable lines: 14
Total lines: 31
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
get_Drawings()100%11100%
.ctor(...)100%44100%

File(s)

D:\a\MiguelRomerART\MiguelRomerART\MRA.WebApi\Models\Responses\CollectionResponse.cs

#LineLine coverage
 1using MRA.DTO.Models;
 2
 3namespace MRA.WebApi.Models.Responses;
 4
 5public class CollectionResponse : CollectionModel
 6{
 167    public new IEnumerable<DrawingModel> Drawings { get; set; }
 8
 79    public CollectionResponse(CollectionModel collection)
 10    {
 711        this.Description = collection.Description;
 712        if (collection.Drawings.Any())
 13        {
 614            var drawingIds = collection.DrawingIds.ToList();
 15
 616            this.Drawings = collection.Drawings
 1917                .OrderBy(d => drawingIds.IndexOf(d.Id));
 18        }
 19        else
 20        {
 121            this.Drawings = new List<DrawingModel>();
 22        }
 723        if (collection is not null)
 24        {
 725            this.Id = collection.Id;
 726            this.Name = collection.Name;
 727            this.Order = collection.Order;
 728            this.DrawingIds = collection.DrawingIds;
 29        }
 730    }
 31}