Exemplo n.º 1
0
        ///<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));
            }
        }
Exemplo n.º 2
0
        ///<summary>
        ///Purpose   : Check Mandatory
        ///Parameters: None
        ///Expected  : MSG0007: These fields are required: [Contract code], [OCC], [BillingType], [BillingAmt], [PayMethod] and
        ///            At least one of [BillingOCC or BillingTargetCode or (BillingClientCode and BillingOfficeCode)]
        ///</summary>
        public string Case1()
        {
            IBillingTempHandler target = ServiceContainer.GetService <IBillingTempHandler>() as IBillingTempHandler;
            tbt_BillingTemp     data   = null;
            string expected            = "MSG0007";
            string actual;

            try
            {
                target.UpdateBillingTempByKey(data);
                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)));
        }