public PatientServiceTest()
 {
     patientRepository = Substitute.For<IPatientRepository>();
     unitOfWork = Substitute.For<IUnitOfWork>();
     validatorService = Substitute.For<IValidatorService>();
     patientService = new PatientService(patientRepository, unitOfWork, validatorService);
 }
Exemple #2
0
 public DossierService(IDataUnitOfWork unitOfWork, ILogger logger, IValidatorService validationService,
                       IDossierRuleset dossierRuleset, IMapperUnitOfWork mapperUnitOfWork, ISecurity security, IParameterEnvService parameterEnvService)
     : base(unitOfWork, logger, validationService, dossierRuleset, mapperUnitOfWork, security)
 {
     _unitOfWork          = unitOfWork;
     _mapperUnitOfWork    = mapperUnitOfWork;
     _parameterEnvService = parameterEnvService;
 }
 public MessageService(IDataUnitOfWork unitOfWork, ILogger logger, IValidatorService validationService,
                       IMessageRuleset messageRuleset, IMapperUnitOfWork mapperUnitOfWork, IParameterEnvService parameterEnvService, ISecurity security)
     : base(unitOfWork, logger, validationService, messageRuleset, mapperUnitOfWork, security)
 {
     _unitOfWork          = unitOfWork;
     _logger              = logger;
     _parameterEnvService = parameterEnvService;
 }
 public TenantAOOService(IDataUnitOfWork unitOfWork, ILogger logger, IValidatorService validationService,
                         ITenantAOORuleset tenantAOORuleset, IMapperUnitOfWork mapperUnitOfWork, ISecurity security)
     : base(unitOfWork, logger, validationService, tenantAOORuleset, mapperUnitOfWork, security)
 {
     _unitOfWork       = unitOfWork;
     _logger           = logger;
     _mapperUnitOfWork = mapperUnitOfWork;
 }
Exemple #5
0
 public Game(IScoreCardService scoreCardService,
             IScoreCalcService scoreCalcService,
             IValidatorService validatorService)
 {
     _scoreCardService = scoreCardService;
     _scoreCalcService = scoreCalcService;
     _validatorService = validatorService;
 }
 public UserLogService(IDataUnitOfWork unitOfWork, ILogger logger, IValidatorService validationService,
                       IUserLogRuleset containerRuleset, IMapperUnitOfWork mapperUnitOfWork, ISecurity security)
     : base(unitOfWork, logger, validationService, containerRuleset, mapperUnitOfWork, security)
 {
     _unitOfWork = unitOfWork;
     _logger     = logger;
     _security   = security;
 }
 public PatientService(IPatientRepository patientRepository, IUnitOfWork unitOfWork,
     IValidatorService validatorService)
 {
     _patientRepository = patientRepository;
     _unitOfWork = unitOfWork;
     _validatorService = validatorService;
     _patientValidatorFunc = p => !string.IsNullOrEmpty(p.Firstname) && !string.IsNullOrEmpty(p.Surname);
 }
 public AssetService(
     IUnitOfWork unitOfWork,
     IValidatorService <Asset> validatorService
     )
 {
     this.unitOfWork       = unitOfWork;
     this.validatorService = validatorService;
 }
Exemple #9
0
 public FascicleService(IDataUnitOfWork unitOfWork, ILogger logger, IValidatorService validationService,
                        IFascicleRuleset fascicleRuleset, IMapperUnitOfWork mapperUnitOfWork, ISecurity security)
     : base(unitOfWork, logger, validationService, fascicleRuleset, mapperUnitOfWork, security)
 {
     _unitOfWork       = unitOfWork;
     _logger           = logger;
     _mapperUnitOfWork = mapperUnitOfWork;
 }
Exemple #10
0
 public BaseController(
     ILogger <BaseController> logger,
     IControllerResponseFactory responseFactoryService,
     IValidatorService validatorService)
 {
     this.Logger = logger;
     this.ControllerResponseFactory = responseFactoryService;
     this.ValidatorService          = validatorService;
 }
Exemple #11
0
 public GetProductQueryHandler(
     IValidatorService validatorService,
     IProductRepository productRepository,
     IMapper mapper)
 {
     _validatorService  = validatorService;
     _productRepository = productRepository;
     _mapper            = mapper;
 }
