public void Setup() { receivedMessages = new List <IServerToClientMessage>(); loggerMock = MockRepository.GenerateMock <ILogger>(); serverPublihser = new MessagePublisher(loggerMock, new ProtobufSerializer()); clientSubscriber = new ServerMessageSubscriber(loggerMock, new ProtobufSerializer()); var port = TcpHelper.AvailableTcpPort(); serverPublihser.Start(port); Thread.Sleep(100); clientSubscriber.Start("localhost", port, 1, receivedMessages.Add); Thread.Sleep(100); }
public void Setup() { var publishPort = TcpHelper.AvailableTcpPort(); loggerMock = MockRepository.GenerateMock <ILogger>(); // Server messagePublisher = new MessagePublisher(loggerMock, new ProtobufSerializer()); messagePublisher.Start(publishPort); // Client clientMessageConnectionMock = MockRepository.GenerateMock <IMessageConnection>(); clientMessageSubscriber = new ServerMessageSubscriber(loggerMock, new ProtobufSerializer()); client = new ClientApi.Client(clientMessageConnectionMock, clientMessageSubscriber); client.Start(88, "localhost", 9090, publishPort); Thread.Sleep(100); }
public void Setup() { int connectionPort = TcpHelper.AvailableTcpPort(); loggerMock = MockRepository.GenerateMock <ILogger>(); // Server incomingMessageQueueMock = MockRepository.GenerateMock <IIncomingMessageQueue>(); clientMessagePuller = new ClientMessagePuller(loggerMock, new ProtobufSerializer(), incomingMessageQueueMock); clientMessagePuller.Start(connectionPort); Thread.Sleep(500); // Client clientMessageConnection = new MessageConnection(loggerMock, new ProtobufSerializer()); clientMessageConnection.Start("localhost", connectionPort); }