コード例 #1
0
 public void Setup()
 {
     document = new MigraDocCore.DocumentObjectModel.Document();
     // Workaround for a quirk in the migradoc API.
     _          = document.AddSection().Elements;
     pdfBuilder = new PdfBuilder(document, PdfOptions.Default);
     renderer   = new HtmlBlockRenderer();
 }
コード例 #2
0
 public void Setup()
 {
     document = new MigraDocCore.DocumentObjectModel.Document();
     // Workaround for a quirk in the migradoc API.
     _          = document.AddSection().Elements;
     pdfBuilder = new PdfBuilder(document, PdfOptions.Default);
     renderer   = new CodeBlockRenderer();
     block      = CreateCodeBlock("this is source code");
 }
コード例 #3
0
        public void SetUp()
        {
            document = new MigraDocCore.DocumentObjectModel.Document();
            // Workaround for a quirk in the migradoc API.
            _          = document.AddSection().Elements;
            pdfBuilder = new PdfBuilder(document, PdfOptions.Default);
            pdfBuilder.UseTagRenderer(new MockTagRenderer());
            image = new Bitmap(4, 4);

            imageTag = new ImageTag(image);
            renderer = new ImageTagRenderer();
        }
コード例 #4
0
        public void SetUp()
        {
            document = new MigraDocCore.DocumentObjectModel.Document();
            // Workaround for a quirk in the migradoc API.
            _          = document.AddSection().Elements;
            pdfBuilder = new PdfBuilder(document, PdfOptions.Default);
            pdfBuilder.UseTagRenderer(new MockTagRenderer());
            image = new Bitmap(4, 4);

            Mock <IGraph> mockGraph = new Mock <IGraph>();

            graph = mockGraph.Object;

            // Mock graph exporter - this will just return the image field of this class.
            Mock <IGraphExporter> mockExporter = new Mock <IGraphExporter>();

            mockExporter.Setup <Image>(e => e.Export(It.IsAny <IGraph>(), It.IsAny <double>(), It.IsAny <double>())).Returns(() => image);
            mockExporter.Setup <Image>(e => e.Export(It.IsAny <IPlotModel>(), It.IsAny <double>(), It.IsAny <double>())).Returns(() => image);

            renderer = new GraphPageTagRenderer(mockExporter.Object);
        }