generated from wenjy/Sln.Iot
You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
114 lines
3.5 KiB
C#
114 lines
3.5 KiB
C#
global using Sln.Iot.Repository.dao;
|
|
global using Xunit;
|
|
using Sln.Iot.Business;
|
|
using Sln.Iot.Common;
|
|
using Sln.Iot.Config;
|
|
using Sln.Iot.PLC;
|
|
using Sln.Iot.Repository;
|
|
using Sln.Iot.Repository.service;
|
|
using System.Collections;
|
|
|
|
namespace Sln.Iot.Test
|
|
{
|
|
public class UnitTest1
|
|
{
|
|
private readonly AppConfig _appConfig = AppConfigSetting.Load();
|
|
|
|
|
|
[Fact]
|
|
public void Test1()
|
|
{
|
|
//PLCÁ¬½Ó³õʼ»¯
|
|
PLCConnect.Instance.InitConnect();
|
|
UnitsProcessPLCDataGetBusiness unitsProcessPLCDataGetBusiness = UnitsProcessPLCDataGetBusiness.Instance;
|
|
|
|
var data1 = unitsProcessPLCDataGetBusiness.Vacuum1PlcDataGet();
|
|
var data2 = unitsProcessPLCDataGetBusiness.Vacuum2PlcDataGet();
|
|
var data3 = unitsProcessPLCDataGetBusiness.PreHeatOvenPlcDataGet();
|
|
var data4 = unitsProcessPLCDataGetBusiness.PreCureOvenPlcDataGet();
|
|
var data5 = unitsProcessPLCDataGetBusiness.CureOvenPlcDataGet();
|
|
|
|
|
|
}
|
|
|
|
[Fact]
|
|
public void Test2()
|
|
{
|
|
string tid = Guid.NewGuid().ToString();
|
|
List<TrayRfidBinding> testDatas = new List<TrayRfidBinding>()
|
|
{
|
|
new TrayRfidBinding()
|
|
{
|
|
GUID = Guid.NewGuid().ToString(),
|
|
TrayCode = "Tray001",
|
|
ProductionCode = "ProdA",
|
|
TransactionID = tid,
|
|
},
|
|
new TrayRfidBinding()
|
|
{
|
|
GUID = Guid.NewGuid().ToString(),
|
|
TrayCode = "Tray002",
|
|
ProductionCode = "ProdB",
|
|
TransactionID = tid,
|
|
},
|
|
new TrayRfidBinding()
|
|
{
|
|
GUID = Guid.NewGuid().ToString(),
|
|
TrayCode = "Tray002",
|
|
ProductionCode = "ProdC",
|
|
TransactionID = tid,
|
|
},
|
|
new TrayRfidBinding()
|
|
{
|
|
GUID = Guid.NewGuid().ToString(),
|
|
TrayCode = "Tray002",
|
|
ProductionCode = "ProdD",
|
|
TransactionID = tid,
|
|
},
|
|
new TrayRfidBinding()
|
|
{
|
|
GUID = Guid.NewGuid().ToString(),
|
|
TrayCode = "Tray003",
|
|
ProductionCode = "ProdE",
|
|
TransactionID = tid,
|
|
},
|
|
|
|
};
|
|
//var ress = SQLiteHelper<TrayRfidBinding>.Instance.InsertRange(testDatas);
|
|
|
|
//var res = SQLiteHelper<TrayRfidBinding>.Instance.DeleteRange("Tray002");
|
|
//Assert.Equal(5, res);
|
|
|
|
|
|
}
|
|
|
|
[Fact]
|
|
public void Test3()
|
|
{
|
|
var ins = OvenPlcDataService.Instance;
|
|
var a = Guid.NewGuid().ToString();
|
|
ins.InsertData(a, 123);
|
|
ins.UpdateDataPreCure(a, new Model.Entity.UnitsProcess3Entity
|
|
{
|
|
PreCureOven1TempActValue = 1233,
|
|
PreCureOven2TempActValue = 1223,
|
|
PreCureOven3TempActValue = 1213,
|
|
PreCureOven4TempActValue = 1203,
|
|
});
|
|
ins.UpdateDataCure(a, new Model.Entity.UnitsProcess3Entity
|
|
{
|
|
CureOven1TempActValue = 1233,
|
|
CureOven2TempActValue = 1223,
|
|
CureOven3TempActValue = 1213,
|
|
CureOven4TempActValue = 1203,
|
|
});
|
|
}
|
|
|
|
[Fact]
|
|
public void Test4()
|
|
{
|
|
var a = _appConfig.IsCFXLog;
|
|
}
|
|
}
|
|
}
|