示例#1
0
 public GetOrganisationCategoriesHandler(ILookupDataRepository repository,
                                         ILogger <GetOrganisationCategoriesHandler> logger, IProviderTypeValidator providerTypeValidator)
 {
     _repository            = repository;
     _logger                = logger;
     _providerTypeValidator = providerTypeValidator;
 }
 public CreateOrganisationHandler(ICreateOrganisationRepository repository, IEventsRepository eventsRepository,
                                  ILogger <CreateOrganisationHandler> logger, IOrganisationValidator organisationValidator,
                                  IProviderTypeValidator providerTypeValidator, IMapCreateOrganisationRequestToCommand mapper,
                                  ITextSanitiser textSanitiser)
 {
     _organisationRepository = repository;
     _eventsRepository       = eventsRepository;
     _logger = logger;
     _organisationValidator = organisationValidator;
     _providerTypeValidator = providerTypeValidator;
     _mapper        = mapper;
     _textSanitiser = textSanitiser;
 }
        public void Before_each_test()
        {
            _repository = new Mock <ILookupDataRepository>();
            var organisationTypes = new List <OrganisationType>
            {
                new OrganisationType
                {
                    Id   = 1,
                    Type = "College"
                },
                new OrganisationType
                {
                    Id   = 2,
                    Type = "University"
                }
            };

            _repository.Setup(x => x.GetOrganisationTypesForProviderTypeId(It.IsAny <int>())).ReturnsAsync(organisationTypes);
            _logger    = new Mock <ILogger <GetOrganisationTypesHandler> >();
            _validator = new ProviderTypeValidator();
            _handler   = new GetOrganisationTypesHandler(_repository.Object, _logger.Object, _validator);
        }
        public void Before_each_test()
        {
            _repository = new Mock <ILookupDataRepository>();
            var organisationCategories = new List <OrganisationCategory>
            {
                new OrganisationCategory
                {
                    Id       = 1,
                    Category = "Educational Institute"
                },
                new OrganisationCategory
                {
                    Id       = 2,
                    Category = "Public Sector Body"
                }
            };

            _repository.Setup(x => x.GetOrganisationCategories(It.IsAny <int>())).ReturnsAsync(organisationCategories);
            _logger    = new Mock <ILogger <GetOrganisationCategoriesHandler> >();
            _validator = new ProviderTypeValidator();
            _handler   = new GetOrganisationCategoriesHandler(_repository.Object, _logger.Object, _validator);
        }