public void TryRegex_should_fail() { PropertyValidator <Row> validator = PropertyValidator <Row> .For(x => x.Key); validator .TryRegex("^[a-z0-9\\-]+$") .Validate(new Row() { Key = "key-0123" }); Assert.True(validator.IsValid); }