< Summary

Information
Class: LGDXRobotCloud.Data.Models.DTOs.V1.Commands.RobotUpdateDto
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: 3
Coverable lines: 3
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
get_Name()100%210%
get_IsRealtimeExchange()100%210%
get_IsProtectingHardwareSerialNumber()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.")]
 010  public required string Name { get; set; }
 11
 012  public bool IsRealtimeExchange { get; set; } = false;
 13
 014  public bool IsProtectingHardwareSerialNumber { get; set; } = false;
 15}
 16
 17public static class RobotUpdateDtoExtensions
 18{
 19  public static RobotUpdateBusinessModel ToBusinessModel(this RobotUpdateDto model)
 20  {
 21    return new RobotUpdateBusinessModel {
 22      Name = model.Name,
 23      IsRealtimeExchange = model.IsRealtimeExchange,
 24      IsProtectingHardwareSerialNumber = model.IsProtectingHardwareSerialNumber,
 25    };
 26  }
 27}