public void DeriveStatusAndStatusSort_WhenCaseFlowDtoPropertiesIndicate_NoPaymentArrangement_SetsStatusAndStatusName_On_ServiceDto( double?testOutstandingBalance, bool testIsPlanInPlace) { // Note: using double because 'decimal' can't be used in DataRow CaseFlowAccountCommonTest caseFlowDto = new CaseFlowAccountCommonTest() { OutstandingBalance = (decimal?)testOutstandingBalance, HasArrangement = testIsPlanInPlace, CanMakePayment = true // must set this or 'can set up plan' to avoid falling into View Only }; MyAccountsSummaryResultDto resultDtoToBeUpdated = new MyAccountsSummaryResultDto(); _process.DeriveStatusAndStatusSort(caseFlowDto, resultDtoToBeUpdated); Assert.AreEqual("There are no payments set up on this account.", resultDtoToBeUpdated.AccountStatus); Assert.AreEqual(StatusSort_NoPaymentArrangement, resultDtoToBeUpdated.AccountStatusSort); Assert.AreEqual(false, resultDtoToBeUpdated.AccountStatusIsClosed); Assert.AreEqual(false, resultDtoToBeUpdated.AccountStatusIsWithSolicitors); Assert.AreEqual(false, resultDtoToBeUpdated.AccountStatusIsViewOnly); Assert.AreEqual(true, resultDtoToBeUpdated.CanManageAccount); }
public void DeriveStatusAndStatusSort_WhenCaseFlowDtoPropertiesIndicate_ViewAccountOnly_SetsStatusAndStatusName_On_ServiceDto( double?testOutstandingBalance) { // Note: using double because 'decimal' can't be used in DataRow CaseFlowAccountCommonTest caseFlowDto = new CaseFlowAccountCommonTest() { OutstandingBalance = (decimal?)testOutstandingBalance, CanSetupIndividualPlan = false, CanMakePayment = false }; MyAccountsSummaryResultDto resultDtoToBeUpdated = new MyAccountsSummaryResultDto(); _process.DeriveStatusAndStatusSort(caseFlowDto, resultDtoToBeUpdated); Assert.AreEqual("View Account Details Only", resultDtoToBeUpdated.AccountStatus); Assert.AreEqual(StatusSort_ViewAccountDetailsOnly, resultDtoToBeUpdated.AccountStatusSort); Assert.AreEqual(false, resultDtoToBeUpdated.AccountStatusIsClosed); Assert.AreEqual(false, resultDtoToBeUpdated.AccountStatusIsWithSolicitors); Assert.AreEqual(true, resultDtoToBeUpdated.AccountStatusIsViewOnly); Assert.AreEqual(false, resultDtoToBeUpdated.CanManageAccount); }
public void IsWithSolicitors_WhenCaseFlowDtoCompanyIsNot2_ReturnsTrue(long?testCompany) { CaseFlowAccountCommonTest caseFlowDto = new CaseFlowAccountCommonTest() { Company = testCompany }; Assert.AreEqual(false, _process.IsWithSolicitors(caseFlowDto)); }
public void IsWithSolicitors_WhenCaseFlowDtoCompanyIs2_ReturnsTrue() { CaseFlowAccountCommonTest caseFlowDto = new CaseFlowAccountCommonTest() { Company = 2 }; Assert.AreEqual(true, _process.IsWithSolicitors(caseFlowDto)); }
public void DeriveStatusAndStatusSort_WhenCaseFlowDtoPropertiesIndicate_NOT_NoPaymentArrangement_SetsAnotherStatusAndStatusName_On_ServiceDto( double?testOutstandingBalance, bool testIsPlanInPlace) { // Note: using double because 'decimal' can't be used in DataRow CaseFlowAccountCommonTest caseFlowDto = new CaseFlowAccountCommonTest() { OutstandingBalance = (decimal?)testOutstandingBalance, HasArrangement = testIsPlanInPlace, CanMakePayment = true // must set this or 'can set up plan' to avoid falling into View Only }; MyAccountsSummaryResultDto resultDtoToBeUpdated = new MyAccountsSummaryResultDto(); _process.DeriveStatusAndStatusSort(caseFlowDto, resultDtoToBeUpdated); // Checks NOT at status Assert.AreNotEqual("No Payment Arrangement", resultDtoToBeUpdated.AccountStatus); Assert.AreNotEqual(StatusSort_NoPaymentArrangement, resultDtoToBeUpdated.AccountStatusSort); }
public void DeriveStatusAndStatusSort_WhenCaseFlowDtoPropertiesIndicate_NOT_WithSolicitors_SetsAnotherStatusAndStatusName_On_ServiceDto( long?testCompany) { CaseFlowAccountCommonTest caseFlowDto = new CaseFlowAccountCommonTest() { Company = testCompany, // *** IMPORTANT: if change method to company number, must also change CLOSED test // Is superceded by 'Closed' therefore requires balance // (not exhaustively testing this because 'Closed' tests check with company code 2) OutstandingBalance = 0.1M }; MyAccountsSummaryResultDto resultDtoToBeUpdated = new MyAccountsSummaryResultDto(); _process.DeriveStatusAndStatusSort(caseFlowDto, resultDtoToBeUpdated); // Checks NOT at status Assert.AreNotEqual("With Lowell Solicitors", resultDtoToBeUpdated.AccountStatus); Assert.AreNotEqual(StatusSort_WithLowellSolicitors, resultDtoToBeUpdated.AccountStatusSort); Assert.AreEqual(false, resultDtoToBeUpdated.AccountStatusIsWithSolicitors); }
public void DeriveStatusAndStatusSort_WhenCaseFlowDtoPropertiesIndicate_NOT_Closed_SetsAnotherStatusAndStatusName_On_ServiceDto( double?testOutstandingBalance, bool testCanSetupIndividualPlan, bool testCanMakePayment) { // Note: using double because 'decimal' can't be used in DataRow CaseFlowAccountCommonTest caseFlowDto = new CaseFlowAccountCommonTest() { OutstandingBalance = (decimal?)testOutstandingBalance, CanSetupIndividualPlan = testCanSetupIndividualPlan, CanMakePayment = testCanMakePayment }; MyAccountsSummaryResultDto resultDtoToBeUpdated = new MyAccountsSummaryResultDto(); _process.DeriveStatusAndStatusSort(caseFlowDto, resultDtoToBeUpdated); // Checks NOT at status Assert.AreNotEqual("Closed", resultDtoToBeUpdated.AccountStatus); Assert.AreNotEqual(StatusSort_Closed, resultDtoToBeUpdated.AccountStatusSort); Assert.AreEqual(false, resultDtoToBeUpdated.AccountStatusIsClosed); }