private void PunchPdfTest(string basename, PunchPrintSettings punchPrintSettings) { // Get the pages of the printing. PunchPrinting punchPrinter = new PunchPrinting(controller.GetEventDB(), controller, punchPrintSettings); string pdfFileName = TestUtil.GetTestFile(basename + ".pdf"); punchPrinter.PrintToPdf(pdfFileName, false); CheckPdfDump(pdfFileName, TestUtil.GetTestFile(basename + "_baseline_page%d.png")); }
public void PrintPunchesRelay1() { controller.LoadInitialFile(TestUtil.GetTestFile("controller\\variations.ppen"), true); PunchPrintSettings punchPrintSettings = new PunchPrintSettings(); punchPrintSettings.BoxSize = 18; punchPrintSettings.CourseIds = new Id <Course>[] { CourseId(2), CourseId(0) }; PunchPrintingTest("punchcards\\relay1", punchPrintSettings); }
public void PrintPunchesPdf1() { controller.LoadInitialFile(TestUtil.GetTestFile("punchcards\\sample1.ppen"), true); PunchPrintSettings punchPrintSettings = new PunchPrintSettings(); punchPrintSettings.BoxSize = 18; punchPrintSettings.CourseIds = new Id <Course>[] { CourseId(1), CourseId(2), CourseId(3), CourseId(4), CourseId(0) }; PunchPdfTest("punchcards\\descpdf1", punchPrintSettings); }
public void PrintPunchesPdf2() { controller.LoadInitialFile(TestUtil.GetTestFile("punchcards\\sample1.ppen"), true); PunchPrintSettings punchPrintSettings = new PunchPrintSettings(); punchPrintSettings.PageSettings.Landscape = true; punchPrintSettings.PageSettings.Margins = new Margins(50, 50, 200, 200); punchPrintSettings.BoxSize = 9; punchPrintSettings.CourseIds = new Id <Course>[] { CourseId(0), CourseId(1), CourseId(2), CourseId(3), CourseId(4), CourseId(5), CourseId(6), CourseId(7) }; PunchPdfTest("punchcards\\descpdf2", punchPrintSettings); }
private void PunchPrintingTest(string basename, PunchPrintSettings punchPrintSettings) { // Get the pages of the printing. PunchPrinting punchPrinter = new PunchPrinting(controller.GetEventDB(), controller, punchPrintSettings); Bitmap[] bitmaps = punchPrinter.PrintBitmaps(); // Check all the pages against the baseline. for (int page = 0; page < bitmaps.Length; ++page) { Bitmap bm = bitmaps[page]; string baseFileName = basename + "_page" + (page + 1).ToString(); TestUtil.CheckBitmapsBase(bm, baseFileName); } }
public void PrintPunchesRelay3() { controller.LoadInitialFile(TestUtil.GetTestFile("controller\\variations.ppen"), true); PunchPrintSettings punchPrintSettings = new PunchPrintSettings(); punchPrintSettings.BoxSize = 18; punchPrintSettings.VariationChoicesPerCourse[CourseId(2)] = new VariationChoices() { Kind = VariationChoices.VariationChoicesKind.Combined }; punchPrintSettings.CourseIds = new Id <Course>[] { CourseId(2) }; PunchPrintingTest("punchcards\\relay3", punchPrintSettings); }
public void PrintingException() { controller.LoadInitialFile(TestUtil.GetTestFile("punchcards\\sample1.ppen"), true); PunchPrintSettings punchPrintSettings = new PunchPrintSettings(); punchPrintSettings.CourseIds = new Id <Course>[] { CourseId(1), CourseId(2), CourseId(3) }; punchPrintSettings.PageSettings.PrinterSettings.PrinterName = "foobar"; bool success = controller.PrintPunches(punchPrintSettings, false); Assert.IsFalse(success); string expected = @"ERROR: 'Cannot print 'Marymoor WIOL 2' for the following reason: Settings to access printer 'foobar' are not valid.' "; Assert.AreEqual(expected, ui.output.ToString()); }
public void PrintingException() { controller.LoadInitialFile(TestUtil.GetTestFile("punchcards\\sample1.ppen"), true); PunchPrintSettings punchPrintSettings = new PunchPrintSettings(); punchPrintSettings.CourseIds = new Id<Course>[] { CourseId(1), CourseId(2), CourseId(3) }; punchPrintSettings.PageSettings.PrinterSettings.PrinterName = "foobar"; bool success = controller.PrintPunches(punchPrintSettings, false); Assert.IsFalse(success); string expected = @"ERROR: 'Cannot print 'Marymoor WIOL 2' for the following reason: Settings to access printer 'foobar' are not valid.' "; Assert.AreEqual(expected, ui.output.ToString()); }
public void PrintPunches2() { controller.LoadInitialFile(TestUtil.GetTestFile("punchcards\\sample1.ppen"), true); PunchPrintSettings punchPrintSettings = new PunchPrintSettings(); punchPrintSettings.PageSettings.Landscape = true; punchPrintSettings.PageSettings.Margins = new Margins(50, 50, 200, 200); punchPrintSettings.BoxSize = 9; punchPrintSettings.CourseIds = new Id<Course>[] { CourseId(0), CourseId(1), CourseId(2), CourseId(3), CourseId(4), CourseId(5), CourseId(6), CourseId(7) }; PunchPrintingTest("punchcards\\desc2", punchPrintSettings); }
public void PrintPunches1() { controller.LoadInitialFile(TestUtil.GetTestFile("punchcards\\sample1.ppen"), true); PunchPrintSettings punchPrintSettings = new PunchPrintSettings(); punchPrintSettings.BoxSize = 18; punchPrintSettings.CourseIds = new Id<Course>[] { CourseId(1), CourseId(2), CourseId(3), CourseId(4), CourseId(0) }; PunchPrintingTest("punchcards\\desc1", punchPrintSettings); }
public void PrintPunchesRelay3() { controller.LoadInitialFile(TestUtil.GetTestFile("controller\\variations.ppen"), true); PunchPrintSettings punchPrintSettings = new PunchPrintSettings(); punchPrintSettings.BoxSize = 18; punchPrintSettings.VariationChoicesPerCourse[CourseId(2)] = new VariationChoices() { Kind = VariationChoices.VariationChoicesKind.Combined }; punchPrintSettings.CourseIds = new Id<Course>[] { CourseId(2) }; PunchPrintingTest("punchcards\\relay3", punchPrintSettings); }
public void PrintPunchesRelay1() { controller.LoadInitialFile(TestUtil.GetTestFile("controller\\variations.ppen"), true); PunchPrintSettings punchPrintSettings = new PunchPrintSettings(); punchPrintSettings.BoxSize = 18; punchPrintSettings.CourseIds = new Id<Course>[] { CourseId(2), CourseId(0) }; PunchPrintingTest("punchcards\\relay1", punchPrintSettings); }