示例#1
0
 public SmtpServerClientProcessor(ITcpClientController clientController, ILogger logger)
 {
     _clientController          = clientController;
     EmailParser                = new EmailParser();
     RequestCommandsConverter   = new RequestCommandsConverter();
     ServerStatusCodesConverter = new ServerStatusCodesConverter();
     Logger = logger;
 }
        public void Setup()
        {
            _clientController           = Substitute.For <ITcpClientController>();
            _logger                     = Substitute.For <ILogger>();
            _emailParser                = Substitute.For <IEmailParser>();
            _requestCommandsConverter   = Substitute.For <IRequestCommandsConverter>();
            _serverStatusCodesConverter = Substitute.For <IServerStatusCodesConverter>();

            _clientProcessor = new SmtpServerClientProcessor(_clientController, _logger);

            _clientProcessor.EmailParser = _emailParser;
            _clientProcessor.RequestCommandsConverter   = _requestCommandsConverter;
            _clientProcessor.ServerStatusCodesConverter = _serverStatusCodesConverter;

            _clientController.HostName.Returns(_hostName);
        }