Ejemplo n.º 1
0
        public void AddTextRun_NegativeFontSize_Throws()
        {
            Shape rectangle = PowerpointHelper.CreateRectangleShape(50, 50, 50, 50);

            D.Paragraph paragraph = PowerpointHelper.AddParagraph(rectangle, "text");

            int oldNbTextRun = paragraph.Descendants <D.Run>().Count();

            PowerpointHelper.AddTextRun(paragraph, "text", -100);
        }
Ejemplo n.º 2
0
        public void AddTextRun_InvalidColor_Throws()
        {
            Shape rectangle = PowerpointHelper.CreateRectangleShape(50, 50, 50, 50);

            D.Paragraph paragraph = PowerpointHelper.AddParagraph(rectangle, "text");

            int oldNbTextRun = paragraph.Descendants <D.Run>().Count();

            PowerpointHelper.AddTextRun(paragraph, "text", 100, "invalid");
        }
Ejemplo n.º 3
0
        public void AddTextRun_CustomAttributes_Valid()
        {
            Shape rectangle = PowerpointHelper.CreateRectangleShape(50, 50, 50, 50);

            D.Paragraph paragraph = PowerpointHelper.AddParagraph(rectangle, "text");

            int oldNbTextRun = paragraph.Descendants <D.Run>().Count();

            PowerpointHelper.AddTextRun(paragraph, "text", 400, "487315", true);

            var errors = validator.Validate(paragraph);

            Assert.IsTrue(errors.Count() == 0);
            Assert.IsTrue(paragraph.Descendants <D.Run>().Count() - oldNbTextRun == 1);
        }