public void SetUp()
		{
			ReferenceManager = Substitute.For<IReferenceManagement>();
			AppraiserUserService = Substitute.For<IAppraiserUserService>();
			AppraisalCompanyService = Substitute.For<IAppraisalCompanyService>();
			ClientCompanyService = Substitute.For<IClientCompaniesListService>();
			ClientBranchesService = Substitute.For<IBranchesService>();
			ClientCompanyProfileService = Substitute.For<IClientCompanyProfileService>();
			Target = new CommonFunctionsController(AppraiserUserService, ClientBranchesService, ReferenceManager, AppraisalCompanyService, ClientCompanyService, ClientCompanyProfileService);

			IKernel kernel = new StandardKernel();
			var refRepository = Substitute.For<IReferenceRepository>();
			refRepository.GetRoles().ReturnsForAnyArgs(new List<Role>
			{
				new Role { DisplayName = "Appraiser", Id = 1 },
				new Role { DisplayName = "Appraisal Company Admin", Id = 2 },
				new Role { DisplayName = "DVS Super Admin", Id = 3 },
				new Role { DisplayName = "DVS Admin", Id = 4 },
				new Role { DisplayName = "Company Admin and Appraiser", Id = 5 }
			});
			refRepository.GetRole(RoleType.AppraisalCompanyAdmin).Returns(new Role { DisplayName = "Appraisal Company Admin", Id = 2 });
			refRepository.GetRole(RoleType.DvsAdmin).Returns(new Role { DisplayName = "DVS Admin", Id = 4 });

			kernel.Bind<IReferenceRepository>().ToConstant(refRepository);
			kernel.Bind<IReferenceManagement>().To<ReferenceManagement>().InSingletonScope();
			kernel.Bind<ICacheService>().To<FakeCacheService>();
			Singletones.NinjectKernel = kernel;
		}
Beispiel #2
0
		public CommonFunctionsController(IAppraiserUserService appraiserService, IBranchesService clientBranchService,
				IReferenceManagement refManager, IAppraisalCompanyService companyService, IClientCompaniesListService clientCompanyService, IClientCompanyProfileService clientCompanyProfileService)
		{
			_appraiserService = appraiserService;
			_clientBranchService = clientBranchService;
			_refManager = refManager;
			_companyService = companyService;
			_clientCompanyService = clientCompanyService;
			_clientCompanyProfileService = clientCompanyProfileService;
		}
Beispiel #3
0
		public CompanyProfileController(IClientCompanyProfileService companyProfileService, IControllerPluginFactory controllerPluginFactory)
			: base(controllerPluginFactory)
		{
			_companyProfileService = ValidationUtil.CheckOnNullAndThrowIfNull(companyProfileService);
		}