public void Setup()
        {
            _log = new Mock<IPeninsulaLog>();
            _generalRiskAssessmentRepository = new Mock<IGeneralRiskAssessmentRepository>();
            _riskAssessmentRepository = new Mock<IRiskAssessmentRepository>();
            _userRepository = new Mock<IUserForAuditingRepository>();
            _employeeRepository = new Mock<IEmployeeRepository>();
            _siteRepository = new Mock<ISiteRepository>();
            _riskAssessorRepository = new Mock<IRiskAssessorRepository>();

            _request = new SaveRiskAssessmentSummaryRequest()
                       {
                           CompanyId = 100,
                           Reference = "Reference",
                           Title = "Title",
                           UserId = Guid.NewGuid(),
                           Id = 200,
                           AssessmentDate = DateTime.Now,
                           RiskAssessorId = 252L,
                           SiteId = 200
                       };

            _riskAssessmentRepository
                .Setup(x => x.DoesAssessmentExistWithTheSameReference<GeneralRiskAssessment>(It.IsAny<long>(), It.IsAny<string>(), It.IsAny<long?>()))
                .Returns(false);

            _target = CreateRiskAssessmentService();
        }
        public void Setup()
        {
            _log = new Mock<IPeninsulaLog>();
            _generalRiskAssessmentRepository = new Mock<IGeneralRiskAssessmentRepository>();
            _riskAssessmentRepository = new Mock<IRiskAssessmentRepository>();
            _userRepository = new Mock<IUserForAuditingRepository>();
            _employeeRepository = new Mock<IEmployeeRepository>();
            _siteRepository = new Mock<ISiteRepository>();
            _riskAssessorRepository = new Mock<IRiskAssessorRepository>();

            _riskAssessment = new GeneralRiskAssessment() {Id = 123,CompanyId = 12312, RiskAssessmentSite = new Site(){Id=13123}, RiskAssessor = new RiskAssessor(){Id=16209478}};

            _riskAssessmentRepository
                .Setup(x => x.DoesAssessmentExistWithTheSameReference<GeneralRiskAssessment>(It.IsAny<long>(), It.IsAny<string>(), It.IsAny<long?>()))
                .Returns(false);

            _generalRiskAssessmentRepository
               .Setup(x => x.GetByIdAndCompanyId(_riskAssessment.Id, _riskAssessment.CompanyId))
               .Returns(() => _riskAssessment);

            _siteRepository
                .Setup(x => x.GetByIdAndCompanyId(It.IsAny<long>(), It.IsAny<long>()))
                .Returns(() => _site);

            _userRepository
                .Setup(x => x.GetByIdAndCompanyId(It.IsAny<Guid>(), It.IsAny<long>()))
                .Returns(() => _user);

            _riskAssessorRepository
                .Setup(x => x.GetByIdAndCompanyId(It.IsAny<long>(), It.IsAny<long>()))
                .Returns(() => _riskAssessor);

            _target = CreateRiskAssessmentService();
        }
 private GeneralRiskAssessmentService CreateRiskAssessmentService()
 {
     var riskAssessmentService = new GeneralRiskAssessmentService(_riskAssessmentRepository.Object, null, null, null, _log.Object, null, null);
     return riskAssessmentService;
 }
        private GeneralRiskAssessmentService CreateRiskAssessmentService()
        {
            var riskAssessmentService = new GeneralRiskAssessmentService(
                _generalRiskAssessmentRepository.Object, 
                _riskAssessmentRepository.Object, 
                _userRepository.Object, 
                _employeeRepository.Object, 
                _log.Object, 
                _siteRepository.Object,
                _riskAssessorRepository.Object);

            return riskAssessmentService;
        }