void VerifyValidatorsExist()
{
_MissingValidators.Clear();
Debug.WriteLineWithTimestamp("Verifying each rule has a corresponding validator...");
// We've passed a basic parsing test, let's move on...
// Let's ensure each validator for the ruleset can be loaded.
// We've passed a basic parsing test, let's move
// on to the more complex tests!
foreach (IValidationRule rule in Ruleset.Rules)
{
IValidator validator = null;
Type validatorType = rule.ValidatorType;
if (validatorType != null)
validator = ValidatorActivator.Create(validatorType, ResourceManager, Calendars, iCalendarText);
if (validator == null)
{
_MissingValidators.Add(
new ValidationError(
ResourceManager,
null,
"Validator for rule '" + rule.Name + "' could not be determined!",
ValidationResultInfoType.Error,
true
)
);
}
}
Debug.WriteLineWithTimestamp("Done.");
}