Support for get BrokenRule Item

Support for get BrokenRule Item

Old forum URL: forums.lhotka.net/forums/t/17.aspx


rasupit posted on Saturday, May 06, 2006

I see GetFirstBrokenRule method to return the first broken rule item for given property but no method to find a specific broken rule item.  This is usefull when writing an NUnit test script, where we can test when a specific broken rule item exist.  Currently you have to iterate through broken rules collection or check for an existance of broken rule message in BrokenRuleCollection.ToString()

The signature could be something like GetBrokenRule(string propertyName, string ruleName) which I think both parameters represent a unique broken rule item within business object.

Using this convinient method in my test script will be like this:

Assert.IsNotNull(Project.GetBrokenRule("Started", "StartDateGTEndDate"), "Expected to trigger broken rule");

Anybody see this will be usefull on other scenario beside test script?

Ricky

NB: it feels so good to be able to post my first message here Party!!! [<:o)]

Copyright (c) Marimer LLC