Esempio n. 1
0
 private static DomainValidatorFactory InitValidators(DomainValidatorFactory validatorFactory,
                                                      IComponentContext context)
 {
     return(validatorFactory
            .AddValidator(new CharacteristicValueValidator <NumericCharacteristicValue>())
            .AddValidator(new CharacteristicValueValidator <StringCharacteristicValue>())
            .AddValidator(new CharacteristicValueValidator <BoolCharacteristicValue>())
            .AddValidator(new ComponentCharacteristicValidator <NumericCharacteristic>())
            .AddValidator(new ComponentCharacteristicValidator <StringCharacteristic>())
            .AddValidator(new ComponentCharacteristicValidator <BoolCharacteristic>())
            .AddValidator(new ComponentInterfaceValidator())
            .AddValidator(new PCComponentValidator())
            .AddValidator(new PCConfigurationValidator(
                              context.Resolve <PublishedPCConfigurationSpecification>(),
                              context.Resolve <ISpecificationDetailsInterpreter <IPublishedPCConfigurationCheckDetails> >())));
 }
 public void AddValidator_NullArgument_ShouldThrowArgumentNullException()
 {
     Assert.That(() => _factory.AddValidator <TestType>(null),
                 Throws.InstanceOf <ArgumentNullException>());
 }