Exemple #12
0
 public QueueController(IQueueService service, IValidatorService validationService, IQueueRuleset ruleset, ILogger logger, ICQRSMessageMapper mapper)
     : base()
 {
     _service           = service;
     _validationService = validationService;
     _ruleset           = ruleset;
     _logger            = logger;
     _mapper            = mapper;
 }
Exemple #13
0
 public UpdateProductCommandHandler(
     IValidatorService validatorService,
     IProductRepository productRepository,
     IMapper mapper)
 {
     _validatorService  = validatorService;
     _productRepository = productRepository;
     _mapper            = mapper;
 }
 public ContainerService(IDataUnitOfWork unitOfWork, ILogger logger, IValidatorService validationService,
                         IContainerRuleset containerRuleset, IMapperUnitOfWork mapperUnitOfWork, ISecurity security, IParameterEnvService parameterEnvService)
     : base(unitOfWork, logger, validationService, containerRuleset, mapperUnitOfWork, security)
 {
     _unitOfWork          = unitOfWork;
     _logger              = logger;
     _security            = security;
     _parameterEnvService = parameterEnvService;
 }
Exemple #15
0
 public FascicleDocumentService(IDataUnitOfWork unitOfWork, ILogger logger, IValidatorService validationService,
                                IFascicleRuleset fascicleRuleset, IMapperUnitOfWork mapperUnitOfWork, ISecurity security,
                                IDocumentContext <ModelDocuments.Document, ModelDocuments.ArchiveDocument> documentClient)
     : base(unitOfWork, logger, validationService, fascicleRuleset, mapperUnitOfWork, security)
 {
     _unitOfWork     = unitOfWork;
     _logger         = logger;
     _documentClient = documentClient;
 }
 public CategoryFascicleService(IDataUnitOfWork unitOfWork, ILogger logger, IValidatorService validationService,
                                ICategoryFascicleRuleset categoryFascicleRuleset, IMapperUnitOfWork mapperUnitOfWork, ISecurity security,
                                IParameterEnvService parameterEnvService)
     : base(unitOfWork, logger, validationService, categoryFascicleRuleset, mapperUnitOfWork, security)
 {
     _unitOfWork          = unitOfWork;
     _logger              = logger;
     _parameterEnvService = parameterEnvService;
 }
Exemple #17
0
 public AddProductCategoryCommandHandler(
     IValidatorService validatorService,
     IProductCategoryRepository categoryRepository,
     IMapper mapper)
 {
     _validatorService   = validatorService;
     _categoryRepository = categoryRepository;
     _mapper             = mapper;
 }
        public QualifyServicesPageViewModel(IApiService apiService, IDialogService dialogService, INavigationService navigationService, IValidatorService validatorService)
        {
            this.apiService        = apiService;
            this.dialogService     = dialogService;
            this.navigationService = navigationService;
            this.validatorService  = validatorService;

            Questions = new ObservableCollection <QuestionViewModel>();
        }
Exemple #19
0
        /// <summary>
        /// Create a new Service client
        /// </summary>
        /// <param name="settings"></param>
        /// <param name="httpClientFactory"></param>
        /// <param name="jsonConverterService"></param>
        /// <param name="validatorService"></param>
        public ClientService(IOptions <AppSettings> settings, IHttpClientFactory httpClientFactory, IJsonConverterService jsonConverterService, IValidatorService validatorService)
        {
            Settings = settings.Value;
            ApiKey   = Settings.ApiToken;

            HttpClientFactory    = httpClientFactory;
            JsonConverterService = jsonConverterService;
            ValidatorService     = validatorService;
        }
Exemple #20
0
 public ProcessService(IDataUnitOfWork unitOfWork, ILogger logger, IValidatorService validationService,
                       IProcessRuleset processRuleset, IMapperUnitOfWork mapperUnitOfWork, ISecurity security,
                       IDossierService dossierService, IParameterEnvService parameterEnvService)
     : base(unitOfWork, logger, validationService, processRuleset, mapperUnitOfWork, security)
 {
     _unitOfWork          = unitOfWork;
     _logger              = logger;
     _dossierService      = dossierService;
     _parameterEnvService = parameterEnvService;
 }
