Example #1
0
		public AppraiserProfileController
				(
				IAppraiserUserService appraiserUserService,
				IAscGovLicenseService ascGovLicenseService,
				IUsersManagement usersManager,
				IReferenceManagement referenceManagement,
				IDVSUserManager dvsUsersManager,
				IAppraiserManagement appraiserManager,
				IAppraiserAccessManager appraiserAccessManager,
				IHUDService hudService,
				IUserAccessHelper userAccessHelper,
				IGeocodingValidation geocodingValidation,
				ITestOrderManager testOrderManager,
				ITaskManager taskManager
				)
		{
			_appraiserUserService = ValidationUtil.CheckOnNullAndThrowIfNull(appraiserUserService);
			_ascGovLicenseService = ValidationUtil.CheckOnNullAndThrowIfNull(ascGovLicenseService);
			_usersManager = ValidationUtil.CheckOnNullAndThrowIfNull(usersManager);
			_referenceManagement = ValidationUtil.CheckOnNullAndThrowIfNull(referenceManagement);
			_appraiserManager = ValidationUtil.CheckOnNullAndThrowIfNull(appraiserManager);
			_dvsUsersManager = ValidationUtil.CheckOnNullAndThrowIfNull(dvsUsersManager);
			_appraiserAccessManager = ValidationUtil.CheckOnNullAndThrowIfNull(appraiserAccessManager);
			_hudService = ValidationUtil.CheckOnNullAndThrowIfNull(hudService);
			_userAccessHelper = ValidationUtil.CheckOnNullAndThrowIfNull(userAccessHelper);
			_geocodingValidation = geocodingValidation;
			_testOrderManager = ValidationUtil.CheckOnNullAndThrowIfNull(testOrderManager);
			_taskManager = ValidationUtil.CheckOnNullAndThrowIfNull(taskManager);
		}
		public AppraisalCompanyWizardController(IAppraisalCompanyService appraisalCompanyService, IAppraiserManagement appraiserManagement, ITaskManager taskManager, IGeocodingValidation geocodingValidation)
		{
			_appraisalCompanyService = appraisalCompanyService;
			_appraiserManagement = appraiserManagement;
			_taskManager = taskManager;
			_geocodingValidation = geocodingValidation;
		}
		public void SetUp()
		{
			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;
			_userManager = Substitute.For<IUsersManagement>();
			_appraiserService = Substitute.For<IAppraiserUserService>();
			_companyService = Substitute.For<IAppraisalCompanyService>();
			_taskManager = Substitute.For<ITaskManager>();
			_testOrderManager = Substitute.For<ITestOrderManager>();
			//_geocodingValidation = new GeocodingZIPValidation(Substitute.For<IGeocodingDataService>());
			//_geocodingValidation.ValidateAddress(new ValidateAddressArg()).ReturnsForAnyArgs(new ValidateAddressResult { IsValid = true });
			_geocodingValidation = new FakeGeocodingZIPValidation();

			_target = new AppraiserUserAddController(_userManager, _appraiserService, _companyService, _taskManager, _testOrderManager, _geocodingValidation);
			_target.SecurityContext = Substitute.For<ISecurityContext>();
			_target.SecurityContext.CurrentUser.Returns(new User() { Id = 1, Roles = new Role[] { new Role() { Id = (int)RoleType.DvsAdmin } } });
		}
		public AppraisalCompanyProfileController(
			IAppraisalCompanyService appraisalCompanyWizardService,
			IAppraiserManagement appraiserManagement,
			IReferenceManagement referenceManagement,
			IAppraisalCompanyBranchesService appraisalCompanyBranchesService,
			IGeocodingValidation geocodingValidation)
		{
			_appraisalCompanyWizardService = appraisalCompanyWizardService;
			_referenceManagement = referenceManagement;
			_appraiserManagement = appraiserManagement;
			var branchesService = new BranchesDatabaseService(appraisalCompanyBranchesService);
			branchesService.CurrentCompanyService = new LazeCurrentCompanyService(GetAppraisalCompanyId);
			var lazyCompanyDetails =
				new Lazy<AppraisalCompanyDetailsViewModel>(
					() => _appraisalCompanyWizardService.GetAppraisalCompanyDetails(GetAppraisalCompanyId()));
			_branchesService = new BranchesServiceSecurity(branchesService, lazyCompanyDetails);
			_branchAcceses = new BranchAcceses(lazyCompanyDetails);
			_brancheMessagesService = new BrancheMessageService(() => Session, branchesService.CurrentCompanyService)
			{
				BrancheAddedMessage = Constants.Notifications.BranchSaved,
				BranchesAddedMessage = Constants.Notifications.BranchesSaved,
				EmptyResult = string.Empty
			};
			_geocodingValidation = geocodingValidation;
		}
		public AppraisalCompanyAddController(IAppraisalCompanySignUpService appraisalCompanySignUpService,
			ITaskManager taskManager, IGeocodingValidation geocodingValidation)
		{
			_appraisalCompanySignUpService = ValidationUtil.CheckOnNullAndThrowIfNull(appraisalCompanySignUpService);
			_taskManager = ValidationUtil.CheckOnNullAndThrowIfNull(taskManager);
			_geocodingValidation = ValidationUtil.CheckOnNullAndThrowIfNull(geocodingValidation);
		}
