Ejemplo n.º 1
0
        public virtual void SolidLineWithSetWidthTest01()
        {
            SolidLine solidLine = new SolidLine(20);

            NUnit.Framework.Assert.AreEqual(ColorConstants.BLACK, solidLine.GetColor());
            NUnit.Framework.Assert.AreEqual(20, solidLine.GetLineWidth(), 0.0001);
        }
Ejemplo n.º 2
0
        public virtual void DefaultSolidLineTest01()
        {
            SolidLine solidLine = new SolidLine();

            NUnit.Framework.Assert.AreEqual(ColorConstants.BLACK, solidLine.GetColor());
            NUnit.Framework.Assert.AreEqual(1, solidLine.GetLineWidth(), 0.0001);
        }
Ejemplo n.º 3
0
        public virtual void SolidLineDrawTest01()
        {
            String      expectedContent = "q\n" + "0 0 0 RG\n" + "15 w\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());
            SolidLine   solidLine       = new SolidLine(15);

            solidLine.Draw(canvas, new Rectangle(100, 100, 100, 100));
            byte[] writtenContentBytes = canvas.GetContentStream().GetBytes();
            NUnit.Framework.Assert.AreEqual(expectedContent.GetBytes(), writtenContentBytes);
        }
Ejemplo n.º 4
0
        public virtual void SolidLineSettersTest01()
        {
            SolidLine solidLine = new SolidLine(15);

            NUnit.Framework.Assert.AreEqual(ColorConstants.BLACK, solidLine.GetColor());
            NUnit.Framework.Assert.AreEqual(15, solidLine.GetLineWidth(), 0.0001);
            solidLine.SetColor(ColorConstants.RED);
            NUnit.Framework.Assert.AreEqual(ColorConstants.RED, solidLine.GetColor());
            solidLine.SetLineWidth(10);
            NUnit.Framework.Assert.AreEqual(10, solidLine.GetLineWidth(), 0.0001);
        }