public void Build_NullLocalIpEndPoint_ThrowsValidationException( )
 {
     Should.Throw <ValidationException>(
         () => ServerBuilder <string> .CreateNew( )
         .SetLocalIpEndPoint(null)
         .SetFormatterType(null)
         .SetCompressType(null)
         .SetLogger(null)
         .Build( ));
 }
示例#2
0
        private void Setup( )
        {
            var logger = new FormLogger( );

            _server = ServerBuilder <SocketCommandModel> .CreateNew( )
                      .SetLocalIpEndPoint(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))
                      .SetLogger(logger)
                      .Build( );

            logger.OnLog += Logger_OnLog;
            _server.OnCommandModelReceived += Server_OnSocketCommandRecevied;
        }