Exemple #21
0
 public UserService(ILog log, IExceptionManager exception, IUserRepository userRepository, IAccessTokenRepository accessTokenRepository, IValidatorService <UserCardDetailModel> userCardDetailValidators, ICryptoGraphy cryptoGraphy, IValidatorService <UserProfileViewModel> userProfileViewValidators)
 {
     _log                       = log;
     _exception                 = exception;
     _userRepository            = userRepository;
     _accessTokenRepository     = accessTokenRepository;
     _userCardDetailValidators  = userCardDetailValidators;
     _cryptoGraphy              = cryptoGraphy;
     _userProfileViewValidators = userProfileViewValidators;
 }
Exemple #22
0
        /// <summary>
        /// The constructor
        /// </summary>
        public PrescriptionService(DataContext dataContext, IValidatorService validatorService)
        {
            _dataContext      = dataContext;
            _validatorService = validatorService;

            //TODO changed the way to generate random datas
            var dataGenerator = new DataGenerator(_dataContext);

            dataGenerator.Initialize();
        }
        /// <summary>
        /// Initializes a new instance of the <see cref="MollieClientService" /> class.
        /// </summary>
        /// <param name="httpClientFactory">The HTTP client factory.</param>
        /// <param name="options">The options.</param>
        /// <param name="logger">The logger.</param>
        /// <param name="validatorService">The validator service.</param>
        public MollieClientService(IHttpClientFactory httpClientFactory, IOptions <MollieApiOptions> options, ILogger <MollieClientService> logger, IValidatorService validatorService = null)
        {
            Argument.IsNotNull(options);
            Argument.IsNotNullOrEmpty(options.Value?.ApiKey);

            _jsonConverterService = new JsonConverterService();
            _httpClient           = httpClientFactory.CreateClient();
            _mollieApiOptions     = options.Value;
            _logger           = logger;
            _validatorService = validatorService ?? new ValidatorService();
        }
Exemple #24
0
        public HeroQuery(IHeroService heroService,
                         IJWTService jWTService,
                         IValidatorService validator)
        {
            Name = "Query";
            Field <ListGraphType <HeroType> >(
                "heroes",
                arguments: new QueryArguments(
                    new QueryArgument <NonNullGraphType <StringGraphType> > {
                Name = "token"
            },
                    new QueryArgument <NonNullGraphType <IdGraphType> > {
                Name = "pageNumber"
            },
                    new QueryArgument <StringGraphType> {
                Name = "beginningOfTheName"
            },
                    new QueryArgument <DateTimeGraphType> {
                Name = "before"
            },
                    new QueryArgument <DateTimeGraphType> {
                Name = "after"
            }
                    ),
                resolve: context =>
            {
                var token              = context.GetArgument <string>("token");
                var pageNumber         = context.GetArgument <int>("pageNumber");
                var beginningOfTheName = context.GetArgument <string>("beginningOfTheName", defaultValue: null);
                var before             = context.GetArgument <DateTime?>("before", defaultValue: null);
                var after              = context.GetArgument <DateTime?>("after", defaultValue: null);

                validator.ValidateToken(token);

                var heroes = heroService.GetAllHeroes().Result;

                if (beginningOfTheName != null)
                {
                    heroes = heroService.FilterHeroesByNameAsync(heroes, beginningOfTheName).Result;
                }

                if (before != null)
                {
                    heroes = heroService.FilterHeroesCreatedBeforeAsync(heroes, before.Value).Result;
                }

                if (after != null)
                {
                    heroes = heroService.FilterHeroesCreatedAfterAsync(heroes, after.Value).Result;
                }

                return(heroService.GetPageWithHeroesAsync(heroes, pageNumber));
            });
        }
        public ChatCustomerServicePageViewModel(ILoginViewModel loginViewModel, IDialogService dialogService, IPhoneService phoneService, IApiService apiService, IValidatorService validatorService, INavigationService navigationService)
        {
            this.apiService        = apiService;
            this.dialogService     = dialogService;
            this.loginViewModel    = loginViewModel;
            this.phoneService      = phoneService;
            this.validatorService  = validatorService;
            this.navigationService = navigationService;

            HtmlSource = new UrlWebViewSource();
        }
 public PackagesController(
     IUserService userService,
     IValidatorService validatorService,
     IPackageService packageService,
     IRecipientService recipientService)
 {
     this.userService      = userService;
     this.validatorService = validatorService;
     this.packageService   = packageService;
     this.recipientService = recipientService;
 }
