///<summary> ///Purpose : Individual lock (all quotations was locked) ///Pre-Condition : Create stub6 to test expectation input for LogHandler.WriteTransactionLog ///Parameters: strQuotationTargetCode = FMA0000000486 /// strAlphabet = CA /// strLockStyleCode = 3 ///Expected : No data in DB is updated. LogHandler.WriteTransactionLog is not called. ///</summary> public string Case12() { IQuotationHandler target = ServiceContainer.GetService <IQuotationHandler>() as IQuotationHandler; string strQuotationTargetCode = "FMA0000000486"; string strAlphabet = "CA"; string strLockStyleCode = "3"; string expected = "False"; string actual; try { //Login user = 470228 //Process datetime = 2012/01/15 09:30:00 AM CommonUtil.dsTransData.dtUserData.EmpNo = "470228"; CommonUtil.dsTransData.dtOperationData.ProcessDateTime = new DateTime(2012, 1, 15, 9, 30, 00); CommonUtil.dsTransData.dtOperationData.GUID = "Case12"; bool result = target.LockQuotation(strQuotationTargetCode, strAlphabet, strLockStyleCode); actual = result.ToString(); } catch (ApplicationErrorException ex) { actual = ex.ErrorResult.Message.Code; } catch (Exception ex) { actual = ex.StackTrace; } return(string.Format(RESULT_FORMAT, 12, expected, actual, CompareResult_String(expected, actual))); }
///<summary> ///Purpose : Mandatory check (QuotationHandler.CountQuotationBasic) ///Parameters: strQuotationTargetCode = NULL /// strAlphabet = NULL /// strLockStyleCode = 1 ///Expected : MSG0007: These field was required: strQuotationTargetCode. ///</summary> public string Case2() { IQuotationHandler target = ServiceContainer.GetService <IQuotationHandler>() as IQuotationHandler; string strQuotationTargetCode = null; string strAlphabet = null; string strLockStyleCode = "1"; string expected = "MSG0007"; string actual; try { target.LockQuotation(strQuotationTargetCode, strAlphabet, strLockStyleCode); actual = string.Empty; } 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))); }
///<summary> ///Purpose : Individual lock (no quotation was locked) ///Pre-Condition : Create stub6 to test expectation input for LogHandler.WriteTransactionLog ///Parameters: strQuotationTargetCode = FQ0000000508 /// strAlphabet = "CA" /// strLockStyleCode = 3 ///Expected : See expectation test case9 ///</summary> public string Case9() { IQuotationHandler target = ServiceContainer.GetService <IQuotationHandler>() as IQuotationHandler; string strQuotationTargetCode = "FQ0000000508"; string strAlphabet = "CA"; string strLockStyleCode = "3"; string expected = "True"; string actual; try { CommonUtil.dsTransData.dtOperationData.GUID = "Case9"; bool result = target.LockQuotation(strQuotationTargetCode, strAlphabet, strLockStyleCode); actual = result.ToString(); } 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, actual))); }