I have a socketmanager class that manages my socket communication.
I am trying figure out a game plan on how to test it. Any ideas or patterns out there for unit testing socket communication?
I have 4 events, connected, disconnected, data arrived, and error. A constructor that takes the connection parameters and a connect method that connects to the server.
Do I make a unit test class that instantiates the class and wires up the events then connect to the actual server I am testing. I was hoping I could avoid that as it goes against the whole separation of concerns.
_ClientSocket.BeginReceive(thisSockectPacket.dataBuffer,
0, thisSockectPacket.dataBuffer.Length,
SocketFlags.None,
CallBack,
thisSockectPacket);
How would I mock this?
Thanks in advance.
Bryan