示例#1
0
        public void Validate_property_by_name_with_zero_should_be_valid()
        {
            var target = new CustomerEntity {
                Id = 0, Name = "Mat"
            };

            Assert.IsTrue(target.ValidatePropertyByName("Id"));
        }
示例#2
0
        public void Validate_property_by_name_with_negative_integer_should_be_invalid()
        {
            var target = new CustomerEntity {
                Id = -1, Name = "Mat"
            };

            Assert.IsFalse(target.ValidatePropertyByName("Id"));
            Assert.IsTrue(target.ValidationErrors.Count > 0);
        }