Ejemplo n.º 1
0
        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));
            }
        }
Ejemplo n.º 2
0
 public void HasRecipients_Validate(EmailSettings settings, bool expected)
 {
     Assert.That(settings.HasRecipients(), Is.EqualTo(expected));
 }