Exemplo n.º 1
0
        public void ModelWithMinCollectionLengthAttribute_InvalidModel_ReturnsExpectedResults()
        {
            // Arrange
            var model = new ModelWithMinCollectionLengthAttribute();

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

            // Assert
            AssertIsNotValid(result, nameof(model.RelatedEntityIds), typeof(MinCollectionLengthAttribute), ValidationType.MinCollectionLength);
        }
Exemplo n.º 2
0
        public void ModelWithMinCollectionLengthAttribute_ValidModel_ReturnsExpectedResults()
        {
            // Arrange
            var model = new ModelWithMinCollectionLengthAttribute
            {
                RelatedEntityIds = new List <int> {
                    1
                }
            };

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

            // Assert
            AssertIsValid(result);
        }