< Summary

Information
Class: LGDXRobotCloud.Data.Models.DTOs.V1.Commands.RobotCreateDto
Assembly: LGDXRobotCloud.Data
File(s): /builds/yukaitung/lgdxrobot2-cloud/LGDXRobotCloud.Data/Models/DTOs/V1/Commands/RobotCreateDto.cs
Line coverage
0%
Covered lines: 0
Uncovered lines: 5
Coverable lines: 5
Total lines: 34
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_RealmId()100%210%
get_IsRealtimeExchange()100%210%
get_IsProtectingHardwareSerialNumber()100%210%
get_RobotChassisInfo()100%210%

File(s)

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

#LineLine coverage
 1using System.ComponentModel.DataAnnotations;
 2using LGDXRobotCloud.Data.Models.Business.Navigation;
 3
 4namespace LGDXRobotCloud.Data.Models.DTOs.V1.Commands;
 5
 6public record RobotCreateDto
 7{
 8  [MaxLength(50)]
 9  [Required (ErrorMessage = "Please enter a name.")]
 010  public required string Name { get; set; }
 11
 12  [Required (ErrorMessage = "Please select a realm.")]
 013  public required int RealmId { get; set; }
 14
 015  public bool IsRealtimeExchange { get; set; } = false;
 16
 017  public bool IsProtectingHardwareSerialNumber { get; set; } = false;
 18
 019  public required RobotChassisInfoCreateDto RobotChassisInfo { get; set; }
 20}
 21
 22public static class RobotCreateDtoExtensions
 23{
 24  public static RobotCreateBusinessModel ToBusinessModel(this RobotCreateDto model)
 25  {
 26    return new RobotCreateBusinessModel {
 27      Name = model.Name,
 28      RealmId = model.RealmId,
 29      IsRealtimeExchange = model.IsRealtimeExchange,
 30      IsProtectingHardwareSerialNumber = model.IsProtectingHardwareSerialNumber,
 31      RobotChassisInfo = model.RobotChassisInfo.ToBusinessModel()
 32    };
 33  }
 34}