Exemple #27
0
        public ValidatorServiceTests()
        {
            _fixture       = new Fixture();
            _mockValidator = new Mock <IValidator>();
            _mockContainer = new Mock <IComponentContext>();

            Mock <IComponentRegistry> mockComponentRegistry = new Mock <IComponentRegistry>();

            _mockContainer.SetupGet(call => call.ComponentRegistry).Returns(mockComponentRegistry.Object);

            _validatorService = new ValidatorService(_mockContainer.Object);
        }
        public PersonalDataPageViewModel(IApiService apiService, IDialogService dialogService, INavigationService navigationService, IPhoneService phoneService, IValidatorService validatorService)
        {
            this.apiService        = apiService;
            this.dialogService     = dialogService;
            this.navigationService = navigationService;
            this.phoneService      = phoneService;
            this.validatorService  = validatorService;

            IsEnabled = false;

            Documents = new ObservableCollection <Document>();
        }
 public IPerson CreateTestPerson(IValidationResult result, IValidatorService validator, string firstName, string lastName, string emailId)
 {
     result = validator.Validate(firstName, lastName, emailId);
     if (result.IsSuccess == true)
     {
         return new Person(firstName, lastName, emailId);
     }
     else
     {
         throw new ValidationException() { Invalid = result.InvalidFields, };
     }
 }
 public MakePaymentHandler(
     IBankService bankService,
     IPaymentsService paymentsService,
     IValidatorService validatorService,
     IEnumerable <IPaymentValidator> validators,
     IPaymentMapper paymentMapper)
 {
     _bankService      = bankService;
     _paymentsService  = paymentsService;
     _validatorService = validatorService;
     _validators       = validators;
     _paymentMapper    = paymentMapper;
 }
Exemple #31
0
 protected BaseService(IDataUnitOfWork unitOfWork, ILogger logger, IValidatorService validationService,
                       IValidatorRuleset validatorRuleset, IMapperUnitOfWork mapperUnitOfWork, ISecurity security)
 {
     _unitOfWork        = unitOfWork;
     _mapperUnitOfWork  = mapperUnitOfWork;
     _repositoryAsync   = unitOfWork.Repository <TEntity>();
     _logger            = logger;
     _validationService = validationService;
     _instanceId        = Guid.NewGuid();
     _validatorRuleset  = validatorRuleset;
     _mapper            = mapperUnitOfWork.Repository <IDomainMapper <TEntity, TEntity> >();
     _currentDomainUser = security.GetCurrentUser();
 }
Exemple #32
0
        public ClientService(string apiKey, HttpClient httpClient = null, IValidatorService validatorService = null)
        {
            if (string.IsNullOrWhiteSpace(apiKey))
            {
                throw new ArgumentNullException(nameof(apiKey), "Mollie API key cannot be empty");
            }

            _jsonConverterService = new JsonConverterService();
            _httpClient           = httpClient ?? new HttpClient();
            _validatorService     = validatorService ?? new ValidatorService();

            ApiKey = apiKey;
        }
Exemple #33
0
        public InvoiceDetailPageViewModel(IApiService apiService, IDialogService dialogService, INavigationService navigationService, IValidatorService validatorService, IPhoneService phoneService)
        {
            IsCO = AppConfigurations.Brand == "emi";
            IsUY = AppConfigurations.Brand == "ucm";

            this.apiService        = apiService;
            this.dialogService     = dialogService;
            this.navigationService = navigationService;
            this.validatorService  = validatorService;
            this.phoneService      = phoneService;

            invoicePageViewModel = ServiceLocator.Current.GetInstance <IInvoicesPageViewModel>();
        }