예제 #1
0
        public void Setup()
        {
            _riskAssessmentId = 100;
            _companyId = 500;

            _viewModelFactory = new Mock<IFireRiskAssessmentReviewsViewModelFactory>();

            target = GetTarget();

            _viewModelFactory
                .Setup(x => x.WithRiskAssessmentId(_riskAssessmentId))
                .Returns(_viewModelFactory.Object);
            
            _viewModelFactory
                .Setup(x => x.WithCompanyId(_companyId))
                .Returns(_viewModelFactory.Object);

            var customPrincipal = target.CurrentUser;

            _viewModelFactory
                .Setup(x => x.WithUser(customPrincipal))
                .Returns(_viewModelFactory.Object);
            
            
        }
예제 #2
0
 private ReviewController GetTarget()
 {
     var result = new ReviewController(_viewModelFactory.Object, null, null);
     return TestControllerHelpers.AddUserToController(result);
 }