예제 #1
0
        internal void crcPdf(Action <DocumentCatalog> Given, Action <DocumentCatalog> When = null, Action <DocumentCatalog> Then = null)
        {
            DocumentCatalog pdfWriter = Pdf.CreateExpert();

            Given(pdfWriter);

            MemoryStream ms = new MemoryStream();

            pdfWriter.Save(ms);

            LogInDebug(ms);

            ms.Seek(0, SeekOrigin.Begin);
            DocumentCatalog pdfRead = Pdf.Load(ms);

            if (When != null)
            {
                When(pdfRead);
            }

            if (Then != null)
            {
                Then(pdfRead);
            }
        }
예제 #2
0
 private CaseController()
 {
     caseCatalog        = new CaseCatalog();
     adCatalog          = new AdCatalog();
     askingPriceCatalog = new AskingPriceCatalog();
     distanceToCatalog  = new DistanceToCatalog();
     documentCatalog    = new DocumentCatalog();
     pictureCatalog     = new PictureCatalog();
     ratingCatalog      = new RatingCatalog();
 }
예제 #3
0
        public void APathOperatorMustBeFollowedByPaintOperators()
        {
            DocumentCatalog pdf = Pdf.CreateExpert();
            Action          act = () => pdf.Pages
                                  .AddPage()
                                  .AddRectangle(10, 10, 12, 14.5f)
                                  .SetLineCap(LineCapStyle.ButtCap)
                                  .AddStroke();

            act.Should().Throw <PdfException>()
            .WithMessage("INVALID_OPERATOR: A Path Painting Operator must appear after a Path Construction Operator or another Path Painting Operator");
        }
예제 #4
0
        internal void crcPdfShould(byte[] Given, Action <DocumentCatalog> When = null, Action <DocumentCatalog> Then = null)
        {
            DocumentCatalog pdf = Pdf.Load(new MemoryStream(Given));

            if (When != null)
            {
                When(pdf);
            }

            if (Then != null)
            {
                Then(pdf);
            }
        }