public OutpatientController(ICoreService core, IOutpatientService outpatient, IPatientService patient, IConceptService concept)
 {
     ICoreService       = core;
     IPatientService    = patient;
     IConceptService    = concept;
     IOutpatientService = outpatient;
 }
Ejemplo n.º 2
0
 public ConceptController(
     IAlfrescoHttpClient alfrescoHttpClient,
     IAuditLogService auditLogService,
     INodesService nodesService,
     IDocumentService documentService,
     IConceptService conceptService,
     IIdentityUser identityUser,
     ISpisUmConfiguration spisUmConfiguration,
     IComponentService componentService,
     IValidationService validationService,
     ITranslateService translateService,
     ITransactionHistoryService transactionHistoryService,
     IAlfrescoModelComparer alfrescoModelComparer
     )
 {
     _alfrescoHttpClient        = alfrescoHttpClient;
     _auditLogService           = auditLogService;
     _nodesService              = nodesService;
     _documentService           = documentService;
     _conceptService            = conceptService;
     _identityUser              = identityUser;
     _spisUmConfiguration       = spisUmConfiguration;
     _componentService          = componentService;
     _validationService         = validationService;
     _translateService          = translateService;
     _transactionHistoryService = transactionHistoryService;
     _alfrescoModelComparer     = alfrescoModelComparer;
 }
Ejemplo n.º 3
0
 public ConceptController(IConceptService conceptService, IPollService pollService, IMapper mapper, IUserService userService)
 {
     _conceptService = conceptService ?? throw new ArgumentNullException(nameof(conceptService));
     _pollService    = pollService ?? throw new ArgumentNullException(nameof(pollService));
     _mapper         = mapper ?? throw new ArgumentNullException(nameof(mapper));
     _userService    = userService ?? throw new ArgumentNullException(nameof(userService));
 }
Ejemplo n.º 4
0
 /// <summary>
 /// Initializes a new instance of the <see cref="MaterialController" /> class.
 /// </summary>
 /// <param name="conceptService">The concept service.</param>
 /// <param name="entityService">The entity service.</param>
 /// <param name="materialConceptService">The material concept service.</param>
 /// <param name="userService">The user service.</param>
 public MaterialController(IConceptService conceptService, IEntityService entityService, IMaterialConceptService materialConceptService, IUserService userService)
 {
     this.conceptService         = conceptService;
     this.entityService          = entityService;
     this.materialConceptService = materialConceptService;
     this.userService            = userService;
 }
Ejemplo n.º 5
0
 /// <summary>
 /// Initializes a new instance of the <see cref="PlaceController"/> class.
 /// </summary>
 public PlaceController(IConceptService conceptService, IEntityService entityService, IEntityRelationshipService entityRelationshipService, IPlaceConceptService placeConceptService, IUserService userService)
 {
     this.conceptService            = conceptService;
     this.entityService             = entityService;
     this.entityRelationshipService = entityRelationshipService;
     this.placeConceptService       = placeConceptService;
     this.userService = userService;
 }
 public RegistrationController(IPatientService ipatient, ICoreService icore, IFinanceService ifinance, IConceptService iconcept, IDoctorService idoctor)
 {
     IPatientService = ipatient;
     ICoreService    = icore;
     IFinanceService = ifinance;
     IConceptService = iconcept;
     IDoctorService  = idoctor;
 }
Ejemplo n.º 7
0
        public ConceptControllerTest()
        {
            _tokenHelper = A.Fake <ITokenHelper>();
            A.CallTo(() => _tokenHelper.ReturnScope(A <ClaimsPrincipal> ._)).Returns(_allowedScope);
            A.CallTo(() => _tokenHelper.GetUserInfo()).Returns(new UserInfo());

            _service       = A.Fake <IConceptService>();
            _controller    = new ConceptController(_service, _tokenHelper);
            _createConcept = new CreateConceptDto
            {
                Title   = "Title",
                Content = "Content",
                Created = DateTime.Now,
                Updated = DateTime.Now,
            };
            _updateConcept = new UpdateConceptDto
            {
                Title   = "Title",
                Content = "Content",
                Created = DateTime.Now,
                Updated = DateTime.Now,
            };

            _searchQuery = new ConceptSearchQuery {
                Title = "title", MetaIds = new List <int> {
                    1, 2
                }
            };

            _errorResponse = new Response
            {
                Errors = new ModelStateDictionary()
            };
            _errorResponse.Errors.TryAddModelError("err", "err");

            _listResponse = new Response {
                Data = new List <ConceptDto>()
            };
            _singleResponse = new Response {
                Data = new ConceptDto()
            };
            _userInfo = new UserInfo
            {
                Email    = _allowedUserEmail,
                FullName = "Name"
            };

            _listQuery = BaseListQuery.DefaultValues(language);
        }
