< Summary

Line coverage
98%
Covered lines: 66
Uncovered lines: 1
Coverable lines: 67
Total lines: 94
Line coverage: 98.5%
Branch coverage
87%
Covered branches: 7
Total branches: 8
Branch coverage: 87.5%
Method coverage

Feature is only available for sponsors

Upgrade to PRO version

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity Line coverage
FromWorkIdDto(...)100%11100%
ToDto(...)83.33%6696.55%
ProjectToDto(...)100%11100%
MapToWorkIdentifier(...)100%11100%
MapToListOfWorkIdentifier(...)100%22100%

File(s)

/home/runner/work/ProjectRead.ing/ProjectRead.ing/Api/obj/Debug/net10.0/generated/Riok.Mapperly/Riok.Mapperly.MapperGenerator/WorkMapper.g.cs

#LineLine coverage
 1// <auto-generated />
 2#nullable enable
 3namespace Api.Works.Queries
 4{
 5    public static partial class WorkMapper
 6    {
 7        [global::System.CodeDom.Compiler.GeneratedCode("Riok.Mapperly", "4.3.1.0")]
 8        public static partial global::Api.Works.Models.WorkIdentifier FromWorkIdDto(global::Api.Works.Queries.WorkIdenti
 19        {
 110            var target = new global::Api.Works.Models.WorkIdentifier(w.WorkIdentifierType, w.WorkIdentifierValue);
 111            return target;
 112        }
 13
 14        [global::System.CodeDom.Compiler.GeneratedCode("Riok.Mapperly", "4.3.1.0")]
 15        [return: global::System.Diagnostics.CodeAnalysis.NotNullIfNotNull(nameof(w))]
 16        public static partial global::Api.Works.Queries.Work? ToDto(global::Api.Works.Models.Work? w)
 117        {
 118            if (w == null)
 019                return default;
 120            var target = new global::Api.Works.Queries.Work()
 121            {
 122                Title = w.Title,
 123            };
 124            target.Id = w.Id;
 125            target.RowVersion = w.RowVersion;
 126            target.MetadataAddedAt = w.MetadataAddedAt;
 127            target.MetadataUpdatedAt = w.MetadataUpdatedAt;
 128            target.Description = w.Description;
 129            if (w.WorkPublishedAt != null)
 130            {
 131                target.WorkPublishedAt = w.WorkPublishedAt.Value.ToInstant();
 132            }
 33            else
 134            {
 135                target.WorkPublishedAt = null;
 136            }
 137            if (w.WorkUpdatedAt != null)
 138            {
 139                target.WorkUpdatedAt = w.WorkUpdatedAt.Value.ToInstant();
 140            }
 41            else
 142            {
 143                target.WorkUpdatedAt = null;
 144            }
 145            target.WorkIdentifiers = MapToListOfWorkIdentifier(w.WorkIdentifiers);
 146            return target;
 147        }
 48
 49        [global::System.CodeDom.Compiler.GeneratedCode("Riok.Mapperly", "4.3.1.0")]
 50        public static partial global::System.Linq.IQueryable<global::Api.Works.Queries.Work> ProjectToDto(this global::S
 151        {
 52#nullable disable
 153            return global::System.Linq.Queryable.Select(
 154                q,
 155                x => new global::Api.Works.Queries.Work()
 156                {
 157                    Id = x.Id,
 158                    RowVersion = x.RowVersion,
 159                    MetadataAddedAt = x.MetadataAddedAt,
 160                    MetadataUpdatedAt = x.MetadataUpdatedAt,
 161                    Title = x.Title,
 162                    Description = x.Description,
 163                    WorkPublishedAt = x.WorkPublishedAt != null ? x.WorkPublishedAt.Value.ToInstant() : default(global::
 164                    WorkUpdatedAt = x.WorkUpdatedAt != null ? x.WorkUpdatedAt.Value.ToInstant() : default(global::NodaTi
 165                    WorkIdentifiers = global::System.Linq.Enumerable.ToList(
 166                        global::System.Linq.Enumerable.Select(
 167                            x.WorkIdentifiers,
 168                            x1 => new global::Api.Works.Queries.WorkIdentifier(x1.WorkIdentifierType, x1.WorkIdentifierV
 169                        )
 170                    ),
 171                }
 172            );
 73#nullable enable
 174        }
 75
 76        [global::System.CodeDom.Compiler.GeneratedCode("Riok.Mapperly", "4.3.1.0")]
 77        private static global::Api.Works.Queries.WorkIdentifier MapToWorkIdentifier(global::Api.Works.Models.WorkIdentif
 178        {
 179            var target = new global::Api.Works.Queries.WorkIdentifier(source.WorkIdentifierType, source.WorkIdentifierVa
 180            return target;
 181        }
 82
 83        [global::System.CodeDom.Compiler.GeneratedCode("Riok.Mapperly", "4.3.1.0")]
 84        private static global::System.Collections.Generic.List<global::Api.Works.Queries.WorkIdentifier> MapToListOfWork
 185        {
 186            var target = new global::System.Collections.Generic.List<global::Api.Works.Queries.WorkIdentifier>(source.Co
 187            foreach (var item in source)
 188            {
 189                target.Add(MapToWorkIdentifier(item));
 190            }
 191            return target;
 192        }
 93    }
 94}