public void When_SaveLastRecommendedControlSystem_calls_correct_methods()
        {
            // Given
            var riskAssessment = new Mock<HazardousSubstanceRiskAssessment>();
            var target = GetTarget();
            var request = new SaveLastRecommendedControlSystemRequest
                              {
                                  Id = 10L,
                                  CompanyId = 100L,
                                  ControlSystemId = 1000L,
                                  UserId = Guid.NewGuid()
                              };

            _hazardousSubstanceAssessmentRepository
                .Setup(x => x.GetByIdAndCompanyId(
                    request.Id,
                    request.CompanyId))
                .Returns(riskAssessment.Object);

            _userRepository
                .Setup(x => x.GetByIdAndCompanyId(
                    request.UserId,
                    request.CompanyId))
                .Returns(_userForAuditing);

            var controlSystem = new ControlSystem();

            _controlSystemRepository
                .Setup(x => x.LoadById(request.ControlSystemId))
                .Returns(controlSystem);

            // When
            target.SaveLastRecommendedControlSystem(request);

            // Then
            _hazardousSubstanceAssessmentRepository.Verify(x => x.SaveOrUpdate(riskAssessment.Object));
            riskAssessment.Verify(x => x.SetLastRecommendedControlSystem(controlSystem, _userForAuditing));
            _controlSystemRepository.VerifyAll();
        }
        public void SaveLastRecommendedControlSystem(SaveLastRecommendedControlSystemRequest request)
        {
            var riskAssessment = _hazardousSubstanceRiskAssessmentRepository.GetByIdAndCompanyId(request.Id, request.CompanyId);
            var user = _userForAuditingRepository.GetByIdAndCompanyId(request.UserId, request.CompanyId);
            var controlSystem = _controlSystemRepository.LoadById(request.ControlSystemId);

            riskAssessment.SetLastRecommendedControlSystem(controlSystem, user);

            _hazardousSubstanceRiskAssessmentRepository.SaveOrUpdate(riskAssessment);
        }