< 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: 7
Coverable lines: 7
Total lines: 27
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 IsRealtimeExchange { get; set; } = false;
 13
 14  public bool IsProtectingHardwareSerialNumber { get; set; } = false;
 15}
 16
 17public static class RobotUpdateDtoExtensions
 18{
 19  public static RobotUpdateBusinessModel ToBusinessModel(this RobotUpdateDto model)
 020  {
 021    return new RobotUpdateBusinessModel {
 022      Name = model.Name,
 023      IsRealtimeExchange = model.IsRealtimeExchange,
 024      IsProtectingHardwareSerialNumber = model.IsProtectingHardwareSerialNumber,
 025    };
 026  }
 27}