Пример #1
0
 public IRequestResponseCollection Build()
 {
     _requestResponseCollection = _nSubsituteRequestResponseCollectionFactory
                                  .GetMockRequestResponseCollection();
     _singleRequestResponses
     .ForEach(x => SetUpRequestResponse(
                  x.Item1,
                  x.Item2
                  )
              );
     _doubleRequestResponses
     .ForEach(x => SetUpRequestResponse(
                  x.Item1,
                  x.Item2,
                  x.Item3
                  )
              );
     _trippleRequestResponses
     .ForEach(x => SetUpRequestResponse(
                  x.Item1,
                  x.Item2,
                  x.Item3,
                  x.Item4
                  )
              );
     return(_requestResponseCollection);
 }
 private FakeHardwareComsServer(
     IThreadOperations threadOperations,
     Socket socket, IRequestResponseCollection requestResponseCollection)
 {
     _threadOperations          = threadOperations;
     _socket                    = socket;
     _requestResponseCollection = requestResponseCollection;
 }
 public FakeHardwareComsServer(
     IThreadOperations threadOperations, IRequestResponseCollection requestResponseCollection)
     : this(
         threadOperations,
         new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp), requestResponseCollection)
 {
     _socket.Bind(
         ConfigurationLoader
         .GetTestConfigurationLoader()
         .GetControlLineSettings()
         .GetEndPoint()
         );
 }