Example #6
0
		public AppraiserUserAddController(IUsersManagement userManager, IAppraiserUserService appraiserService, IAppraisalCompanyService companyService, ITaskManager taskManager, ITestOrderManager testOrderManager,
			IGeocodingValidation geocodingValidation)
		{
			_userManager = userManager;
			_appraiserService = appraiserService;
			_companyService = companyService;
			_taskManager = taskManager;
			_testOrderManager = testOrderManager;
			_geocodingValidation = geocodingValidation;
		}
		public void SetUp()
		{
			GeocodingValidation = Substitute.For<IGeocodingValidation>();
			AppraisalCompanyWizardService = Substitute.For<IAppraisalCompanyService>();
			AppraiserManagement = Substitute.For<IAppraiserManagement>();
			TaskManager = Substitute.For<ITaskManager>();
			var vc = new ViewContext();
			vc.HttpContext = MockHttpContext.FakeHttpContext();
			Target = new AppraisalCompanyWizardController(AppraisalCompanyWizardService, AppraiserManagement, TaskManager, GeocodingValidation);
			Target.CommitProviderInstance = Substitute.For<ICommitProvider>();
			Target.CompanyWizzardMenuManager = Substitute.For<AppraisalCompanyWizardController.ICompanyMenuManager>();
			Target.SetFakeControllerContext(vc.HttpContext);
		}
		public void SetUp()
		{
			AppraisalCompanyProfileService = Substitute.For<IAppraisalCompanyService>();
			AppraiserManagement = Substitute.For<IAppraiserManagement>();
			ReferenceManagement = Substitute.For<IReferenceManagement>();
			AppraisalCompanyBranchesService = Substitute.For<IAppraisalCompanyBranchesService>();
			GeocodingValidation = Substitute.For<IGeocodingValidation>();

			Target = new AppraisalCompanyProfileController(AppraisalCompanyProfileService, AppraiserManagement,
			                                               ReferenceManagement, AppraisalCompanyBranchesService,
			                                               GeocodingValidation);
			Target.CommitProviderInstance = Substitute.For<ICommitProvider>();
		}
		public void SetUp()
		{
			AscGovLicenseService = Substitute.For<IAscGovLicenseService>();
			AppraiserUserService = Substitute.For<IAppraiserUserService>();
			ReferenceManagement = Substitute.For<IReferenceManagement>();
			DocumentService = Substitute.For<IDocumentService>();
			GeocodingValidation = Substitute.For<IGeocodingValidation>();
			TaskManager = Substitute.For<ITaskManager>();
			HUDService = Substitute.For<IHUDService>();
			TestOrderManager = Substitute.For<ITestOrderManager>();
			var vc = new ViewContext();
			vc.HttpContext = MockHttpContext.FakeHttpContext();
			Target = new AppraiserWizardController(AscGovLicenseService, AppraiserUserService, ReferenceManagement, DocumentService, TaskManager, HUDService, GeocodingValidation, TestOrderManager);
			Target.CommitProviderInstance = Substitute.For<ICommitProvider>();
			Target.SetFakeControllerContext(vc.HttpContext);
			HUDService.CheckFHARoster(Arg.Any<string>()).Returns(new CheckFHARosterResult(false, string.Empty, false));
		}
