예제 #1
0
        public void AvrServiceViewChartTest()
        {
            using (var wrapper = new AvrServiceClientWrapper(m_HostKeeper.CurrentServiceHostURL))
            {
                var receiver = new AvrCacheReceiver(wrapper);
                AvrPivotViewModel view;
                long layoutId = LayoutFormSave();
                using (new StopwathTransaction("++++ GetView ++++"))
                {
                    view = receiver.GetCachedView("xxx", layoutId, "ru");
                }
                Assert.IsNotNull(view);
                Assert.IsNotNull(view.ViewData);
                Assert.IsNotNull(view.ViewHeader);

                ChartExportDTO chartBytes;
                using (new StopwathTransaction("++++ GetChart ++++"))
                {
                    var tableModel = new ChartTableModel(layoutId, "ru", ExportChartToJpgTests.CreateChartData(), null, DBChartType.chrBar,
                                                         null,
                                                         1000, 750);

                    chartBytes = receiver.ExportChartToJpg(tableModel);
                }
                Assert.IsNotNull(chartBytes);
                Assert.IsNotNull(chartBytes.JpgBytes);
                Assert.IsTrue(chartBytes.JpgBytes.Length > 0);
                ExportTests.AssertJpeg(chartBytes.JpgBytes);
                //File.WriteAllBytes("filexx.jpg", chartBytes);
            }
        }
예제 #2
0
        public void AvrServiceHelperGetAvrServiceChartResultTest()
        {
            var tableModel = new ChartTableModel(-1, ModelUserContext.CurrentLanguage,
                                                 ExportChartToJpgTests.CreateChartData(), null, null, null, 1000, 750);
            AvrServiceChartResult result = ServiceClientHelper.GetAvrServiceChartResult(tableModel);

            Assert.IsNotNull(result);
            Assert.IsTrue(result.IsOk, result.ErrorMessage);
            Assert.IsNotNull(result.Model);
            Assert.IsNotNull(result.Model.JpgBytes);

            Assert.IsTrue(result.Model.JpgBytes.Length > 0);
            ExportTests.AssertJpeg(result.Model.JpgBytes);
            //File.WriteAllBytes("filexxx.jpg", result.Model);
        }