Beispiel #1
0
 public UnitTest()
 {
     authsvc = new AuthorizationService.AuthorizationService();
     reportsvc = new ReportService.ReportService();
     kingdomsvc = new KingdomService.KingdomService();
     parksvc = new ParkService.ParkService();
 }
Beispiel #2
0
 public UnitTest()
 {
     authsvc    = new AuthorizationService.AuthorizationService();
     reportsvc  = new ReportService.ReportService();
     kingdomsvc = new KingdomService.KingdomService();
     parksvc    = new ParkService.ParkService();
 }
Beispiel #3
0
        [Ignore]//QBO-47289
        public void ReportsInventoryTestUsingoAuth()
        {
            ReportService.ReportService reportsService = new ReportService.ReportService(qboContextoAuth);
            reportsService.report_date = "2014-12-31";
            Report report = reportsService.ExecuteReport("InventoryValuationSummary");

            Assert.IsNotNull(report);
            Assert.AreEqual("InventoryValuationSummary", report.Header.ReportName);
        }
Beispiel #4
0
        public void ReportsCustomerBalanceDetailTestUsingoAuth()
        {
            ReportService.ReportService reportsService = new ReportService.ReportService(qboContextoAuth);
            reportsService.start_date = "2014-01-01";
            reportsService.end_date   = "2014-12-31";
            Report report = reportsService.ExecuteReport("CustomerBalanceDetail");

            Assert.IsNotNull(report);
            Assert.AreEqual("CustomerBalanceDetail", report.Header.ReportName);
        }
Beispiel #5
0
        public void ReportsGeneralLedgerDetailTestUsingoAuth()
        {
            ReportService.ReportService reportsService = new ReportService.ReportService(qboContextoAuth);;
            reportsService.start_date = "2014-01-01";
            reportsService.end_date   = "2014-12-31";
            Report report = reportsService.ExecuteReport("GeneralLedger");

            Assert.IsNotNull(report);
            Assert.AreEqual("GeneralLedger", report.Header.ReportName);
        }
Beispiel #6
0
        public void ReportsSalesByProductTestUsingoAuth()
        {
            ReportService.ReportService reportsService = new ReportService.ReportService(qboContextoAuth);
            reportsService.start_date = "2013-01-01";
            reportsService.end_date   = "2014-12-31";
            Report report = reportsService.ExecuteReport("ItemSales");

            Assert.IsNotNull(report);
            Assert.AreEqual("ItemSales", report.Header.ReportName);
        }
Beispiel #7
0
        public void ReportsARAgingSummaryTestUsingoAuth()
        {
            ReportService.ReportService reportsService = new ReportService.ReportService(qboContextoAuth);
            reportsService.start_date = "2014-01-01";
            reportsService.end_date   = "2014-12-31";
            reportsService.qzurl      = "true";
            Report report = reportsService.ExecuteReport("AgedReceivables");

            Assert.IsNotNull(report);
            Assert.AreEqual("AgedReceivables", report.Header.ReportName);
        }
Beispiel #8
0
        public void ReportsTransactionListTestUsingoAuth()
        {
            ReportService.ReportService reportsService = new ReportService.ReportService(qboContextoAuth);;
            reportsService.start_date = "2014-01-01";
            reportsService.end_date   = "2014-12-31";
            reportsService.qzurl      = "true";//not yet supported
            Report report = reportsService.ExecuteReport("TransactionList");

            Assert.IsNotNull(report);
            Assert.AreEqual("TransactionList", report.Header.ReportName);
        }
Beispiel #9
0
        public void ReportsARAgingDetailTestUsingoAuth()
        {
            ReportService.ReportService reportsService = new ReportService.ReportService(qboContextoAuth);
            reportsService.start_date = "2014-01-01";
            reportsService.end_date   = "2014-12-31";
            //reportsService.columns = "tx_date";
            Report report = reportsService.ExecuteReport("AgedReceivableDetail");

            Assert.IsNotNull(report);
            Assert.AreEqual("AgedReceivableDetail", report.Header.ReportName);
        }
Beispiel #10
0
        public void ReportsTrialBalanceTestUsingoAuth()
        {
            ReportService.ReportService reportsService = new ReportService.ReportService(qboContextoAuth);
            reportsService.start_date = "2014-01-01";
            reportsService.end_date   = "2014-12-31";
            Report report = reportsService.ExecuteReport("TrialBalance");

            Assert.IsNotNull(report);
            Assert.AreEqual("TrialBalance", report.Header.ReportName);
            Assert.AreEqual(report.Header.StartPeriod, reportsService.start_date);
        }
Beispiel #11
0
        public void ReportsCashFlowTestUsingoAuth()
        {
            ReportService.ReportService reportsService = new ReportService.ReportService(qboContextoAuth);
            reportsService.start_date = "2014-01-01";
            reportsService.end_date   = "2014-12-31";
            reportsService.qzurl      = "true";
            Report report = reportsService.ExecuteReport("CashFlow");

            Assert.IsNotNull(report);
            Assert.AreEqual("CashFlow", report.Header.ReportName);
            Assert.AreEqual(report.Header.StartPeriod, reportsService.start_date);
        }
