mirror of
https://github.com/zhaopeiym/IoTClient
synced 2025-10-19 22:14:31 +08:00
36 lines
775 B
C#
36 lines
775 B
C#
using IoTServer.Common;
|
|
using IoTServer.Servers.Modbus;
|
|
using IoTServer.Servers.PLC;
|
|
using System.Threading.Tasks;
|
|
using Xunit;
|
|
|
|
namespace IoTClient.Tests.Server_tests
|
|
{
|
|
public class ModbusTcpServer_test
|
|
{
|
|
public ModbusTcpServer_test()
|
|
{
|
|
DataPersist.LoadData();
|
|
}
|
|
|
|
[Fact]
|
|
public async Task StartAsync()
|
|
{
|
|
ModbusTcpServer server = new ModbusTcpServer(int.Parse("LocalPort".GetConfig()));
|
|
|
|
server.Start();
|
|
|
|
await Task.Delay(1000 * 1000);
|
|
}
|
|
|
|
[Fact]
|
|
public async Task SiemensServerAsync()
|
|
{
|
|
SiemensServer server = new SiemensServer(102);
|
|
server.Start();
|
|
|
|
await Task.Delay(1000 * 1000);
|
|
}
|
|
}
|
|
}
|