コード例 #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);
        }
コード例 #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");
        }
コード例 #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);
        }