///<summary> ///Purpose : Keep billing data (Edit) ///Parameters: tbt_BillingTemp /// - ContractCode = N0000012225 /// - OCC = 0001 /// - SequenceNo = 3 /// - BillingOCC = 05 /// - BillingTargetRunningNo = 005 /// - BillingClientCode = C000012015 /// - BillingTargetCode = C000012015-005 /// - BillingOfficeCode = 1000 /// - BillingType = 03 /// - CreditTerm = 90 /// - BillingTiming = 6 /// - BillingAmt = 99999999.9999 /// - PayMethod = 4 /// - BillingCycle = 6 /// - CalDailyFeeStatus = 0 /// - SendFlag = 1 /// - CreateDate = Date today /// - CreateBy = 500576 /// - UpdateDate = Date today /// - UpdateBy = 500576 ///Expected : Update tbt_BillingTemp : /// Contract code = N0012135 /// OCC = 0001 /// SequenceNo = 3 /// /// Keep operation log to log table /// /// See expectation data test case 2 ///</summary> public string Case2() { IBillingTempHandler target = ServiceContainer.GetService <IBillingTempHandler>() as IBillingTempHandler; tbt_BillingTemp data = new tbt_BillingTemp(); tbt_BillingTemp expected = new tbt_BillingTemp(); tbt_BillingTemp actual = new tbt_BillingTemp(); string error = string.Empty; DateTime dtProcessDateTime = CommonUtil.dsTransData.dtOperationData.ProcessDateTime; string strFieldName = "ContractCode OCC SequenceNo BillingOCC BillingTargetRunningNo BillingClientCode BillingTargetCode BillingOfficeCode BillingType CreditTerm BillingTiming BillingAmt PayMethod BillingCycle CalDailyFeeStatus SendFlag UpdateDate UpdateBy"; try { data = this.CreateParameterForCase2(dtProcessDateTime); List <tbt_BillingTemp> resultList = target.UpdateBillingTempByKey(data); if (resultList != null && resultList.Count > 0) { actual = resultList[0]; } expected = this.CreateExpectedForCase2(dtProcessDateTime); } catch (ApplicationErrorException ex) { error = ex.ErrorResult.Message.Code; } catch (Exception ex) { error = ex.StackTrace; } if (error == string.Empty) { bool bResult = CompareObject <tbt_BillingTemp>(actual, expected, strFieldName); return(string.Format(RESULT_FORMAT_LIST, 2, bResult)); } else { return(string.Format(RESULT_FORMAT_ERROR, 2, "Fail", error)); } }
///<summary> ///Purpose : Keep billing data (Add) ///Parameters: tbt_BillingTemp /// - ContractCode = N0000012125 /// - OCC = 9970 /// - SequenceNo = NULL /// - BillingOCC = 01 /// - BillingTargetRunningNo = 001 /// - BillingClientCode = C000012015 /// - BillingTargetCode = C000012015-001 /// - BillingOfficeCode = 1020 /// - BillingType = 01 /// - CreditTerm = 60 /// - BillingTiming = 1 /// - BillingAmt = 10000 /// - PayMethod = 1 /// - BillingCycle = 3 /// - CalDailyFeeStatus = 1 /// - SendFlag = 0 /// - CreateDate = Date today /// - CreateBy = 500629 /// - UpdateDate = Date today /// - UpdateBy = 500629 ///Expected : See expectation test case 2 ///</summary> public string Case2() { IBillingTempHandler target = ServiceContainer.GetService <IBillingTempHandler>() as IBillingTempHandler; tbt_BillingTemp data = new tbt_BillingTemp(); tbt_BillingTemp expected = new tbt_BillingTemp(); tbt_BillingTemp actual = new tbt_BillingTemp(); string error = string.Empty; DateTime dtProcessDateTime = CommonUtil.dsTransData.dtOperationData.ProcessDateTime; try { data = this.CreateParameterForCase2(dtProcessDateTime); List <tbt_BillingTemp> resultList = target.InsertBillingTemp(data); if (resultList != null && resultList.Count > 0) { actual = resultList[0]; } expected = this.CreateExpectedForCase2(dtProcessDateTime); } catch (ApplicationErrorException ex) { error = ex.ErrorResult.Message.Code; } catch (Exception ex) { error = ex.StackTrace; } if (error == string.Empty) { bool bResult = CompareObject <tbt_BillingTemp>(actual, expected); return(string.Format(RESULT_FORMAT_LIST, 2, bResult)); } else { return(string.Format(RESULT_FORMAT_ERROR, 2, "Fail", error)); } }
///<summary> ///Purpose : Check Mandatory ///Parameters: None ///Expected : MSG0007: These fields are required: [Contract code] ///</summary> public string Case1() { IBillingTempHandler target = ServiceContainer.GetService <IBillingTempHandler>() as IBillingTempHandler; string strContractCode = null; string expected = "MSG0007"; string actual; try { target.DeleteBillingTempByContractCode(strContractCode); actual = string.Empty; } catch (ApplicationErrorException ex) { actual = ex.ErrorResult.Message.Code; } catch (Exception ex) { actual = ex.StackTrace; } return(string.Format(RESULT_FORMAT, 1, expected, actual, CompareResult_String(expected, actual))); }
///<summary> ///Purpose : Keep billing data (Delete) ///Parameters: - ContractCode = N0012125 /// - OCC = 0001 /// - SequenceNo = 1 ///Expected : Delete tbt_BillingTemp : 1 record /// In tbt_BillingTemp not found data of : /// Contract code = N0012125 /// OCC = 0001 /// SqquenceNo = 1 /// /// Keep operation log to log table ///</summary> public string Case6() { IBillingTempHandler target = ServiceContainer.GetService <IBillingTempHandler>() as IBillingTempHandler; string strContractCode = "N0000012125"; string strOCC = "0001"; int iSequenceNo = 1; int expected = 1; int actual = 0; string error = string.Empty; try { List <tbt_BillingTemp> resultList = target.DeleteBillingTempByKey(strContractCode, strOCC, iSequenceNo); if (resultList != null && resultList.Count > 0) { actual = resultList.Count; } } catch (ApplicationErrorException ex) { error = ex.ErrorResult.Message.Code; } catch (Exception ex) { error = ex.StackTrace; } if (error == string.Empty) { bool bResult = (actual == expected); return(string.Format(RESULT_FORMAT_LIST, 6, bResult)); } else { return(string.Format(RESULT_FORMAT_ERROR, 6, "Fail", error)); } }