Example #1
0
        ///<summary>
        ///Purpose   : Check Mandatory
        ///Parameters: None
        ///Expected  : MSG0007: These fields are required: [Contract code], [OldBillingClientCode], [OldBillingOfficeCode], [OldBillingTargetCode]
        ///</summary>
        public string Case3()
        {
            IBillingTempHandler target = ServiceContainer.GetService <IBillingTempHandler>() as IBillingTempHandler;

            string strContractCode         = null;
            string strOldBillingClientCode = null;
            string strOldBillingOfficeCode = null;
            string strOldBillingTargetCode = null;
            string strNewBillingClientCode = null;
            string strNewBillingOfficeCode = null;
            string strNewBillingTargetCode = null;

            string expected = "MSG0007";
            string actual;

            try
            {
                target.UpdateBillingTempByBillingTarget(strContractCode, strOldBillingClientCode, strOldBillingOfficeCode, strOldBillingTargetCode
                                                        , strNewBillingClientCode, strNewBillingOfficeCode, strNewBillingTargetCode);
                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)));
        }
Example #2
0
        ///<summary>
        ///Purpose   : Keep billing data (Edit)
        ///Parameters: - ContractCode = N0000012125
        ///            - OldBillingClientCode = C000012015
        ///            - OldBillingOfficeCode = 1020
        ///            - OldBillingTargetCode = C000012015-001
        ///            - NewBillingClientCode = C000012025
        ///            - NewBillingOfficeCode = 1000
        ///            - NewBillingTargetCode = C000012025-001
        ///Expected  : Update tbt_BillingTemp : 2 records
        ///            ContractCode = N0012125
        ///            OldBillingClientCode = C000012015
        ///            OldBillingOfficeCode = 1020
        ///            OldBillingTargetCode = C000012015-001
        ///            SendFlag = 0
        ///
        ///            Keep operation log to log table
        ///
        ///            See expectation data test case 4
        ///</summary>
        public string Case4()
        {
            IBillingTempHandler target = ServiceContainer.GetService <IBillingTempHandler>() as IBillingTempHandler;

            string strContractCode         = "N0000012125";
            string strOldBillingClientCode = "C000012015";
            string strOldBillingOfficeCode = "1020";
            string strOldBillingTargetCode = "C000012015-001";
            string strNewBillingClientCode = "C000012025";
            string strNewBillingOfficeCode = "1000";
            string strNewBillingTargetCode = "C000012025-001";

            List <tbt_BillingTemp> expected = null;
            List <tbt_BillingTemp> actual   = null;
            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
            {
                actual = target.UpdateBillingTempByBillingTarget(strContractCode, strOldBillingClientCode, strOldBillingOfficeCode, strOldBillingTargetCode
                                                                 , strNewBillingClientCode, strNewBillingOfficeCode, strNewBillingTargetCode);

                expected = this.CreateExpectedForCase4(dtProcessDateTime);
            }
            catch (ApplicationErrorException ex)
            {
                error = ex.ErrorResult.Message.Code;
            }
            catch (Exception ex)
            {
                error = ex.StackTrace;
            }

            if (error == string.Empty)
            {
                bool bResult = CompareObjectList <tbt_BillingTemp>(actual, expected, strFieldName);
                return(string.Format(RESULT_FORMAT_LIST, 4, bResult));
            }
            else
            {
                return(string.Format(RESULT_FORMAT_ERROR, 4, "Fail", error));
            }
        }