public void TestStartBoxing() { PpOperations.SelectSlide(2); var shapes = PpOperations.SelectShapesByPrefix("TextBox"); var textBoxes = new TextBoxes(shapes, Pres.PageSetup.SlideWidth, Pres.PageSetup.SlideHeight); textBoxes .SetAlignment(Alignment.Centre) .SetPosition(Position.Left) .StartBoxing(); var textBoxInfo = textBoxes.GetTextBoxesInfo(); Assert.IsTrue(SlideUtil.IsRoughlySame(241.439987f, textBoxInfo.Height)); Assert.IsTrue(SlideUtil.IsRoughlySame(25f, textBoxInfo.Left)); Assert.IsTrue(SlideUtil.IsRoughlySame(149.279953f, textBoxInfo.Top)); Assert.IsTrue(SlideUtil.IsRoughlySame(710.945068f, textBoxInfo.Width)); textBoxes .SetAlignment(Alignment.Centre) .SetPosition(Position.Centre) .StartBoxing(); textBoxInfo = textBoxes.GetTextBoxesInfo(); Assert.IsTrue(SlideUtil.IsRoughlySame(124.527481f, textBoxInfo.Left)); Assert.IsTrue(SlideUtil.IsRoughlySame(149.279953f, textBoxInfo.Top)); textBoxes .SetAlignment(Alignment.Centre) .SetPosition(Position.BottomLeft) .StartBoxing(); textBoxInfo = textBoxes.GetTextBoxesInfo(); Assert.IsTrue(SlideUtil.IsRoughlySame(25f, textBoxInfo.Left)); Assert.IsTrue(SlideUtil.IsRoughlySame(273.559875f, textBoxInfo.Top)); textBoxes .SetAlignment(Alignment.Centre) .SetPosition(Position.Bottom) .StartBoxing(); textBoxInfo = textBoxes.GetTextBoxesInfo(); Assert.IsTrue(SlideUtil.IsRoughlySame(124.527481f, textBoxInfo.Left)); Assert.IsTrue(SlideUtil.IsRoughlySame(273.560028f, textBoxInfo.Top)); textBoxes .SetAlignment(Alignment.Centre) .SetPosition(Position.Right) .StartBoxing(); textBoxInfo = textBoxes.GetTextBoxesInfo(); Assert.IsTrue(SlideUtil.IsRoughlySame(224.054962f, textBoxInfo.Left)); Assert.IsTrue(SlideUtil.IsRoughlySame(149.279953f, textBoxInfo.Top)); textBoxes .SetAlignment(Alignment.Auto) .SetPosition(Position.Original) .StartBoxing(); textBoxInfo = textBoxes.GetTextBoxesInfo(); Assert.IsTrue(SlideUtil.IsRoughlySame(68.2f, textBoxInfo.Left)); Assert.IsTrue(SlideUtil.IsRoughlySame(52.17752f, textBoxInfo.Top)); }
public void TestStartBoxing() { PpOperations.SelectSlide(2); var shapes = PpOperations.SelectShapesByPrefix("TextBox"); var textBoxes = new TextBoxes(shapes, Pres.PageSetup.SlideWidth, Pres.PageSetup.SlideHeight); textBoxes .SetAlignment(Alignment.Centre) .SetPosition(Position.Left) .StartBoxing(); var textBoxInfo = textBoxes.GetTextBoxesInfo(); Assert.IsTrue(SlideUtil.IsRoughlySame(57.5200043f, textBoxInfo.Height)); Assert.IsTrue(SlideUtil.IsRoughlySame(25f, textBoxInfo.Left)); Assert.IsTrue(SlideUtil.IsRoughlySame(241.240036f, textBoxInfo.Top)); Assert.IsTrue(SlideUtil.IsRoughlySame(710.945068f, textBoxInfo.Width)); textBoxes .SetAlignment(Alignment.Centre) .SetPosition(Position.Centre) .StartBoxing(); textBoxInfo = textBoxes.GetTextBoxesInfo(); Assert.IsTrue(SlideUtil.IsRoughlySame(124.527481f, textBoxInfo.Left)); Assert.IsTrue(SlideUtil.IsRoughlySame(241.240036f, textBoxInfo.Top)); textBoxes .SetAlignment(Alignment.Centre) .SetPosition(Position.BottomLeft) .StartBoxing(); textBoxInfo = textBoxes.GetTextBoxesInfo(); Assert.IsTrue(SlideUtil.IsRoughlySame(25f, textBoxInfo.Left)); Assert.IsTrue(SlideUtil.IsRoughlySame(457.480042f, textBoxInfo.Top)); textBoxes .SetAlignment(Alignment.Centre) .SetPosition(Position.Bottom) .StartBoxing(); textBoxInfo = textBoxes.GetTextBoxesInfo(); Assert.IsTrue(SlideUtil.IsRoughlySame(124.527481f, textBoxInfo.Left)); Assert.IsTrue(SlideUtil.IsRoughlySame(457.480042f, textBoxInfo.Top)); textBoxes .SetAlignment(Alignment.Centre) .SetPosition(Position.Right) .StartBoxing(); textBoxInfo = textBoxes.GetTextBoxesInfo(); Assert.IsTrue(SlideUtil.IsRoughlySame(224.054962f, textBoxInfo.Left)); Assert.IsTrue(SlideUtil.IsRoughlySame(241.23996f, textBoxInfo.Top)); }
public void TestStartBoxingWithTextWrapping() { PpOperations.SelectSlide(2); var shapes = PpOperations.SelectShapesByPrefix("TextBox"); var textBoxes = new TextBoxes(shapes, Pres.PageSetup.SlideWidth, Pres.PageSetup.SlideHeight); textBoxes.StartTextWrapping(); textBoxes .SetAlignment(Alignment.Centre) .SetPosition(Position.Left) .StartBoxing(); var textBoxInfo = textBoxes.GetTextBoxesInfo(); Assert.IsTrue(SlideUtil.IsRoughlySame(349.440033f, textBoxInfo.Height)); Assert.IsTrue(SlideUtil.IsRoughlySame(25f, textBoxInfo.Left)); Assert.IsTrue(SlideUtil.IsRoughlySame(95.27996f, textBoxInfo.Top)); // aft text wrapping, width is smaller (originally should be 710) Assert.IsTrue(SlideUtil.IsRoughlySame(448.355042f, textBoxInfo.Width)); }