临时提交2

This commit is contained in:
2025-07-21 18:49:49 +08:00
parent 29a2d44319
commit 525c681b6c
57 changed files with 628 additions and 558 deletions

View File

@@ -10,23 +10,23 @@ namespace DMS.Infrastructure.UnitTests
{
public static class FakerHelper
{
// public static DbDevice FakeDbDevice()
// {
// // var dbDevice = new Faker<DbDevice>()
// // .RuleFor(d => d.Name, f => f.Commerce.ProductName())
// // .RuleFor(d => d.Description, f => f.Commerce.ProductDescription())
// // .RuleFor(d => d.Ip, f => f.Internet.Ip())
// // .Generate();
// // dbDevice.Prot = 102;
// // dbDevice.ProtocolType = Core.Enums.ProtocolType.S7;
// // dbDevice.Slot = 1;
// // dbDevice.Rack = 0;
// // dbDevice.CpuType = S7.Net.CpuType.S71200;
// // dbDevice.DeviceType = Core.Enums.DeviceType.SiemensPLC;
//
//
// return dbDevice;
// }
public static DbDevice FakeDbDevice()
{
var dbDevice = new Faker<DbDevice>()
.RuleFor(d => d.Name, f => f.Commerce.ProductName())
.RuleFor(d => d.Description, f => f.Commerce.ProductDescription())
.RuleFor(d => d.IpAddress, f => f.Internet.Ip())
.RuleFor(d => d.OpcUaServerUrl, f => f.Internet.Url())
.Generate();
dbDevice.Port = 102;
dbDevice.Protocol = ProtocolType.S7;
dbDevice.Slot = 1;
dbDevice.Rack = 0;
dbDevice.CpuType = "S7-1200";
dbDevice.DeviceType = Core.Enums.DeviceType.SiemensPLC;
return dbDevice;
}
// public static DbVariableTable FakeDbVariableTable()
// {