예제 #1
0
 public EstimationsController(IBuildingRepository buildingRepository,
                              ICompanyRepository companyRepository,
                              IUserRepository userRepository,
                              IUserSession userSession,
                              IEstimationAccessRules estimationAccessRules,
                              IRepositoryFactory repositoryFactory) : base(buildingRepository, repositoryFactory)
 {
     _buildingRepository    = buildingRepository;
     _companyRepository     = companyRepository;
     _userRepository        = userRepository;
     _userSession           = userSession;
     _estimationAccessRules = estimationAccessRules;
 }
        public void SetUp()
        {
            _userSession = Substitute.For <IUserSession>();

            _buildingRepository = Substitute.For <IBuildingRepository>();
            _companyRepository  = Substitute.For <ICompanyRepository>();
            _userRepository     = Substitute.For <IUserRepository>();

            _repositoryFactory    = Substitute.For <IRepositoryFactory>();
            _reportRepository     = Substitute.For <IReportRepository>();
            _estimationRepository = Substitute.For <IEstimationRepository>();
            _repositoryFactory.Report(Arg.Any <string>()).Returns(_reportRepository);
            _repositoryFactory.Estimation(Arg.Any <string>()).Returns(_estimationRepository);

            _estimationAccessRules = Substitute.For <IEstimationAccessRules>();

            _estimationsController = new EstimationsController(_buildingRepository, _companyRepository, _userRepository, _userSession, _estimationAccessRules, _repositoryFactory);
        }