Пример #1
0
        public void ModelWithEmailCollectionAttribute_InvalidModel_ReturnsExpectedResults()
        {
            // Arrange
            var model = new ModelWithEmailCollectionAttribute
            {
                OtherRecipients = new List <string>
                {
                    "ThisIsNotValidEmailAddress",
                }
            };

            // Act
            var result = ModelValidator.Validate(model);

            // Assert
            AssertIsNotValid(result, nameof(model.OtherRecipients), typeof(EmailCollectionAttribute), ValidationType.EmailCollection);
        }
Пример #2
0
        public void ModelWithEmailCollectionAttribute_ValidModel_ReturnsExpectedResults()
        {
            // Arrange
            var model = new ModelWithEmailCollectionAttribute
            {
                OtherRecipients = new List <string>
                {
                    "*****@*****.**",
                    "*****@*****.**"
                }
            };

            // Act
            var result = ModelValidator.Validate(model);

            // Assert
            AssertIsValid(result);
        }