public void connected() { //tcpClient(); //Test Exception handling var tcpClient = new TcpClient(); tcpClient.field("m_ClientSocket", null); KO2Log.Last_Exception = null; Assert.IsNull(tcpClient.field("m_ClientSocket")); Assert.IsFalse(tcpClient.connected()); Assert.IsInstanceOf<NullReferenceException>(KO2Log.Last_Exception); }