Exemple #1
0
        public void CreatePolygon_InvalidList_Throws()
        {
            List <int[]> list = new List <int[]>();

            list.Add(new int[] { 1, 2 });
            list.Add(new int[] { 3, 4, 7 });
            list.Add(new int[] { 5, 6 });

            Shape polygon = PowerpointHelper.CreatePolygon(list);
        }
Exemple #2
0
        public void CreatePolygon_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, "AFAFAF");
        }
Exemple #3
0
        public void CreatePolygon_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);
        }
Exemple #4
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");
        }
Exemple #5
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);
        }
Exemple #6
0
        public void AddCenteredParagraph_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.AddCenteredParagraph(polygon, "text");

            var errors = validator.Validate(polygon);

            Assert.IsTrue(errors.Count() == 0);
            Assert.IsTrue(polygon.Descendants <D.Paragraph>().Count() - oldNbParagraph == 1);
        }
Exemple #7
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);
        }
Exemple #8
0
        public void AddElement_Valid()
        {
            PresentationDocument pres      = PowerpointHelper.CreatePresentationWithOneEmptySlide("./testFile3.pptx");
            ShapeTree            shapeTree = PowerpointHelper.GetShapeTreeOfFirstSlide(pres);
            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);

            PowerpointHelper.AddElement(shapeTree, polygon);

            var errors = validator.Validate(pres);

            Assert.IsTrue(errors.Count() == 0);
            Assert.IsTrue(shapeTree.Count() > 0);
        }
Exemple #9
0
        public void CreatePolygon_EmptyList_Throws()
        {
            List <int[]> list = new List <int[]>();

            Shape polygon = PowerpointHelper.CreatePolygon(list);
        }