Ejemplo n.º 8
0
        public ConceptControllerTest()
        {
            _service    = A.Fake <IConceptService>();
            _controller = new ConceptController(_service);

            _concepts = new List <Concept>
            {
                new Concept {
                    Title = "TestTitle"
                },
                new Concept {
                    Title = "Another test"
                },
            };
        }
 public ConceptServiceTest()
 {
     _conceptRepository  = A.Fake <IConceptRepository>();
     _service            = new ConceptService(_conceptRepository);
     _noSearchFields     = new ConceptSearchFields();
     _conceptsInDatabase = new List <Concept>
     {
         new Concept {
             Title = "TestTitle"
         },
         new Concept {
             Title = "Another test"
         },
     };
 }
Ejemplo n.º 10
0
        public ConceptServiceTest()
        {
            ConceptMediaRepository = A.Fake <IConceptMediaRepository>();
            ConceptRepository      = A.Fake <IConceptRepository>();
            StatusRepository       = A.Fake <IStatusRepository>();
            LanguageRepository     = A.Fake <ILanguageRepository>();
            MetadataRepository     = A.Fake <IMetadataRepository>();
            UrlHelper = A.Fake <IUrlHelper>();

            Mapper = AutoMapper.Mapper.Instance;

            Service                 = new ConceptService(ConceptRepository, StatusRepository, ConceptMediaRepository, MetadataRepository, LanguageRepository, Mapper, UrlHelper);
            Mock                    = new Mock.Mock();
            _status                 = new Status();
            BaseListQuery           = BaseListQuery.DefaultValues("nb");
            _language               = new Language();
            _listOfMetaWithLanguage = new List <MetaData> {
                new MetaData
                {
                    Language = _language, Category = new MetaCategory {
                        TypeGroup = new TypeGroup {
                            Name = "language"
                        }
                    }
                }
            };
            _userInfo = new UserInfo
            {
                FullName = "Fullname",
                Email    = "Email"
            };

            A.CallTo(() => StatusRepository.GetById(A <int> ._)).Returns(null);
            A.CallTo(() => MetadataRepository.GetByRangeOfIds(A <List <int> > ._)).Returns(_listOfMetaWithLanguage);
            A.CallTo(() => LanguageRepository.GetByAbbreviation(A <string> ._)).Returns(_language);
        }
Ejemplo n.º 11
0
 public ConceptController(IConceptService service, ITokenHelper tokenHelper)
 {
     _service     = service;
     _tokenHelper = tokenHelper;
 }
Ejemplo n.º 12
0
 public void Setup()
 {
     _testModules    = _factory.GenerateTestModules();
     _uow            = new UnitOfWork(new SyncContext());
     _conceptService = new ConceptService(_uow);
 }
 public DatasetMetadataController(ISecurityService securityService, IDatasetService datasetService, IConceptService conceptService) : base(securityService)
 {
     _datasetService = datasetService;
     _conceptService = conceptService;
 }
