Ejemplo n.º 1
0
        ///<summary>
        ///Purpose   : Get product type (How does the system performs if the quotation prefix is null)
        ///Parameters: strProductTypeCode = 7
        ///Expected  : MSG3022: Cannot generate the contract code. Contract prefix does not exist.
        ///</summary>
        public string Case2()
        {
            IContractHandler target             = ServiceContainer.GetService <IContractHandler>() as IContractHandler;
            string           strProductTypeCode = "7";
            string           expected           = "MSG3022";
            string           actual;

            try
            {
                actual = target.GenerateContractCode(strProductTypeCode);
            }
            catch (ApplicationErrorException ex)
            {
                actual = ex.ErrorResult.Message.Code;
            }
            catch (Exception ex)
            {
                actual = ex.StackTrace;
            }

            return(string.Format(RESULT_FORMAT, 2, expected, actual, CompareResult_String(expected, actual)));
        }
Ejemplo n.º 2
0
        ///<summary>
        ///Purpose   : Generate contract code for maintenane
        ///Parameters: strProductTypeCode = 6
        ///Expected  : Return contract code that is MA000000006x.
        ///</summary>
        public string Case9()
        {
            IContractHandler target             = ServiceContainer.GetService <IContractHandler>() as IContractHandler;
            string           strProductTypeCode = "6";
            string           expected           = "MA000000006x";
            string           actual;
            string           com_actual = string.Empty;

            try
            {
                actual     = target.GenerateContractCode(strProductTypeCode);
                com_actual = actual.Substring(0, actual.Length - 1) + "x";
            }
            catch (ApplicationErrorException ex)
            {
                actual = ex.ErrorResult.Message.Code;
            }
            catch (Exception ex)
            {
                actual = ex.StackTrace;
            }

            return(string.Format(RESULT_FORMAT, 9, expected, actual, CompareResult_String(expected, com_actual)));
        }