public void Setup() { _ministryPlatformService = new Mock <IMinistryPlatformService>(); _configurationWrapper = new Mock <IConfigurationWrapper>(); _authenticationService = new Mock <IAuthenticationRepository>(); _fixture = new SkillsRepository(_authenticationService.Object, _configurationWrapper.Object, _ministryPlatformService.Object); }
public CreateVacancyController() { _jobOfferRepo = new JobOffersRepository(); _userRepo = new UserRepository(); _profRepo = new ProfessionsRepository(); _skillsRepository = new SkillsRepository(); _abilRepository = new AbilitiesRepository(); _abilSetRepository = new AbilitySetsRepository(); }
public ApplianceController() { _appRepository = new JobAppliancesRepository(); _userRepository = new UserRepository(); _skillsRepository = new SkillsRepository(); _skillAttrsRepository = new SkillAttributesRepository(); _abilRepository = new AbilitiesRepository(); _abilSetRepository = new AbilitySetsRepository(); }
public ActionResult DeleteSkillsCategory(Guid id) { var skillRepo = new SkillsRepository(); skillRepo.DeleteSkillCategory(id); ViewBag.Mode = PageViewMode.EditSkillCategory; return(RedirectToAction("/", new { mode = "EditSkillCategory" })); }
public ActionResult AddSkillCategory(SkillsCategoryViewModel viewModel) { if (ModelState.IsValid) { var model = new SkillCategory(); viewModel.FillModel(model); var skillCatRepo = new SkillsRepository(); skillCatRepo.AddSkillCategory(model); } return(RedirectToAction("/", new { mode = "EditSkillCategory" })); }
public void Setup() { _dbContextOptions = new DbContextOptionsBuilder <StudentifyDbContext>() .UseInMemoryDatabase(databaseName: "StudentifyDb") .Options; _context = new StudentifyDbContext(_dbContextOptions); _repository = new SkillsRepository(_context, new SelectRepositoryBase <Skill>(_context), new InsertRepositoryBase <Skill>(_context), new UpdateRepositoryBase <Skill>(_context)); }
public ActionResult AddSkill(SkillViewModel viewModel) { if (ModelState.IsValid) { var model = new Skill(); viewModel.FillModel(model); var skillRepo = new SkillsRepository(); skillRepo.AddSkill(model, viewModel.SkillCategory); } return(new RedirectResult(Url.Action("Index", new { mode = "EditSkillCategory" }) + "#profskills")); }
public async Task Delete_WhenCalled_ShouldWork() { _mockAdapter.Setup( _ => _.Delete(It.IsAny <string>())).Returns(Task.FromResult(HttpStatusCode.NoContent) ); var repository = new SkillsRepository(_mockAdapter.Object, _mockLogger.Object); var actual = await repository.Delete(""); Assert.IsAssignableFrom <HttpStatusCode>(actual); Assert.Contains( ((int)HttpStatusCode.NoContent).ToString(), JsonConvert.SerializeObject(actual) ); }
public async Task Update_WhenCalled_ShouldWork() { var expected = "1234567890"; var skillDto = new SkillDto { Id = expected }; _mockAdapter.Setup(_ => _.Update(It.IsAny <SkillDto>())).Returns(Task.FromResult(skillDto)); var repository = new SkillsRepository(_mockAdapter.Object, _mockLogger.Object); var actual = await repository.Update(skillDto); Assert.IsAssignableFrom <SkillDto>(actual); Assert.Equal(expected, actual.Id); }
public IEnumerable <SkillCategoryDto> GetAllSkillsCategories() { IEnumerable <SkillCategoryDto> results = null; try { var categories = new SkillsRepository(_appDbContext).GetSkillsCategories(); results = _mapper.Map <IEnumerable <SkillCategory>, IEnumerable <SkillCategoryDto> >(categories); } catch (Exception e) { _log.LogError(e, "Error in GetSkillsByCategoryId"); } return(results); }
public IEnumerable <SkillDto> Get() { IEnumerable <SkillDto> results = null; try { var allSkills = new SkillsRepository(_appDbContext).GetAll(); results = _mapper.Map <IEnumerable <Skill>, IEnumerable <SkillDto> >(allSkills); } catch (Exception e) { _log.LogError(e, "Error in Get()"); } return(results); }
public IEnumerable <SkillDto> GetSkillsByCategoryId(int id) { IEnumerable <SkillDto> results = null; try { var relevantSkills = new SkillsRepository(_appDbContext).GetSkillsByCategoryId(id); results = _mapper.Map <IEnumerable <Skill>, IEnumerable <SkillDto> >(relevantSkills); } catch (Exception e) { _log.LogError(e, "Error in GetSkillsByCategoryId"); } return(results); }
private FrontPageViewModel GetFrontPageViewModel(PageViewMode?mode) { var repo = new PersonalInfoRepository(); var personalInfo = repo.GetPersonalInfo(); var eduRepo = new EducationRepository(); var educations = eduRepo.GetEducations(); var expRepo = new WorkExperienceRepository(); var experience = expRepo.GetWorkExperience(); var skillsRepo = new SkillsRepository(); var skills = skillsRepo.GetSkills(); ViewBag.Mode = mode ?? PageViewMode.View; var frontPageViewModel = new FrontPageViewModel() { EducationBlock = new EducationListViewModel() { NewEducation = new EducationViewModel() }, WorkExperienceBlock = new WorkExperienceListViewModel() { NewWorkExpirience = new WorkExperienceViewModel() }, SkillCategoryBlock = new SkillsCategoryListViewModel() { NewSkillCategory = new SkillsCategoryViewModel(), } }; frontPageViewModel.PersonalInfo = new PersonalInfoViewModel(personalInfo); frontPageViewModel.EducationBlock.EducationList = educations.Select(x => new EducationViewModel(x)).ToList(); frontPageViewModel.EducationBlock.NewEducation = new EducationViewModel(); frontPageViewModel.WorkExperienceBlock.WorkExperienceList = experience.Select(x => new WorkExperienceViewModel(x)).ToList(); frontPageViewModel.WorkExperienceBlock.NewWorkExpirience = new WorkExperienceViewModel(); frontPageViewModel.SkillCategoryBlock.SkillsCategoryList = skills.Select(x => new SkillsCategoryViewModel(x)).ToList(); frontPageViewModel.SkillCategoryBlock.NewSkillCategory = new SkillsCategoryViewModel(); return(frontPageViewModel); }
public async Task <List <EntityReference> > GetAllReferences(int id) { List <EntityReference> entityReferences = new List <EntityReference>(); entityReferences.AddRange(AcademiaRepository.Where(x => x.CompensationMatrixId == id) .ToList() .Select(x => new EntityReference() { Id = entityReferences.Count + 1, Name = x.Name, Code = x.Code, Type = "Academia" })); entityReferences.AddRange(SkillsRepository.Where(x => x.CompensationMatrixId == id) .ToList() .Select(x => new EntityReference() { Id = entityReferences.Count + 1, Name = x.Name, Code = x.Code, Type = "Skill" })); entityReferences.AddRange(FunctionsRepository.Where(x => x.CompensationMatrixId == id) .ToList() .Select(x => new EntityReference() { Id = entityReferences.Count + 1, Name = x.Name, Code = x.Code, Type = "Function" })); entityReferences.AddRange(TasksRepository.Where(x => x.CompensationMatrixId == id) .ToList() .Select(x => new EntityReference() { Id = entityReferences.Count + 1, Name = x.Name, Code = x.Code, Type = "Task" })); entityReferences.AddRange(JobsRepository.Where(x => x.CompensationMatrixId == id) .ToList() .Select(x => new EntityReference() { Id = entityReferences.Count + 1, Name = x.Name, Code = x.Code, Type = "Job" })); return(entityReferences); }
public async Task <OS_TaskSkillTemplate_Dto> AddTaskSkillTemplate(OS_TaskSkillTemplate_Dto functionSkillTemplate) { OS_TaskSkillTemplate toAdd = ObjectMapper.Map <OS_TaskSkillTemplate_Dto, OS_TaskSkillTemplate>(functionSkillTemplate); return(ObjectMapper.Map <OS_TaskSkillTemplate, OS_TaskSkillTemplate_Dto>(await SkillsRepository.InsertAsync(toAdd))); }
//public async Task<OS_TaskQualificationTemplate_Dto> AddQualificationTemplate(OS_TaskQualificationTemplate taskQualificationTemplate) //{ // return ObjectMapper.Map<OS_TaskQualificationTemplate, OS_TaskQualificationTemplate_Dto>(await QualificationsRepository.InsertAsync(taskQualificationTemplate)); //} //public async Task<OS_TaskQualificationTemplate_Dto> AddQualificationTemplate(OS_TaskQualificationTemplate_Dto taskQualificationTemplate) //{ // OS_TaskQualificationTemplate toAdd = ObjectMapper.Map<OS_TaskQualificationTemplate_Dto, OS_TaskQualificationTemplate>(taskQualificationTemplate); // return ObjectMapper.Map<OS_TaskQualificationTemplate, OS_TaskQualificationTemplate_Dto>(await QualificationsRepository.InsertAsync(toAdd)); //} public async Task <OS_TaskSkillTemplate_Dto> AddTaskSkill(OS_TaskSkillTemplate functionSkillTemplate) { return(ObjectMapper.Map <OS_TaskSkillTemplate, OS_TaskSkillTemplate_Dto>(await SkillsRepository.InsertAsync(functionSkillTemplate))); }
public SkillsController(SkillsRepository repository) { _repository = repository; }
public SkillsController() { _context = new KEPT_DBEntities(); _repository = new SkillsRepository(_context); }
/// <summary> /// Initializes a new instance of the <see cref="website.Controllers.SkillsController"/> class. /// </summary> public SkillsController() { _skillsRepository = new SkillsRepository(); }