按照软件设计文档开始重构代码01
This commit is contained in:
@@ -10,50 +10,50 @@ 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;
|
||||
// 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 DbVariableTable FakeDbVariableTable()
|
||||
// {
|
||||
// var dbVarTable = new Faker<DbVariableTable>()
|
||||
// .RuleFor(d => d.Name, f => f.Commerce.ProductName())
|
||||
// .RuleFor(d => d.Description, f => f.Commerce.ProductDescription())
|
||||
// .Generate();
|
||||
// dbVarTable.ProtocolType = Core.Enums.ProtocolType.S7;
|
||||
// dbVarTable.IsActive=true;
|
||||
// return dbVarTable;
|
||||
// }
|
||||
|
||||
return dbDevice;
|
||||
}
|
||||
|
||||
public static DbVariableTable FakeDbVariableTable()
|
||||
{
|
||||
var dbVarTable = new Faker<DbVariableTable>()
|
||||
.RuleFor(d => d.Name, f => f.Commerce.ProductName())
|
||||
.RuleFor(d => d.Description, f => f.Commerce.ProductDescription())
|
||||
.Generate();
|
||||
dbVarTable.ProtocolType = Core.Enums.ProtocolType.S7;
|
||||
dbVarTable.IsActive=true;
|
||||
return dbVarTable;
|
||||
}
|
||||
|
||||
public static DbVariable FakeDbVariable()
|
||||
{
|
||||
var dbVariable = new Faker<DbVariable>()
|
||||
.RuleFor(d => d.Name, f => f.Commerce.ProductName())
|
||||
.RuleFor(d => d.Description, f => f.Commerce.ProductDescription())
|
||||
.RuleFor(d => d.S7Address, f => f.Internet.DomainWord())
|
||||
.RuleFor(d => d.DataValue, f => f.Commerce.Price())
|
||||
.Generate();
|
||||
dbVariable.ProtocolType = Core.Enums.ProtocolType.S7;
|
||||
dbVariable.IsActive = true;
|
||||
dbVariable.SignalType=Core.Enums.SignalType.RunSignal;
|
||||
dbVariable.UpdateTime=DateTime.Now;
|
||||
dbVariable.DataType = "String";
|
||||
return dbVariable;
|
||||
}
|
||||
// public static DbVariable FakeDbVariable()
|
||||
// {
|
||||
// var dbVariable = new Faker<DbVariable>()
|
||||
// .RuleFor(d => d.Name, f => f.Commerce.ProductName())
|
||||
// .RuleFor(d => d.Description, f => f.Commerce.ProductDescription())
|
||||
// .RuleFor(d => d.S7Address, f => f.Internet.DomainWord())
|
||||
// .RuleFor(d => d.DataValue, f => f.Commerce.Price())
|
||||
// .Generate();
|
||||
// dbVariable.ProtocolType = Core.Enums.ProtocolType.S7;
|
||||
// dbVariable.IsActive = true;
|
||||
// dbVariable.SignalType=Core.Enums.SignalType.RunSignal;
|
||||
// dbVariable.UpdateTime=DateTime.Now;
|
||||
// dbVariable.DataType = "String";
|
||||
// return dbVariable;
|
||||
// }
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user