public void CreateConnectionShape_Valid() { Shape rectangle1 = PowerpointHelper.CreateRectangleShape(50, 10, 10, 20); Shape rectangle2 = PowerpointHelper.CreateRectangleShape(10, 20, 30, 40); PowerpointHelper.CreateConnectionShape(rectangle1, rectangle2, new int[] { 1, 2 }, new int[] { 3, 4 }); }
public void CreateConnectionShape_InvalidEndPosition_Throws() { Shape rectangle1 = PowerpointHelper.CreateRectangleShape(50, 10, 10, 20); Shape rectangle2 = PowerpointHelper.CreateRectangleShape(10, 20, 30, 40); PowerpointHelper.CreateConnectionShape(rectangle1, rectangle2, new int[] { 1, 2 }, new int[] { 3, 4, 5 }); }
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); }
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"); }
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); }
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); }
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); }
public void CreateRectangle_NegativeHeight_Throws() { PowerpointHelper.CreateRectangleShape(50, 50, 50, -100); }
public void CreateRectangle_InvalidColor_Throws() { PowerpointHelper.CreateRectangleShape(50, 50, 50, 50, "invalid"); }