/// <summary> /// Initializes a new instance of the <see cref="ValidXmlElementsValidator"/> class. /// </summary> /// <param name="identifyXmlElementsService">The identify XML elements service.</param> /// <exception cref="ArgumentNullException">identifyXmlElementsService</exception> public ValidXmlElementsValidator(IIdentifyXmlElementsService identifyXmlElementsService) { if (identifyXmlElementsService == null) { throw new ArgumentNullException(nameof(identifyXmlElementsService)); } _identifyXmlElementsService = identifyXmlElementsService; }
protected TestBase() { _validationRepository = Substitute.For <IValidationRepository>(); _identifyXmlElementsService = new IdentifyXmlElementsService(); _containsXmlElementsValidator = new ContainsXmlElementsValidator(_identifyXmlElementsService); _noMissingXmlElementsValidator = new NoMissingXmlElementsValidator(_identifyXmlElementsService); _validXmlElementsValidator = new ValidXmlElementsValidator(_identifyXmlElementsService); _mandatoryXmlElementsValidator = new MandatoryXmlElementsValidator(_identifyXmlElementsService, _validationRepository); _xmlValidationFactory = new XmlValidationFactory(_identifyXmlElementsService, _validationRepository); _xmlDeserializerService = new XmlDeserializerService(); _expenseService = new ExpenseService(_xmlValidationFactory, _identifyXmlElementsService, _xmlDeserializerService); }
/// <summary> /// Initializes a new instance of the <see cref="XmlValidationFactory"/> class. /// </summary> /// <param name="identifyXmlElementsService">The identify XML elements service.</param> /// <param name="validationRepository">The validation repository.</param> /// <exception cref="ArgumentNullException"> /// identifyXmlElementsService /// or /// validationRepository /// </exception> public XmlValidationFactory(IIdentifyXmlElementsService identifyXmlElementsService, IValidationRepository validationRepository) { if (identifyXmlElementsService == null) { throw new ArgumentNullException(nameof(identifyXmlElementsService)); } if (validationRepository == null) { throw new ArgumentNullException(nameof(validationRepository)); } _identifyXmlElementsService = identifyXmlElementsService; _validationRepository = validationRepository; }
/// <summary> /// Initializes a new instance of the <see cref="ExpenseService"/> class. /// </summary> /// <param name="xmlValidationFactory">The XML validation factory.</param> /// <param name="identifyXmlElementsService">The identify XML elements service.</param> /// <param name="xmlDeserializerService">The XML deserializer service.</param> /// <exception cref="ArgumentNullException"> /// xmlValidationFactory /// or /// identifyXmlElementsService /// or /// xmlDeserializerService /// </exception> public ExpenseService(IXmlValidationFactory xmlValidationFactory, IIdentifyXmlElementsService identifyXmlElementsService, IXmlDeserializerService xmlDeserializerService) { if (xmlValidationFactory == null) { throw new ArgumentNullException(nameof(xmlValidationFactory)); } if (identifyXmlElementsService == null) { throw new ArgumentNullException(nameof(identifyXmlElementsService)); } if (xmlDeserializerService == null) { throw new ArgumentNullException(nameof(xmlDeserializerService)); } _xmlValidationFactory = xmlValidationFactory; _identifyXmlElementsService = identifyXmlElementsService; _xmlDeserializerService = xmlDeserializerService; }