Ejemplo n.º 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);
        }
Ejemplo n.º 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");
        }
Ejemplo n.º 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);
        }
Ejemplo n.º 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");
        }
Ejemplo n.º 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);
        }
Ejemplo n.º 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);
        }
Ejemplo n.º 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);
        }
Ejemplo n.º 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);
        }
Ejemplo n.º 9
0
        public void CreatePolygon_EmptyList_Throws()
        {
            List <int[]> list = new List <int[]>();

            Shape polygon = PowerpointHelper.CreatePolygon(list);
        }