Beispiel #1
0
        public void Setup()
        {
            _riskAssessmentId = 100;
            _viewModelFactory = new Mock<IEditPersonalRiskAssessmentSummaryViewModelFactory>();
           
            var viewModel = new EditSummaryViewModel();
            _viewModelFactory
                .Setup(x => x.GetViewModel())
                .Returns(viewModel);

            _riskAssessmentService = new Mock<IPersonalRiskAssessmentService>();
        
            _target = GetTarget();
            _currentUserId = _target.CurrentUser.UserId;

            _viewModelFactory
               .Setup(x => x.WithRiskAssessmentId(It.IsAny<long>()))
               .Returns(_viewModelFactory.Object);
            _viewModelFactory
                .Setup(x => x.WithCompanyId(It.IsAny<long>()))
                .Returns(_viewModelFactory.Object);
            _viewModelFactory
               .Setup(x => x.WithAllowableSiteIds(It.IsAny<IList<long>>()))
               .Returns(_viewModelFactory.Object);
            _viewModelFactory
                .Setup(x => x.WithCurrentUserId(_currentUserId))
                .Returns(_viewModelFactory.Object);
        }
Beispiel #2
0
        private SummaryController GetTarget()
        {
            var result = new SummaryController(_riskAssessmentService.Object,_viewModelFactory.Object);

            return TestControllerHelpers.AddUserToController(result);
        }