Exemplo n.º 1
0
        public void WhenNoServerProvided_ShouldThrowArgumentNullException()
        {
            //Arrange
            var smtp = new SMTPBuilder()
                       .WithPort(AppConsts.SMTP_PORT_MIN)
                       .WithTimeout(AppConsts.SMTP_TIMEOUT_MIN)
                       .Build();
            var validator = this.Context.Build();

            //Act / Assert
            Assert.That(() => validator.ValidateAsync(smtp), Throws.ArgumentNullException);
        }
Exemplo n.º 2
0
        public void WhenNoTimeoutProvided_ShouldThrowArgumentNullException()
        {
            //Arrange
            var smtp = new SMTPBuilder()
                       .WithServer("server")
                       .WithPort(AppConsts.SMTP_PORT_MIN)
                       .Build();
            var validator = this.Context.Build();

            //Act / Assert
            Assert.That(() => validator.ValidateAsync(smtp), Throws.InstanceOf <ArgumentOutOfRangeException>());
        }
Exemplo n.º 3
0
        public void WhenSMTPProvided_ShouldThrowNothing()
        {
            //Arrange
            var smtp = new SMTPBuilder()
                       .WithServer("server")
                       .WithPort(AppConsts.SMTP_PORT_MIN)
                       .WithTimeout(AppConsts.SMTP_TIMEOUT_MIN)
                       .Build();
            var validator = this.Context.Build();

            //Act / Assert
            Assert.That(() => validator.ValidateAsync(smtp), Throws.Nothing);
        }