private void Validate(EmailSettings settings) { if (settings == null) { throw new ArgumentNullException(nameof(settings)); } if (!settings.HasRecipients()) { throw new ValidationException("Email has to have at least one recipient."); } if (string.IsNullOrWhiteSpace(DocumentType)) { throw new ArgumentException("Document type has to be specified.", nameof(DocumentType)); } }
public void HasRecipients_Validate(EmailSettings settings, bool expected) { Assert.That(settings.HasRecipients(), Is.EqualTo(expected)); }