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.
75 lines
2.2 KiB
C#
75 lines
2.2 KiB
C#
global using Xunit;
|
|
global using Sln.Iot.Repository.dao;
|
|
using Sln.Iot.Repository;
|
|
using Sln.Iot.Repository.service;
|
|
using System.Collections;
|
|
|
|
namespace Sln.Iot.Test
|
|
{
|
|
public class UnitTest1
|
|
{
|
|
[Fact]
|
|
public void Test1()
|
|
{
|
|
byte[] bytes = new byte[] { 0, 1, 2, 4, 8, 16, 32, 64, 128, 255 };
|
|
|
|
BitArray bits = new BitArray(bytes);
|
|
|
|
bool[] bools = new bool[bits.Count];
|
|
bits.CopyTo(bools, 0);
|
|
|
|
|
|
}
|
|
|
|
[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);
|
|
|
|
|
|
}
|
|
}
|
|
} |