Ejemplo n.º 1
0
        public void CanStartInstance()
        {
            // Arrange
            SmtpBeastServerConfig serverConfig = new SmtpBeastServerConfig
            {
                EndPoint = _smtpEndPoint
            };

            using (SmtpBeastServer smtpBeastServer = new SmtpBeastServer(serverConfig))
            {
                // Act
                smtpBeastServer.Start();

                // Assert
                Assert.True(smtpBeastServer.IsStarted);
            }
        }
Ejemplo n.º 2
0
        public void CanCreateSmtpConnectionToInstance()
        {
            // Arrange
            SmtpBeastServerConfig serverConfig = new SmtpBeastServerConfig
            {
                EndPoint = _smtpEndPoint
            };

            using (SmtpBeastServer smtpBeastServer = new SmtpBeastServer(serverConfig))
            {
                smtpBeastServer.Start();

                // Act
                SmtpClient smtpClient = new SmtpClient();

                string result = smtpClient.Connect(new IPAddress(new byte[] { 127, 0, 0, 1 }), _smtpEndPoint.Port);

                Console.WriteLine("result: [{0}]", result);

                // Assert
            }
        }