package org.wcs;

import HslCommunication.Core.Types.ActionOperateExTwo;
import HslCommunication.Core.Types.List;
import HslCommunication.ModBus.ModbusTcpServer;
import org.junit.jupiter.api.Test;
import org.springframework.boot.test.context.SpringBootTest;

import java.io.IOException;

@SpringBootTest
class WcsApplicationTests {

	@Test
	void contextLoads() {

		ModbusTcpServer server = new ModbusTcpServer();
		server.OnDataReceived = new ActionOperateExTwo<Object, Object>(){
			public void Action(Object sender, Object[] args) {

			}
		};
		server.OnDataSend = new ActionOperateExTwo<Object, Object>(){
			public void Action(Object sender, Object[] args) {

			}
		};
        try {
            server.ServerStart(502);
        } catch (IOException e) {
            throw new RuntimeException(e);
        }
    }

	@Test
	void testList() {
		List<Integer> list = new List<>();
		list.Add(244546456);
		list.Add(234234234);
		List< Integer> newList = new List<>();
		for (Integer i : list) {
			newList.Add(i);
		}
	}

}
