public void GetBenefitDeductionsPositive() { IEmployeeRepository EmployeeRepos = new EmployeeRepository(); var AEmployee = EmployeeRepos.GetEmployeeById(1); Assert.IsNotNull(AEmployee); List <IFamilyMember> FamilyMembers = EmployeeRepos.GetFamilyMembers(AEmployee); Assert.IsNotNull(FamilyMembers); ISalaryRepository SalaryEmployeeRepos = new SalaryRepository(AEmployee); ISalary AEmployeeSalary = SalaryEmployeeRepos.GetSalary(); Assert.IsNotNull(AEmployeeSalary); IBenefitDeductionRepository BenefitDeductionRepos = new BenefitDeductionRepository(AEmployee, FamilyMembers, AEmployeeSalary); IBenefitDeductionDetail ABenefitDeductionDetail = BenefitDeductionRepos.CalculateBenefitDeductionDetail(); Assert.IsNotNull(ABenefitDeductionDetail); }
public static BenefitDeductionDetailDto Convert(IBenefitDeductionDetail aBenefitDeductDetail) { if (aBenefitDeductDetail == null) { return(null); } var MapperConfig = new MapperConfiguration(cfg => { cfg.CreateMap <IBenefitDeductionDetail, BenefitDeductionDetailDto>(); cfg.CreateMap <IBenefitDeductionItem, BenefitDeductionItemDto>(); }); IMapper iMapper = MapperConfig.CreateMapper(); var Results = iMapper.Map <IBenefitDeductionDetail, BenefitDeductionDetailDto>(aBenefitDeductDetail); return(Results); }
public ActionResult <BenefitDeductionDetailDto> Get(int employeeId) { IEmployeeRepository EmployeeRepos = new EmployeeRepository(); var AEmployee = EmployeeRepos.GetEmployeeById(employeeId); List <IFamilyMember> FamilyMembers = EmployeeRepos.GetFamilyMembers(AEmployee); ISalaryRepository SalaryEmployeeRepos = new SalaryRepository(AEmployee); ISalary AEmployeeSalary = SalaryEmployeeRepos.GetSalary(); IBenefitDeductionRepository BenefitDeductionRepos = new BenefitDeductionRepository(AEmployee, FamilyMembers, AEmployeeSalary); IBenefitDeductionDetail ABenefitDeductionDetail = BenefitDeductionRepos.CalculateBenefitDeductionDetail(); var ABenefitDeductionDetailDto = Util.Converters. BenefitDeductionDetailConverter.Convert(ABenefitDeductionDetail); return(ABenefitDeductionDetailDto); }