コード例 #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);
        }
コード例 #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>());
        }
コード例 #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);
        }