< Summary

Information
Class: LGDXRobotCloud.Data.Models.DTOs.V1.Commands.RobotUpdateDtoExtensions
Assembly: LGDXRobotCloud.Data
File(s): /builds/yukaitung/lgdxrobot2-cloud/LGDXRobotCloud.Data/Models/DTOs/V1/Commands/RobotUpdateDto.cs
Line coverage
0%
Covered lines: 0
Uncovered lines: 6
Coverable lines: 6
Total lines: 24
Line coverage: 0%
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
ToBusinessModel(...)100%210%

File(s)

/builds/yukaitung/lgdxrobot2-cloud/LGDXRobotCloud.Data/Models/DTOs/V1/Commands/RobotUpdateDto.cs

#LineLine coverage
 1using System.ComponentModel.DataAnnotations;
 2using LGDXRobotCloud.Data.Models.Business.Navigation;
 3
 4namespace LGDXRobotCloud.Data.Models.DTOs.V1.Commands;
 5
 6public record RobotUpdateDto
 7{
 8  [MaxLength(50)]
 9  [Required (ErrorMessage = "Please enter a name.")]
 10  public required string Name { get; set; }
 11
 12  public bool IsProtectingHardwareSerialNumber { get; set; } = false;
 13}
 14
 15public static class RobotUpdateDtoExtensions
 16{
 17  public static RobotUpdateBusinessModel ToBusinessModel(this RobotUpdateDto model)
 018  {
 019    return new RobotUpdateBusinessModel {
 020      Name = model.Name,
 021      IsProtectingHardwareSerialNumber = model.IsProtectingHardwareSerialNumber,
 022    };
 023  }
 24}