示例#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 CreateRectangle_ZerosValues_Valid()
        {
            Shape rectangle = PowerpointHelper.CreateRectangleShape(-10, -10, 0, 0);

            PowerpointHelper.AddParagraph(rectangle, "text");

            var errors = validator.Validate(rectangle);

            Assert.IsTrue(errors.Count() == 0);
        }
示例#4
0
        public void CreateRectangleShape_CustomAttributes_Valid()
        {
            Shape rectangle = PowerpointHelper.CreateRectangleShape(50, 50, 50, 50, "AFAFAF", D.TextAnchoringTypeValues.Bottom, D.TextWrappingValues.None);

            PowerpointHelper.AddParagraph(rectangle, "text");

            var errors = validator.Validate(rectangle);

            Assert.IsTrue(errors.Count() == 0);
        }
示例#5
0
        public void AddParagraph_InvalidColor_Throws()
        {
            List <int[]> list = new List <int[]>();

            list.Add(new int[] { 1, 2 });
            list.Add(new int[] { 3, 4 });
            list.Add(new int[] { 5, 6 });
            Shape polygon = PowerpointHelper.CreatePolygon(list);

            int oldNbParagraph = polygon.Descendants <D.Paragraph>().Count();

            PowerpointHelper.AddParagraph(polygon, "text", 10, "invalid");
        }
示例#6
0
        public void AddParagraph_NegativeFontSize_Throws()
        {
            List <int[]> list = new List <int[]>();

            list.Add(new int[] { 1, 2 });
            list.Add(new int[] { 3, 4 });
            list.Add(new int[] { 5, 6 });
            Shape polygon = PowerpointHelper.CreatePolygon(list);

            int oldNbParagraph = polygon.Descendants <D.Paragraph>().Count();

            PowerpointHelper.AddParagraph(polygon, "text", -10);
        }
示例#7
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);
        }
示例#8
0
        public void AddParagraph_CustomAttributes_Valid()
        {
            List <int[]> list = new List <int[]>();

            list.Add(new int[] { 1, 2 });
            list.Add(new int[] { 3, 4 });
            list.Add(new int[] { 5, 6 });
            Shape polygon = PowerpointHelper.CreatePolygon(list);

            int oldNbParagraph = polygon.Descendants <D.Paragraph>().Count();

            PowerpointHelper.AddParagraph(polygon, "text", 400, "ABABAB", true, D.TextAlignmentTypeValues.Right);

            var errors = validator.Validate(polygon);

            Assert.IsTrue(errors.Count() == 0);
            Assert.IsTrue(polygon.Descendants <D.Paragraph>().Count() - oldNbParagraph == 1);
        }
示例#9
0
        public void AddParagraph_Valid()
        {
            List <int[]> list = new List <int[]>();

            list.Add(new int[] { 1, 2 });
            list.Add(new int[] { 3, 4 });
            list.Add(new int[] { 5, 6 });
            Shape polygon = PowerpointHelper.CreatePolygon(list);

            int oldNbParagraph = polygon.Descendants <D.Paragraph>().Count();

            PowerpointHelper.AddParagraph(polygon, "text");

            var errors = validator.Validate(polygon);

            Assert.IsTrue(errors.Count() == 0);
            Assert.IsTrue(polygon.Descendants <D.Paragraph>().Count() - oldNbParagraph == 1);
        }