Exemplo n.º 1
0
 public void Build_NullRemoteIpEndPoint_ThrowsValidationException( )
 {
     Should.Throw <ValidationException>(
         () => ClientBuilder <string> .CreateNew( )
         .SetLocalIpEndPoint(new IPEndPoint(IPAddress.Parse("127.0.0.1"), 8000))
         .SetRemoteIpEndPoint(null)
         .SetFormatterType(null)
         .SetCompressType(null)
         .SetTimeoutTime(5000)
         .SetLogger(null)
         .Build( ));
 }
Exemplo n.º 2
0
        private void Setup( )
        {
            var logger = new FormLogger( );

            _client = ClientBuilder <SocketCommandModel> .CreateNew( )
                      .SetLocalIpEndPoint(new IPEndPoint(IPAddress.Parse("127.0.0.1"), 8001))
                      .SetRemoteIpEndPoint(new IPEndPoint(IPAddress.Parse("127.0.0.1"), 8000))
                      .SetFormatterType(( FormatterType? )Enum.Parse(typeof(FormatterType),
                                                                     ( string )mcbFormatter.SelectedItem))
                      .SetCompressType(( CompressType? )Enum.Parse(typeof(CompressType),
                                                                   ( string )mcbCompressor.SelectedItem))
                      .SetTimeoutTime(2000)
                      .SetLogger(logger)
                      .Build( );

            logger.OnLog += Logger_OnLog;
            _client.OnCommandModelReceived += Client_OnAckCommandReceived;
        }