Пример #1
0
        public void Test_01_GL_Batch_Import()
        {
            Hashtable requestParams = new Hashtable();

            requestParams.Add("ALedgerNumber", FLedgerNumber);
            requestParams.Add("Delimiter", ";");
            requestParams.Add("DateFormatString", "dd/MM/yyyy");
            requestParams.Add("DatesMayBeIntegers", false);
            requestParams.Add("NumberFormat", "European");
            requestParams.Add("NewLine", Environment.NewLine);

            string strContent = CommonNUnitFunctions.LoadCSVFileToString("csharp\\ICT\\Testing\\lib\\MFinance\\GL\\" +
                                                                         "test-csv\\glbatch-import.csv");

            strContent = strContent.Replace("31/07/2010", "31/07/" + DateTime.Now.Year.ToString());
            strContent = strContent.Replace("02/07/2010", "02/07/" + DateTime.Now.Year.ToString());
            strContent = strContent.Replace("{ledgernumber}", FLedgerNumber.ToString());

            TVerificationResultCollection verificationResult;
            bool refreshRequired;

            bool importSuccess = TGLTransactionWebConnector.ImportGLBatches(requestParams, strContent, out refreshRequired, out verificationResult);

            if (!TVerificationHelper.IsNullOrOnlyNonCritical(verificationResult))
            {
                TLogging.Log(verificationResult.BuildVerificationResultString());
            }

            Assert.IsTrue(importSuccess, "Import glbatch-import.csv done well ....");
        }