c# unit tests using sockets -
I am trying to write a unit test for a server application which requires sockets in C # . To process the request, I need to read from the socket. I can avoid sockets in Java using currents, so when writing a unit test, I can easily convert a string into a stream. // ====== input ====== InputStream socket InputStream = new input stream (socket.getInputStream ()); // InputStream socket input instead of such a string = new bytereinputstream ("string" .getBytes ()); BufferedReader = new BufferedReader (new InputStreamReader (socketInputStream)); // ====== Output ====== OutputStream socketOptputTream = New outputstream (socket. Getoutputstream ()); // I need to write stream BufferedOutputStream Out = new BufferedOutputStream (socketOutputStream) byte []; I just found NetworkStream () but it also requires a socket. How can I get it in C # so that I can make the stream without sockets? And how can I write a stream and read it again to see if the message is correct? ...