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); }
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>()); }
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); }