Exemplo n.º 1
0
        public void setNameUserZeroNumbersColumns()
        {
            PDFFormatTableGenerator pDFFormatTableGenerator = new PDFFormatTableGenerator("setNameUserZeroNumbersColumns");
            ArgumentException       ex = Assert.Throws <ArgumentException>(() => pDFFormatTableGenerator.setNameUser(ViewPDFTest.USER_NAME, ViewPDFTest.fontUserName));

            Assert.Equal("Parameter cannot be null\r\nParameter name: numberColumns", ex.Message);
            Assert.Equal("numberColumns", ex.ParamName);
        }
Exemplo n.º 2
0
        public void setFirstLineTest()
        {
            PDFFormatTableGenerator pDFFormatTableGenerator = new PDFFormatTableGenerator("setFirstLineTest");
            List <Column>           columns = ViewPDFTest.getColumns();

            columns.RemoveAt(0);
            pDFFormatTableGenerator.setNumberColumns(ViewPDFTest.NUMBERS_COLUMNS);
            pDFFormatTableGenerator.setNameUser(ViewPDFTest.USER_NAME, ViewPDFTest.fontUserName);
            Exception ex = Assert.Throws <Exception>(() => pDFFormatTableGenerator.setFirstLine(columns));

            Assert.Equal("numberColumns different columns.Count", ex.Message);
        }
        public void viewPDFWith100ScoresTest()
        {
            string fileName = "viewPDFWith100Scores";
            PDFFormatTableGenerator pDFFormatTableGenerator = new PDFFormatTableGenerator(fileName);
            List <Column>           columns = getColumns();
            List <Score>            scores  = get100Scores();

            pDFFormatTableGenerator.setNumberColumns(NUMBERS_COLUMNS);
            pDFFormatTableGenerator.setNameUser(USER_NAME, fontUserName);
            pDFFormatTableGenerator.setFirstLine(columns);
            pDFFormatTableGenerator.setScoreTable(scores, font);
            pDFFormatTableGenerator.generateTable();
            System.Diagnostics.Process.Start(Directory.GetCurrentDirectory() + "\\" + fileName + ".pdf");
        }