< Summary

Information
Class: LGDXRobotCloud.Data.Models.Business.Navigation.RobotBusinessModelExtensions
Assembly: LGDXRobotCloud.Data
File(s): /builds/yukaitung/lgdxrobot2-cloud/LGDXRobotCloud.Data/Models/Business/Navigation/RobotBusinessModel.cs
Line coverage
0%
Covered lines: 0
Uncovered lines: 16
Coverable lines: 16
Total lines: 49
Line coverage: 0%
Branch coverage
0%
Covered branches: 0
Total branches: 4
Branch coverage: 0%
Method coverage

Feature is only available for sponsors

Upgrade to PRO version

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity Line coverage
ToDto(...)0%2040%

File(s)

/builds/yukaitung/lgdxrobot2-cloud/LGDXRobotCloud.Data/Models/Business/Navigation/RobotBusinessModel.cs

#LineLine coverage
 1using LGDXRobotCloud.Data.Models.Business.Administration;
 2using LGDXRobotCloud.Data.Models.Business.Automation;
 3using LGDXRobotCloud.Data.Models.DTOs.V1.Responses;
 4
 5namespace LGDXRobotCloud.Data.Models.Business.Navigation;
 6
 7public record RobotBusinessModel
 8{
 9  public required Guid Id { get; set; }
 10
 11  public required string Name { get; set; }
 12
 13  public required int RealmId { get; set; }
 14
 15  public required string RealmName { get; set; }
 16
 17  public required bool IsRealtimeExchange { get; set; }
 18
 19  public required bool IsProtectingHardwareSerialNumber { get; set; }
 20
 21  public required RobotCertificateBusinessModel RobotCertificate { get; set; }
 22
 23  public RobotSystemInfoBusinessModel? RobotSystemInfo { get; set; }
 24
 25  public RobotChassisInfoBusinessModel? RobotChassisInfo { get; set; }
 26
 27  public required IEnumerable<AutoTaskListBusinessModel> AssignedTasks { get; set; } = [];
 28}
 29
 30public static class RobotBusinessModelExtensions
 31{
 32  public static RobotDto ToDto(this RobotBusinessModel robot)
 033  {
 034    return new RobotDto {
 035      Id = robot.Id,
 036      Name = robot.Name,
 037      Realm = new RealmSearchDto {
 038        Id = robot.RealmId,
 039        Name = robot.RealmName,
 040      },
 041      IsRealtimeExchange = robot.IsRealtimeExchange,
 042      IsProtectingHardwareSerialNumber = robot.IsProtectingHardwareSerialNumber,
 043      RobotCertificate = robot.RobotCertificate.ToDto(),
 044      RobotSystemInfo = robot.RobotSystemInfo?.ToDto(),
 045      RobotChassisInfo = robot.RobotChassisInfo?.ToDto(),
 046      AssignedTasks = robot.AssignedTasks.Select(a => a.ToDto()).ToList(),
 047    };
 048  }
 49}