Ejemplo n.º 14
0
 /// <summary>
 /// Initializes a new instance of the <see cref="EntityService" /> class.
 /// </summary>
 /// <param name="client">The client.</param>
 /// <param name="conceptService">The concept service.</param>
 /// <param name="coreAuditService">The core audit service.</param>
 /// <param name="entityAuditService">The entity audit service.</param>
 public EntityService(ImsiServiceClient client, IConceptService conceptService, ICoreAuditService coreAuditService, IEntityAuditService entityAuditService) : base(client)
 {
     this.conceptService     = conceptService;
     this.coreAuditService   = coreAuditService;
     this.entityAuditService = entityAuditService;
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="EntityRelationshipService" /> class.
 /// </summary>
 /// <param name="client">The client.</param>
 /// <param name="conceptService">The concept service.</param>
 public EntityRelationshipService(ImsiServiceClient client, IConceptService conceptService, IEntityService entityService) : base(client)
 {
     this.conceptService = conceptService;
     this.entityService  = entityService;
 }
Ejemplo n.º 16
0
 public ProgressionRequestValidator(ISubjectService subjectService, IConceptService conceptService)
 {
     RuleFor(x => x.SubjectId).NotEmpty().MustExistInDatabase(subjectService);
     RuleFor(x => x.ConceptId).NotEmpty().MustExistInDatabase(conceptService);
 }
Ejemplo n.º 17
0
 /// <summary>
 /// Initializes a new instance of the <see cref="MaterialConceptService"/> class.
 /// </summary>
 /// <param name="client">The client.</param>
 /// <param name="cacheService">The cache service.</param>
 /// <param name="conceptService">The concept service.</param>
 public MaterialConceptService(ImsiServiceClient client, ICacheService cacheService, IConceptService conceptService) : base(client)
 {
     this.cacheService   = cacheService;
     this.conceptService = conceptService;
 }
Ejemplo n.º 18
0
        public async Task Return_All_Progressions(Mock <IProgressionService> service, ISubjectService subjects, IConceptService concepts, List <Progression> progressions, User user)
        {
            service.Setup(x => x.GetAll(user, It.IsAny <CancellationToken>())).ReturnsAsync(progressions);

            var controller = TestSetup.SetupController <ProgressionController>(service.Object, subjects, concepts).SetupSession(user);

            var result = await controller.GetProgressions();

            result.Should().NotBeNull().And.BeEquivalentTo(progressions.Select(x => new ProgressionResponse(x)));
        }
Ejemplo n.º 19
0
 public ProgressionController(IProgressionService progression, ISubjectService subjects, IConceptService concepts)
 {
     _progression = progression;
     _subjects    = subjects;
     _concepts    = concepts;
 }
Ejemplo n.º 20
0
 public ConceptController(IConceptService conceptService)
 {
     _conceptService = conceptService;
 }
 public ConceptController(IConceptService service)
 {
     _service = service;
 }
Ejemplo n.º 22
0
 /// <summary>
 /// Initializes a new instance of the <see cref="PlaceConceptService"/> class.
 /// </summary>
 /// <param name="client">The client.</param>
 /// <param name="conceptService">The concept service.</param>
 public PlaceConceptService(ImsiServiceClient client, IConceptService conceptService) : base(client)
 {
     this.conceptService = conceptService;
 }
Ejemplo n.º 23
0
        public async Task Return_Progression_Or_One_Of_204_404(Mock <IProgressionService> service, Mock <ISubjectService> subjects, IConceptService concepts, Progression progression, User user, Subject subject, Subject badSubject)
        {
            subjects.Setup(x => x.Get(subject.Id, It.IsAny <CancellationToken>())).ReturnsAsync(subject);
            subjects.Setup(x => x.Get(badSubject.Id, It.IsAny <CancellationToken>())).ReturnsAsync(badSubject);
            subjects.Setup(x => x.Get(Guid.Empty, It.IsAny <CancellationToken>())).ReturnsAsync((Subject)null);

            service.Setup(x => x.Get(user, subject, It.IsAny <CancellationToken>())).ReturnsAsync(progression);
            service.Setup(x => x.Get(user, badSubject, It.IsAny <CancellationToken>())).ReturnsAsync((Progression)null);

            var controller = TestSetup.SetupController <ProgressionController>(service.Object, subjects.Object, concepts).SetupSession(user);

            var result = await controller.GetProgression(subject.Id);

            var result204 = await controller.GetProgression(badSubject.Id);

            var result404 = await controller.GetProgression(Guid.Empty);

            result.Value.Should().NotBeNull().And.BeEquivalentTo(new ProgressionResponse(progression));

            result204.Value.Should().BeNull();
            result204.Result.Should().BeOfType(typeof(NoContentResult));

            result404.Value.Should().BeNull();
            result404.Result.Should().BeOfType(typeof(NotFoundResult));
        }
Ejemplo n.º 24
0
 public ConceptsController(IConceptService concepts, IAuthorizationService authorization)
 {
     _concepts      = concepts;
     _authorization = authorization;
 }