示例#1
0
        private tbt_BillingTemp CreateExpectedForCase2(DateTime dtProcessDateTime)
        {
            tbt_BillingTemp data = new tbt_BillingTemp();

            data.ContractCode           = "N0000012125";
            data.OCC                    = "9970";
            data.SequenceNo             = 1;
            data.BillingOCC             = "01";
            data.BillingTargetRunningNo = "001";
            data.BillingClientCode      = "C000012015";
            data.BillingTargetCode      = "C000012015-001";
            data.BillingOfficeCode      = "1020";
            data.BillingType            = "01";
            data.CreditTerm             = 60;
            data.BillingTiming          = "1";
            data.BillingAmt             = 10000;
            data.PayMethod              = "1";
            data.BillingCycle           = 3;
            data.CalDailyFeeStatus      = "1";
            data.SendFlag               = "0";
            data.CreateDate             = dtProcessDateTime;
            data.CreateBy               = CommonUtil.dsTransData.dtUserData.EmpNo;
            data.UpdateDate             = dtProcessDateTime;
            data.UpdateBy               = CommonUtil.dsTransData.dtUserData.EmpNo;

            return(data);
        }
示例#2
0
        private List <tbt_BillingTemp> CreateExpectedForCase6(DateTime dtProcessDateTime)
        {
            List <tbt_BillingTemp> dataList = new List <tbt_BillingTemp>();

            tbt_BillingTemp data = new tbt_BillingTemp();

            data.ContractCode           = "N0000012125";
            data.OCC                    = "0002";
            data.SequenceNo             = 4;
            data.BillingOCC             = "04";
            data.BillingTargetRunningNo = "004";
            data.BillingClientCode      = "C000000032";
            data.BillingTargetCode      = "C000000032-001";
            data.BillingOfficeCode      = "1000";
            data.BillingType            = "02";
            data.CreditTerm             = 60;
            data.BillingTiming          = "3";
            data.BillingAmt             = 99999.9999M;
            data.PayMethod              = "3";
            data.BillingCycle           = 3;
            data.CalDailyFeeStatus      = "2";
            data.SendFlag               = "0";
            data.UpdateDate             = dtProcessDateTime;
            data.UpdateBy               = CommonUtil.dsTransData.dtUserData.EmpNo;
            dataList.Add(data);

            return(dataList);
        }
示例#3
0
        private tbt_BillingTemp CreateParameterForCase2(DateTime dtProcessDateTime)
        {
            tbt_BillingTemp data = new tbt_BillingTemp();

            data.ContractCode           = "N0000012225";
            data.OCC                    = "0001";
            data.SequenceNo             = 3;
            data.BillingOCC             = "05";
            data.BillingTargetRunningNo = "005";
            data.BillingClientCode      = "C000012015";
            data.BillingTargetCode      = "C000012015-005";
            data.BillingOfficeCode      = "1000";
            data.BillingType            = "03";
            data.CreditTerm             = 90;
            data.BillingTiming          = "6";
            data.BillingAmt             = 99999999.9999M;
            data.PayMethod              = "4";
            data.BillingCycle           = 6;
            data.CalDailyFeeStatus      = "0";
            data.SendFlag               = "1";
            data.UpdateDate             = dtProcessDateTime;
            data.UpdateBy               = CommonUtil.dsTransData.dtUserData.EmpNo;

            return(data);
        }
示例#4
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));
            }
        }
示例#5
0
        ///<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));
            }
        }
示例#6
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.InsertBillingTemp(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)));
        }