public void UnknownSocket_throws_NotSupportedxception() { var socket = new Mock <ISocket>(MockBehavior.Loose).Object; var factory = new MessageFrameReaderFactory(); Assert.Throws <NotSupportedException>(() => factory.CreateReaderFromSocket(socket)); }
public void InProcSocket_maps_to_MessageFrameQueueWriter() { var socket = new InProcSocket(); var factory = new MessageFrameReaderFactory(); var reader = factory.CreateReaderFromSocket(socket); Assert.IsInstanceOf <MessageFrameQueueReader>(reader); }
public void TcpSocket_maps_to_MessageFrameQueueWriter() { var port = TestHelpers.GetFreePort(); var server = new TcpListener(IPAddress.Loopback, port); server.Start(); server.AcceptSocketAsync(); using (var client = new TcpClient()) { client.Connect(IPAddress.Loopback, port); var socket = new TcpSocket(new RedFoxEndpoint(), client); var factory = new MessageFrameReaderFactory(); var reader = factory.CreateReaderFromSocket(socket); Assert.IsInstanceOf <MessageFrameStreamReader>(reader); } }