///<summary> ///Purpose : Keep billing data (Delete) ///Parameters: - ContractCode = N0012225 /// - OCC = 0001 ///Expected : Delete tbt_BillingTemp : 3 records /// In tbt_BillingTemp not found data of : /// Contract code = N0012225 /// OCC = 0001 /// /// Keep operation log to log table ///</summary> public string Case4() { IBillingTempHandler target = ServiceContainer.GetService <IBillingTempHandler>() as IBillingTempHandler; string strContractCode = "N0000012225"; string strOCC = "0001"; int expected = 3; int actual = 0; string error = string.Empty; try { List <tbt_BillingTemp> resultList = target.DeleteBillingTempByContractCodeOCC(strContractCode, strOCC); 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, 4, bResult)); } else { return(string.Format(RESULT_FORMAT_ERROR, 4, "Fail", error)); } }
///<summary> ///Purpose : Check Mandatory ///Parameters: None ///Expected : MSG0007: These fields are required: [Contract code], [OCC] ///</summary> public string Case3() { IBillingTempHandler target = ServiceContainer.GetService <IBillingTempHandler>() as IBillingTempHandler; string strContractCode = null; string strOCC = null; string expected = "MSG0007"; string actual; try { target.DeleteBillingTempByContractCodeOCC(strContractCode, strOCC); actual = string.Empty; } catch (ApplicationErrorException ex) { actual = ex.ErrorResult.Message.Code; } catch (Exception ex) { actual = ex.StackTrace; } return(string.Format(RESULT_FORMAT, 3, expected, actual, CompareResult_String(expected, actual))); }