public void SetUp() { this.mockery = new Mockery(); this.validationFactory = this.mockery.NewMock<IValidationFactory>(); Stub.On(this.validationFactory).Method("CreateValidationResult").With(true).Will(Return.Value(new ValidationResult(true))); Stub.On(this.validationFactory).Method("CreateValidationResult").With(false).Will(Return.Value(new ValidationResult(false))); }
public RefreshValidationEventHandler(IReadService <DynamicMetadataDefinition> metadataReadService, IReadService <Movie> movieReadService, IWriteService <Movie> movieWriteService, IValidationFactory validationFactory) { _metadataReadService = metadataReadService; _movieReadService = movieReadService; _movieWriteService = movieWriteService; _validationFactory = validationFactory; }
public void SetUp() { this.mockery = new Mockery(); // mock rule validationFactory this.validationFactory = this.mockery.NewMock <IValidationFactory>(); IValidationResult aggregatedValidationResult = new ValidationResult(true); Stub.On(this.validationFactory).Method("CreateValidationResult").With(true).Will( Return.Value(aggregatedValidationResult)); Stub.On(this.validationFactory).Method("CreateRuleSet").Will(Return.Value(new ValidationRuleSet())); // mock rules providers this.defaultRulesProvider = this.mockery.NewMock <IRulesProvider>(); this.pluginRulesProvider = this.mockery.NewMock <IRulesProvider>(); // mock rules provider finder this.rulesProviderFinder = this.mockery.NewMock <IRulesProviderFinder>(); Stub.On(this.rulesProviderFinder).Method("FindRulesProviders").Will( Return.Value(new List <IRulesProvider> { this.defaultRulesProvider, this.pluginRulesProvider })); // create testee this.testee = new RuleEngine(this.rulesProviderFinder); }
public ValidationStrategyContext(IValidationFactory validationFactory, IPaymentService paymentService, IConfiguration configuration) { _validationFactory = validationFactory; _paymentService = paymentService; _configuration = configuration; }
/// <summary> /// Initializes a new instance of the <see cref="StatusService"/> class. /// </summary> /// <param name="repository">The exam repo.</param> /// <param name="validationFactory">The exam repo.</param> public StatusService( IStatusRepository repository, IStatusRepository repository1, IValidationFactory validationFactory) : base(repository, validationFactory) { _repository = repository; }
public AddValidatorCommandHandler(IReadService <DynamicMetadataDefinition> dynamicMetadataDefinitionService, IWriteService <DynamicMetadataDefinition> dynamicMetadataDefinitionWriteService, IEventDispatcher eventDispatcher, IMapper mapper, IValidationFactory validationFactory) { _dynamicMetadataDefinitionService = dynamicMetadataDefinitionService; _dynamicMetadataDefinitionWriteService = dynamicMetadataDefinitionWriteService; _eventDispatcher = eventDispatcher; _mapper = mapper; _validationFactory = validationFactory; }
/// <summary> /// Initializes a new instance of the <see cref="EmailAddressValidator"/> class. /// </summary> public EmailAddressValidator(IValidationFactory validationFactory) { When(x => x != null, () => { RuleFor(s => s.Email) .NotEmpty().WithMessage("Email address is required") .EmailAddress().WithMessage("A valid email is required"); }); }
public PropertyDefinitionUpdatedEventHandler(IReadService <Movie> movieReadService, IWriteService <Movie> movieWriteService, IReadService <DynamicMetadataDefinition> dynamicMetadataDefinition, IValidationFactory validationFactory, IMapper mapper) { _movieReadService = movieReadService; _movieWriteService = movieWriteService; _dynamicMetadataDefinition = dynamicMetadataDefinition; _validationFactory = validationFactory; _mapper = mapper; }
public void SetUp() { this.mockery = new Mockery(); this.validationFactory = this.mockery.NewMock <IValidationFactory>(); Stub.On(this.validationFactory).Method("CreateValidationResult").With(true).Will(Return.Value(new ValidationResult(true))); Stub.On(this.validationFactory).Method("CreateValidationResult").With(false).Will(Return.Value(new ValidationResult(false))); }
/// <summary> /// Initializes a new instance of the <see cref="StatusValidator"/> class. /// </summary> public StatusValidator(IValidationFactory validationFactory) : base(validationFactory) { RuleFor(x => x.StatusDate) .NotEmpty() .WithMessage("StatusDate is required"); RuleFor(x => x.Description) .NotEmpty() .WithMessage("Status Description is required"); }
public UpdateMovieMetadataCommandHandler(IReadService <Movie> movieReadService, IWriteService <Movie> movieWriteService, IMapper mapper, IInputDataParser inputDataParser, IReadService <DynamicMetadataDefinition> dynamicMetadataDefinitionReadService, IValidationFactory validationFactory) { _movieReadService = movieReadService; _movieWriteService = movieWriteService; _mapper = mapper; _inputDataParser = inputDataParser; _dynamicMetadataDefinitionReadService = dynamicMetadataDefinitionReadService; _validationFactory = validationFactory; }
/// <summary> /// Initializes a new instance of the <see cref="EmployeeService"/> class. /// </summary> /// <param name="repository">The exam repo.</param> /// <param name="validationFactory">The exam repo.</param> public EmployeeService( IEmployeeRepository repository, IEmployeeRepository repository1, IValidationFactory validationFactory) : base(repository, validationFactory) { _repository = repository; _repository1 = repository1; }
/// <summary> /// Initializes a new instance of the <see cref="StatusValidator"/> class. /// </summary> public JobSearchValidator(IValidationFactory validationFactory) : base(validationFactory) { RuleFor(x => x.InitialDate) .NotEmpty() .WithMessage("InitialDate is required"); RuleFor(x => x.ApproachMethod) .NotEmpty() .WithMessage("ApproachMethod is required"); }
/// <summary> /// Initializes a new instance of the <see cref="CompanyValidator"/> class. /// </summary> public CompanyValidator(IValidationFactory validationFactory) : base(validationFactory) { RuleFor(x => x.Name) .NotEmpty() .WithMessage("Company Name is required"); RuleFor(x => x.EmailAddress).SetValidator(ValidationFactory.GetValidatorInstance <EmailAddress>()); RuleFor(x => x.Address).SetValidator(ValidationFactory.GetValidatorInstance <Address>()); RuleFor(x => x.Login).SetValidator(ValidationFactory.GetValidatorInstance <Login>()); }
/// <summary> /// Initializes a new instance of the <see cref="EmployeeValidator"/> class. /// </summary> public EmployeeValidator(IValidationFactory validationFactory) : base(validationFactory) { //RuleFor(x => x.Company) // .NotNull() // .WithMessage("User Name is required"); //RuleFor(x => x.Role) // .NotEmpty() // .WithMessage("Role is required"); }
/// <summary> /// Initializes a new instance of the <see cref="AgencyService"/> class. /// </summary> /// <param name="repository">The exam repo.</param> /// <param name="validationFactory">The exam repo.</param> public AgencyService( IAgencyRepository agencyRepository, IRecruiterRepository recruiterRepository, IEmployerRepository employerRepository, IValidationFactory validationFactory) : base(agencyRepository, validationFactory) { _recruiterRepository = recruiterRepository; _employerRepository = employerRepository; }
public void SetUp() { this.mockery = new Mockery(); this.validationFactory = this.mockery.NewMock<IValidationFactory>(); IValidationResult validationResult = this.mockery.NewMock<IValidationResult>(); Stub.On(validationResult).GetProperty("Valid").Will(Return.Value(true)); Stub.On(this.validationFactory).Method("CreateValidationResult").With(true).Will(Return.Value(validationResult)); this.testee = new TestValidationRule(this.validationFactory); }
public MarcaService ( IMarcaRepository repository, IValidationFactory <EMarca> validationInsertFactory, IValidationFactory <EMarca> validationUpdateFactory ) { _repository = repository ?? throw new ArgumentNullException(nameof(repository)); _validationInsertFactory = validationInsertFactory ?? throw new ArgumentNullException(nameof(validationInsertFactory)); _validationUpdateFactory = validationUpdateFactory ?? throw new ArgumentNullException(nameof(validationUpdateFactory)); }
public SearchController(IQueryDispatcher qry, ICommandDispatcher cmd, ISearchFactory searchFactory, IValidationFactory validationFactory, IAbstractFactory abstractFactory, ILogEntropyFactory logEntropyFactory) { _qry = qry; _cmd = cmd; _searchFactory = searchFactory; _validationFactory = validationFactory; _abstractFactory = abstractFactory; _logEntropyFactory = logEntropyFactory; _hubContext = GlobalHost.ConnectionManager.GetHubContext <MessageHub>(); }
public void SetUp() { this.mockery = new Mockery(); this.validationFactory = this.mockery.NewMock <IValidationFactory>(); IValidationResult validationResult = this.mockery.NewMock <IValidationResult>(); Stub.On(validationResult).GetProperty("Valid").Will(Return.Value(true)); Stub.On(this.validationFactory).Method("CreateValidationResult").With(true).Will(Return.Value(validationResult)); this.testee = new TestValidationRule(this.validationFactory); }
public PatrimonioService ( IPatrimonioRepository repository, IValidationFactory <EPatrimonio> validationInsertFactory, IValidationFactory <EPatrimonio> validationUpdateFactory, IBusinessRulesFactory <EPatrimonio> bizRulesInsertFactory ) { _repository = repository ?? throw new ArgumentNullException(nameof(repository)); _validationInsertFactory = validationInsertFactory ?? throw new ArgumentNullException(nameof(validationInsertFactory)); _validationUpdateFactory = validationUpdateFactory ?? throw new ArgumentNullException(nameof(validationUpdateFactory)); _bizRulesInsertFactory = bizRulesInsertFactory ?? throw new ArgumentNullException(nameof(bizRulesInsertFactory)); }
public Application ( ICampaignReader inputReader, IValidationFactory validationFactory, IValidator validator, IPrizeMoneyCalculator prizeMoneyCalculator ) { _inputReader = inputReader; _validationFactory = validationFactory; _validator = validator; _prizeMoneyCalculator = prizeMoneyCalculator; }
/// <summary> /// Initializes a new instance of the <see cref="LoginValidator"/> class. /// </summary> public LoginValidator(IValidationFactory validationFactory) { When(x => x != null, () => { RuleFor(x => x.UserName) .NotEmpty().WithMessage("User Name is required"); RuleFor(x => x.Password) .NotEmpty().WithMessage("Password is required"); RuleFor(x => x.Url) .NotEmpty().WithMessage("Url is required") .Must(url => (url.StartsWith("http://") || url.StartsWith("https://"))) .WithMessage("A valid Url is required"); }); }
/// <summary> /// Initializes a new instance of the <see cref="AddressValidator"/> class. /// </summary> public AddressValidator(IValidationFactory validationFactory) { RuleFor(x => x.StreetAddress) .NotEmpty() .WithMessage("StreetAddress is required"); RuleFor(x => x.City) .NotEmpty() .WithMessage("City is required"); RuleFor(x => x.State) .NotEmpty() .WithMessage("State is required"); RuleFor(x => x.ZipCode) .NotEmpty() .WithMessage("ZipCode is required"); }
/// <summary> /// Initializes a new instance of the <see cref="JobSearchService"/> class. /// </summary> /// <param name="repository">The exam repo.</param> /// <param name="approachTypeRepository"></param> /// <param name="validationFactory">The exam repo.</param> /// <param name="agencyRepository"></param> /// <param name="recruiterRepository"></param> /// <param name="employerRepository"></param> /// <param name="statusRepository"></param> public JobSearchService( IJobSearchRepository repository, IAgencyRepository agencyRepository, IRecruiterRepository recruiterRepository, IEmployerRepository employerRepository, IStatusRepository statusRepository, IApproachTypeRepository approachTypeRepository, IValidationFactory validationFactory) : base(repository, validationFactory) { _agencyRepository = agencyRepository; _recruiterRepository = recruiterRepository; _employerRepository = employerRepository; _statusRepository = statusRepository; _approachTypeRepository = approachTypeRepository; }
protected ApplicationService(IUnitOfWorkFactory unitOfWorkFactory, IMapper mapper, IValidationFactory validationFactory) { if (unitOfWorkFactory == null) { throw new ArgumentNullException("unitOfWorkFactory"); } if (mapper == null) { throw new ArgumentNullException("mapper"); } if (validationFactory == null) { throw new ArgumentNullException("validationFactory"); } _unitOfWorkFactory = unitOfWorkFactory; _mapper = mapper; _validationFactory = validationFactory; }
protected CrudServiceBase(IUnitOfWorkFactory unitOfWorkFactory, IMapper mapper, IValidationFactory validationFactory) { if (unitOfWorkFactory == null) { throw new ArgumentNullException("unitOfWorkFactory"); } if (mapper == null) { throw new ArgumentNullException("mapper"); } if (validationFactory == null) { throw new ArgumentNullException("validationFactory"); } _unitOfWorkFactory = unitOfWorkFactory; _mapper = mapper; _validationFactory = validationFactory; }
public void SetUp() { this.mockery = new Mockery(); // mock rule validationFactory this.validationFactory = this.mockery.NewMock<IValidationFactory>(); IValidationResult aggregatedValidationResult = new ValidationResult(true); Stub.On(this.validationFactory).Method("CreateValidationResult").With(true).Will( Return.Value(aggregatedValidationResult)); Stub.On(this.validationFactory).Method("CreateRuleSet").Will(Return.Value(new ValidationRuleSet())); // mock rules providers this.defaultRulesProvider = this.mockery.NewMock<IRulesProvider>(); this.pluginRulesProvider = this.mockery.NewMock<IRulesProvider>(); // mock rules provider finder this.rulesProviderFinder = this.mockery.NewMock<IRulesProviderFinder>(); Stub.On(this.rulesProviderFinder).Method("FindRulesProviders").Will( Return.Value(new List<IRulesProvider> { this.defaultRulesProvider, this.pluginRulesProvider })); // create testee this.testee = new RuleEngine(this.rulesProviderFinder); }
public StoreService(ITypeAdapterFactory typeAdapterFactory, IValidationFactory validationFactory, IAddressServiceFactory addressServiceFactory, IStoreLocalizedDetailsServiceFactory storeLocalizedDetailsServiceFactory, IStoreRepository storeRepository, IPhoneNumberServiceFactory phoneNumberServiceFactory) { if (typeAdapterFactory == null) throw new ArgumentNullException("typeAdapterFactory"); if (validationFactory == null) throw new ArgumentNullException("validationFactory"); if (addressServiceFactory == null) throw new ArgumentNullException("addressServiceFactory"); if (storeLocalizedDetailsServiceFactory == null) throw new ArgumentNullException("storeLocalizedDetailsServiceFactory"); if (storeRepository == null) throw new ArgumentNullException("storeRepository"); if (phoneNumberServiceFactory == null) throw new ArgumentNullException("phoneNumberServiceFactory"); this.typeAdapterFactory = typeAdapterFactory; this.validationFactory = validationFactory; this.addressServiceFactory = addressServiceFactory; this.storeLocalizedDetailsServiceFactory = storeLocalizedDetailsServiceFactory; this.storeRepository = storeRepository; this.phoneNumberServiceFactory = phoneNumberServiceFactory; }
/// <summary> /// Initializes a new instance of the <see cref="ValidationRuleBase"/> class. /// </summary> /// <param name="validationFactory">The factory for creating rule engine related instances.</param> protected ValidationRuleBase(IValidationFactory validationFactory) { this.validationFactory = validationFactory; }
public AgencyRepository(ISession session, IQueryFactory queryFactory, IValidationFactory validationFactory) : base(session, queryFactory, validationFactory) { }
/// <summary> /// Initializes a new instance of the <see cref="ValidationAggregator"/> class. /// </summary> /// <param name="validationFactory">The validation factory.</param> /// <param name="breakOnFirstViolation">if set to <c>true</c> [break on first violation].</param> public ValidationAggregator(IValidationFactory validationFactory, bool breakOnFirstViolation) { this.validationFactory = validationFactory; this.breakOnFirstViolation = breakOnFirstViolation; }
/// <summary> /// Initializes a new instance of the <see cref="AgencyValidator"/> class. /// </summary> public ApproachTypeValidator(IValidationFactory validationFactory) : base(validationFactory) { RuleFor(x => x.ApproachMethod) .NotEmpty() .WithMessage("ApproachMethod Name is required"); }
public AnotherTestValidationRule(IValidationFactory validationFactory) : base(validationFactory) { }
public ContactCrudService(IUnitOfWorkFactory unitOfWorkFactory, IMapper mapper, IValidationFactory validationFactory) : base(unitOfWorkFactory, mapper, validationFactory) { }
public void SetUp() { this.testee = new ValidationFactory(); }
/// <summary> /// Initializes a new instance of the <see cref="RecruiterValidator"/> class. /// </summary> public RecruiterValidator(IValidationFactory validationFactory) : base(validationFactory) { RuleFor(x => x.RecruiterName) .NotEmpty() .WithMessage("Recruiter Name is required"); }
/// <summary> /// Initializes a new instance of the <see cref="ValidationRuleSetDescriptor"/> class. /// </summary> /// <param name="breakOnFirstViolation">if set to <c>true</c> the aggregation of rules is /// stopped when the first violation occurs, all remaining rules are not evaluated.].</param> public ValidationRuleSetDescriptor(bool breakOnFirstViolation) { this.factory = new ValidationFactory(); this.aggregator = new ValidationAggregator(this.factory, breakOnFirstViolation); }
private void InitializeValidations(IValidationFactory validationFactory) { _bookingBalanceDueSpecification = validationFactory.GetValidationSpec <BookingBalanceDueSpec, BookingBalanceDueDto>(); }
public RefundOriginalPaymentValidationStrategy(IValidationFactory validationFactory) { InitializeValidations(validationFactory); }