Beispiel #1
0
        public virtual void DottedLineDrawTest01()
        {
            String expectedContent = "q\n" + "15 w\n" + "0 0 0 RG\n" + "[0 5] 2.5 d\n" + "1 J\n" + "100 107.5 m\n" + "200 107.5 l\n"
                                     + "S\n" + "Q\n";
            PdfDocument tempDoc    = new PdfDocument(new PdfWriter(new MemoryStream()));
            PdfCanvas   canvas     = new PdfCanvas(tempDoc.AddNewPage());
            DottedLine  dottedLine = new DottedLine(15, 5);

            dottedLine.Draw(canvas, new Rectangle(100, 100, 100, 100));
            byte[] writtenContentBytes = canvas.GetContentStream().GetBytes();
            NUnit.Framework.Assert.AreEqual(expectedContent.GetBytes(), writtenContentBytes);
        }