Exemplo n.º 1
0
        public async Task ExportToPdf()
        {
            var exportedFilePath = _files.ExportToPdfResultPath;

            var code = string.Format(@"
plot(0:10)
rtvs:::graphics.ide.exportpdf({0}, {1}, {2})
",
                                     QuotedRPath(exportedFilePath),
                                     7,
                                     7
                                     );

            var inputs = Interactive(code);
            var actualPlotFilePaths = await GraphicsTestAsync(inputs);

            var plotFilePath = actualPlotFilePaths.Should().ContainSingle().Which;

            var bmp = (Bitmap)Image.FromFile(plotFilePath);

            bmp.Width.Should().Be(DefaultWidth);
            bmp.Height.Should().Be(DefaultHeight);

            PdfComparer.ComparePdfFiles(exportedFilePath, _files.ExpectedExportToPdfPath);
        }
Exemplo n.º 2
0
        public async Task ExportToPdf()
        {
            var exportedFilePath = _files.ExportToPdfResultPath;

            var code = string.Format(@"
plot(0:10)
"
                                     );

            var inputs = Interactive(code);
            var actualPlotFilePaths = await ExportToPdfAsync(inputs, exportedFilePath, 7, 7);

            var plotFilePath = actualPlotFilePaths.Should().ContainSingle().Which;

            var bmp = (Bitmap)Image.FromFile(plotFilePath);

            bmp.Width.Should().Be(DefaultWidth);
            bmp.Height.Should().Be(DefaultHeight);

            PdfComparer.ComparePdfFiles(exportedFilePath, _files.ExpectedExportToPdfPath);
        }