public void Given_hazard_substances_risk_assessment_has_reviews_with_mapping_then_reviews_are_populated()
        {
            //Given
            var hazardousSubstanceRiskAssessment = new HazardousSubstanceRiskAssessment();
            hazardousSubstanceRiskAssessment.Reviews = new List<RiskAssessmentReview>(){ new RiskAssessmentReview(){Id = 123123}};
            var target = new HazardousSubstanceRiskAssessmentDtoMapper();

            //When
            var result = target.Map(hazardousSubstanceRiskAssessment);

            //Act
            Assert.IsNotNull(result.Reviews);
            Assert.IsTrue(result.Reviews.Any());
            Assert.AreEqual(hazardousSubstanceRiskAssessment.Reviews.First().Id, result.Reviews.First().Id);
            

        }
        public void Given_hazard_substances_risk_assessment_with_any_mapping_then_created_by_is_not_null()
        {
            //Given
            var hazardousSubstanceRiskAssessment = new HazardousSubstanceRiskAssessment();
            hazardousSubstanceRiskAssessment.CreatedBy = new UserForAuditing
                                    {
                                        Id = Guid.NewGuid(),
                                        Employee =
                                            new EmployeeForAuditing() {Id = Guid.NewGuid(), Forename = "testf", Surname = "testS"}
                                    };
            var target = new HazardousSubstanceRiskAssessmentDtoMapper();

            //When
            var result = target.Map(hazardousSubstanceRiskAssessment);

            //Act
            Assert.IsNotNull(result.CreatedBy);
            
        }
        public virtual IEnumerable<HazardousSubstanceRiskAssessmentDto> Search(SearchHazardousSubstanceRiskAssessmentsRequest request)
        {
            var riskAssessments = _hazardousSubstanceRiskAssessmentRepository.Search(
                request.Title,
                request.CompanyId,
                request.CreatedFrom,
                request.CreatedTo,
                request.HazardousSubstanceId,
                request.AllowedSiteIds,
                request.ShowDeleted,
                request.ShowArchived,
                request.CurrentUserId,
                request.SiteId,
                request.SiteGroupId,
                request.Page,
                request.PageSize,
                request.OrderBy,
                request.OrderByDirection
                );

            var riskAssessmentDtos = new HazardousSubstanceRiskAssessmentDtoMapper().Map(riskAssessments);
            return riskAssessmentDtos;

            //TODO: HazardousSubstanceRiskAssessmentDto must be refactored to inherit from RiskAssessmentDto, and then mapped using RiskAssessmentDtoMapper,
            //The same way as the other risk assessments, until this is done, HSRA will possibly show performance problems.

            //var riskAssessmentDtos = new RiskAssessmentDtoMapper().MapWithSiteAndRiskAssessor(riskAssessments);
            //var hazardousSubstanceRiskAssessmentDtos = riskAssessmentDtos.Select(riskAssessmentDto => riskAssessmentDto as HazardousSubstanceRiskAssessmentDto);
            //return hazardousSubstanceRiskAssessmentDtos;
        }