Пример #1
0
		public AppraisalCompanySoftwareViewModel GetAppraisalCompanySoftware(int appraisalCompanyId)
		{
			var appraisalCompany = _appraisalCompanyManagement.GetAppraisalCompanyById(appraisalCompanyId);

			var appraisalCompanySoftware = new AppraisalCompanySoftwareViewModel();
			if (appraisalCompany.Software != null)
			{
				appraisalCompanySoftware.IsACI = appraisalCompany.Software.IsACI;
				appraisalCompanySoftware.IsClickFormsBradfordTechnologies = appraisalCompany.Software.IsClickFormsBradfordTechnologies;
				appraisalCompanySoftware.IsGlobalDMS = appraisalCompany.Software.IsGlobalDMS;
				appraisalCompanySoftware.IsHomePuter = appraisalCompany.Software.IsHomePuter;
				appraisalCompanySoftware.IsModeWinTotalMercury = appraisalCompany.Software.IsModeWinTotalMercury;
				appraisalCompanySoftware.IsOtherSpecified = appraisalCompany.Software.IsOtherSpecified;
				if (appraisalCompanySoftware.IsOtherSpecified)
				{
					appraisalCompanySoftware.Other = appraisalCompany.Software.Other;
				}
			}

			return appraisalCompanySoftware;
		}
		public void SaveAppraisalCompanySoftware_should_populate_to_correct_fields()
		{
			var appraisalCompanySoftware = new AppraisalCompanySoftwareViewModel()
			{
				IsACI = true,
				IsClickFormsBradfordTechnologies = false,
				IsGlobalDMS = true,
				IsHomePuter = false,
				IsModeWinTotalMercury = true,
				IsOtherSpecified = true,
				Other = "sometext"
			};

			AppraisalCompanyDetail dbCompanyDetails = new AppraisalCompanyDetail();
			AppraisalCompanyManagement.GetAppraisalCompanyById(Arg.Any<int>()).Returns(dbCompanyDetails);
			Target.SaveAppraisalCompanySoftware(0, appraisalCompanySoftware);

			//act
			dbCompanyDetails.Software.IsACI.Should().Be(appraisalCompanySoftware.IsACI);
			dbCompanyDetails.Software.IsClickFormsBradfordTechnologies.Should().Be(appraisalCompanySoftware.IsClickFormsBradfordTechnologies);
			dbCompanyDetails.Software.IsGlobalDMS.Should().Be(appraisalCompanySoftware.IsGlobalDMS);
			dbCompanyDetails.Software.IsHomePuter.Should().Be(appraisalCompanySoftware.IsHomePuter);
			dbCompanyDetails.Software.IsModeWinTotalMercury.Should().Be(appraisalCompanySoftware.IsModeWinTotalMercury);
			dbCompanyDetails.Software.IsOtherSpecified.Should().Be(appraisalCompanySoftware.IsOtherSpecified);
			dbCompanyDetails.Software.Other.Should().BeEquivalentTo(appraisalCompanySoftware.Other);
		}
		public void SaveAppraisalCompanySoftware_should_populate_other_as_empty_if_IsOther_is_false()
		{
			var appraisalCompanySoftware = new AppraisalCompanySoftwareViewModel()
			{
				IsOtherSpecified = false,
				Other = "sometext"
			};

			AppraisalCompanyDetail dbCompanyDetails = new AppraisalCompanyDetail();
			AppraisalCompanyManagement.GetAppraisalCompanyById(Arg.Any<int>()).Returns(dbCompanyDetails);
			Target.SaveAppraisalCompanySoftware(0, appraisalCompanySoftware);

			//act
			dbCompanyDetails.Software.Other.Should().BeBlank();
		}
Пример #4
0
		public void SaveAppraisalCompanySoftware(int appraisalCompanyId, AppraisalCompanySoftwareViewModel appraisalCompanySoftware)
		{
			var appraisalCompany = _appraisalCompanyManagement.GetAppraisalCompanyById(appraisalCompanyId);

			if (appraisalCompany.Software == null)
			{
				appraisalCompany.Software = new AppraisalCompanySoftware();
			}
			appraisalCompany.Software.IsACI = appraisalCompanySoftware.IsACI;
			appraisalCompany.Software.IsClickFormsBradfordTechnologies = appraisalCompanySoftware.IsClickFormsBradfordTechnologies;
			appraisalCompany.Software.IsGlobalDMS = appraisalCompanySoftware.IsGlobalDMS;
			appraisalCompany.Software.IsHomePuter = appraisalCompanySoftware.IsHomePuter;
			appraisalCompany.Software.IsModeWinTotalMercury = appraisalCompanySoftware.IsModeWinTotalMercury;
			appraisalCompany.Software.IsOtherSpecified = appraisalCompanySoftware.IsOtherSpecified;
			appraisalCompany.Software.Other = appraisalCompanySoftware.IsOtherSpecified ? appraisalCompanySoftware.Other : string.Empty;
		}