Ejemplo n.º 1
0
 public GetOrganisationTypesByCategoryHandler(ILookupDataRepository repository,
                                              ILogger <GetOrganisationTypesByCategoryHandler> logger, IProviderTypeValidator providerTypeValidator, IOrganisationCategoryValidator categoryValidator)
 {
     _repository            = repository;
     _logger                = logger;
     _providerTypeValidator = providerTypeValidator;
     _categoryValidator     = categoryValidator;
 }
        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.GetOrganisationTypesForProviderTypeIdCategoryId(It.IsAny <int>(), It.IsAny <int>())).ReturnsAsync(organisationTypes);
            _logger = new Mock <ILogger <GetOrganisationTypesByCategoryHandler> >();
            _providerTypeValidator = new ProviderTypeValidator();
            _categoryValidator     = new OrganisationCategoryValidator(_repository.Object);
            _handler = new GetOrganisationTypesByCategoryHandler(_repository.Object, _logger.Object, _providerTypeValidator, _categoryValidator);
        }