Beispiel #12
0
        internal static Report GetReportAsync(ServiceContext context, string reportName)
        {
            //Initializing the Dataservice object with ServiceContext
            ReportService.ReportService service = new ReportService.ReportService(context);

            IdsException exp            = null;
            Boolean      reportReturned = false;
            Report       actual         = null;

            // Used to signal the waiting test thread that a async operation have completed.
            ManualResetEvent manualEvent = new ManualResetEvent(false);

            // Async callback events are anonomous and are in the same scope as the test code,
            // and therefore have access to the manualEvent variable.
            service.OnExecuteReportAsyncCompleted += (sender, e) =>
            {
                manualEvent.Set();
                if (e.Error != null)
                {
                    exp = e.Error;
                }
                if (exp == null)
                {
                    if (e.Report != null)
                    {
                        reportReturned = true;
                        actual         = e.Report;
                    }
                }
            };

            // Call the service method
            service.ExecuteReportAsync(reportName);

            manualEvent.WaitOne(30000, false); Thread.Sleep(10000);

            if (exp != null)
            {
                throw exp;
            }

            // Check if we completed the async call, or fail the test if we timed out.
            if (!reportReturned)
            {
                Assert.Fail(String.Format("Retrieving {0} Report Failed", reportName));
            }

            // Set the event to non-signaled before making next async call.
            manualEvent.Reset();

            Assert.IsNotNull(actual);
            return(actual);
        }
Beispiel #13
0
        public void ReportsProfitAndLossTestUsingoAuth()
        {
            ReportService.ReportService reportsService = new ReportService.ReportService(qboContextoAuth);
            reportsService.date_macro        = "This Fiscal Year-to-date";
            reportsService.accounting_method = "Accrual";
            reportsService.qzurl             = "true";
            reportsService.subcol_py_chg     = "true";
            Report report = reportsService.ExecuteReport("ProfitAndLoss");

            Assert.IsNotNull(report);
            Assert.AreEqual("ProfitAndLoss", report.Header.ReportName);
            Assert.AreEqual(report.Header.ReportBasis.ToString(), reportsService.accounting_method);
        }
Beispiel #14
0
        public void ReportsBASTestUsingoAuth()
        {
            ReportService.ReportService reportsService = new ReportService.ReportService(qboContextoAuth);
            reportsService.start_date        = "2014-01-01";
            reportsService.end_date          = "2014-12-31";
            reportsService.accounting_method = "cashbasis";
            Report report = reportsService.ExecuteReport("BAS");

            Assert.IsNotNull(report);
            Assert.AreEqual("BAS", report.Header.ReportName);
            Assert.AreEqual(report.Header.ReportBasis.ToString(), reportsService.accounting_method);
            Assert.AreEqual(report.Header.StartPeriod, reportsService.start_date);
        }
Beispiel #15
0
        public void ReportsClassSalesTestUsingoAuth()
        {
            ReportService.ReportService reportsService = new ReportService.ReportService(qboContextoAuth);
            reportsService.start_date        = "2014-01-01";
            reportsService.end_date          = "2014-12-31";
            reportsService.subcol_py_chg     = "true";
            reportsService.accounting_method = "Accrual";
            Report report = reportsService.ExecuteReport("ClassSales");

            Assert.IsNotNull(report);
            Assert.AreEqual("ClassSales", report.Header.ReportName);
            Assert.AreEqual(report.Header.ReportBasis.ToString(), reportsService.accounting_method);
            Assert.AreEqual(report.Header.StartPeriod, reportsService.start_date);
        }
Beispiel #16
0
        public void ReportsBalanceSheetTestUsingoAuth()
        {
            ReportService.ReportService reportsService = new ReportService.ReportService(qboContextoAuth);
            reportsService.start_date        = "2014-01-01";
            reportsService.end_date          = "2014-12-31";
            reportsService.qzurl             = "true"; //should return href tag
            reportsService.subcol_py_chg     = "true";
            reportsService.accounting_method = "Accrual";
            Report report = reportsService.ExecuteReport("BalanceSheet");

            Assert.IsNotNull(report);
            Assert.AreEqual("BalanceSheet", report.Header.ReportName);
            Assert.AreEqual(report.Header.ReportBasis.ToString(), reportsService.accounting_method);
            Assert.AreEqual(report.Header.StartPeriod, reportsService.start_date);
        }
Beispiel #17
0
        public void ReportsPrintTestUsingoAuth()
        {
            ReportService.ReportService reportsService = new ReportService.ReportService(qboContextoAuth);
            reportsService.start_date        = "2014-01-01";
            reportsService.end_date          = "2014-12-31";
            reportsService.accounting_method = "Accrual";
            Report        report     = reportsService.ExecuteReport("BalanceSheet");
            StringBuilder reportText = new StringBuilder();

            //Append Report Header
            printHeader(reportText, report);
            //Determine Maxmimum Text Lengths to format Report
            int[] maximumColumnTextSize = getMaximumColumnTextSize(report);
            //Append Column Headers
            printColumnData(reportText, report.Columns, maximumColumnTextSize, 0);
            //Append Rows
            printRows(reportText, report.Rows, maximumColumnTextSize, 1);
            //Print Formatted Report to Console
            Console.Write(reportText.ToString());
        }