我发现最好的做法是先从错误级别开始,然后启用警告级别,这可以很好地限制验证运行中显示的消息的数量。
I found that it was best to start with errors only, then enable the warning levels as a good way to limit the number of messages shown from the validation run.
在清单10中,我已经创建了一场马拉松,然后继续验证记录确实是在切分1中而非切分0中。
In Listing 10, I've created a marathon and then proceeded to verify that the record is indeed in Shard 1 and not in Shard 0.
例如,我可以写一个验证规则,用于断言指定参数不为null,然后在所有需要同样规则的方法中重用它。
For instance, I could write a validation rule asserting that a given parameter was not null and then reuse it across all methods needing the same rule.
应用推荐