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); }
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"); }
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); }
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"); }
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); }
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); }
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); }
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); }
public void CreatePolygon_EmptyList_Throws() { List <int[]> list = new List <int[]>(); Shape polygon = PowerpointHelper.CreatePolygon(list); }