Example #10
0
		public AppraiserWizardController(
			IAscGovLicenseService ascGovLicenseService,
			IAppraiserUserService appraiserUserService,
			IReferenceManagement referenceManagement,
			IDocumentService documentService,
			ITaskManager taskManager,
			IHUDService hudService,
			IGeocodingValidation geocodingValidation,
			ITestOrderManager testOrderManager)
		{
			_ascGovLicenseService = ascGovLicenseService;
			_appraiserUserService = appraiserUserService;
			_referenceManagement = referenceManagement;
			_documentService = documentService;
			_taskManager = taskManager;
			_hudService = hudService;
			_geocodingValidation = geocodingValidation;
			_testOrderManager = testOrderManager;
		}
		public void SetUp()
		{
			GeocodingValidation = Substitute.For<IGeocodingValidation>();
			AppraiserUserService = Substitute.For<IAppraiserUserService>();
			AscGovLicenseService = Substitute.For<IAscGovLicenseService>();
			UsersManager = Substitute.For<IUsersManagement>();
			AppraiserManager = Substitute.For<IAppraiserManagement>();
			DvsUsersManager = Substitute.For<IDVSUserManager>();
			ReferenceManagement = Substitute.For<IReferenceManagement>();
			ViewContext = new ViewContext();
			ViewContext.HttpContext = MockHttpContext.FakeHttpContext();
			AppraiserAccessManager = Substitute.For<IAppraiserAccessManager>();
			Target = new AppraiserProfileController(AppraiserUserService, AscGovLicenseService,
				UsersManager, ReferenceManagement,
				DvsUsersManager, AppraiserManager,
				AppraiserAccessManager, Substitute.For<IHUDService>(), Substitute.For<IUserAccessHelper>(), GeocodingValidation, Substitute.For<ITestOrderManager>(), Substitute.For<ITaskManager>());
			Target.CommitProviderInstance = Substitute.For<ICommitProvider>();
			Target.SetFakeControllerContext(ViewContext.HttpContext);
		}
		public AppraisalCompanyDetailsController(IAppraisalCompanyService appraisalCompanyWizardService, IAppraisalCompanyBranchesService appraisalCompanyAdminManagement, IReferenceManagement referenceManagement, IUserAccessHelper userAccessHelper, IGeocodingValidation geocodingValidation)
		{
			_appraisalCompanyWizardService = appraisalCompanyWizardService;
			_referenceManagement = referenceManagement;
			_userAccessHelper = userAccessHelper;
			_geocodingValidation = geocodingValidation;

			var branchesDatabaseService = new BranchesDatabaseService(appraisalCompanyAdminManagement);
			_propertyCurrentCompanyService = new PropertyCurrentCompanyService();
			branchesDatabaseService.CurrentCompanyService = _propertyCurrentCompanyService;
			var branchesSecurityService = new BranchesServiceSecurity(branchesDatabaseService,
																																new Lazy<AppraisalCompanyDetailsViewModel>(
																																	() =>
																																	_appraisalCompanyWizardService.GetAppraisalCompanyDetails(
																																		_propertyCurrentCompanyService.CurrentCompany)));
			_branchesService = branchesSecurityService;
			_brancheMessagesService = new BrancheMessageService(() => Session, _propertyCurrentCompanyService)
			{
				BrancheAddedMessage = Constants.Notifications.BranchSaved,
				BranchesAddedMessage = Constants.Notifications.BranchesSaved,
				EmptyResult = string.Empty
			};
		}