コード例 #1
0
        public void GetValidationResult_Should_ReturnValid()
        {
            var attribute = new SlugAttribute();

            var result = attribute.GetValidationResult("test-slug-10", new ValidationContext(this));

            result.Should().BeNull();
        }
コード例 #2
0
        public void GetValidationResult_Should_ReturnInvalid_ForStringWithInvalidChar()
        {
            var attribute = new SlugAttribute();

            var result = attribute.GetValidationResult("test:slug", new ValidationContext(this));

            result.ErrorMessage.Should().NotBeNull();
        }