public void Setup()
        {
            _viewModel = new PremisesInformationViewModel();

            _premisesInformationViewModelFactory = new Mock<IPremisesInformationViewModelFactory>();

            _target = GetTarget();
            _currentUserId = _target.CurrentUser.UserId;

            _premisesInformationViewModelFactory
                .Setup(x => x.WithCompanyId(_companyId))
                .Returns(_premisesInformationViewModelFactory.Object);

            _premisesInformationViewModelFactory
                .Setup(x => x.WithRiskAssessmentId(_riskAssessmentId))
                .Returns(_premisesInformationViewModelFactory.Object);

            _premisesInformationViewModelFactory
                .Setup(x => x.WithCurrentUserId(_currentUserId))
                .Returns(_premisesInformationViewModelFactory.Object);

            _premisesInformationViewModelFactory
                .Setup(x => x.GetViewModel())
                .Returns(_viewModel);
        }
 private PremisesInformationController GetTarget()
 {
     var result = new PremisesInformationController(_premisesInformationViewModelFactory.Object, null);
     return TestControllerHelpers.AddUserToController(result);
 }
Exemple #3
0
 private PremisesInformationController GetTarget()
 {
     var controller = new PremisesInformationController(_viewModelFactory.Object, _riskAssessmentService.Object);
     return TestControllerHelpers.AddUserToController(controller);
 }