public void OneTimeSetUp() { this.connectionState = false; this.tcpListenerComPort = new TcpListenerComPort(new TcpListenerComPortConfigInfo() { LocalIPAddress = "127.0.0.1", LocalPort = 8080, ReceiveTimeout = 500, SendTimeout = 500 }, TcpListenerComPortType.One2One, Substitute.For <ILoggerFactory>()); this.tcpListenerComPort.ConnectionStateChanged += (sender, e) => connectionState = e.IsConnected;; this.tcpListenerComPort.TcpClientAccepted += (sender, e) => tcpClientInfo = e.TcpClientInfo; this.tcpClient = new TcpClient(); }