Ejemplo n.º 1
0
        public void TestStartBoxing()
        {
            PpOperations.SelectSlide(2);
            Microsoft.Office.Interop.PowerPoint.ShapeRange shapes = PpOperations.SelectShapesByPrefix("TextBox");
            TextBoxes textBoxes = new TextBoxes(shapes,
                                                Pres.PageSetup.SlideWidth, Pres.PageSetup.SlideHeight);

            textBoxes
            .SetAlignment(Alignment.Centre)
            .SetPosition(Position.Left)
            .StartBoxing();
            TextBoxInfo 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));
        }
Ejemplo n.º 2
0
 public void TestGetTextBoxInfoForEmptyTextBoxes()
 {
     Microsoft.Office.Interop.PowerPoint.ShapeRange shapes = PpOperations.SelectShapesByPrefix("TextBox");
     TextBoxes textBoxes = new TextBoxes(shapes, 
         Pres.PageSetup.SlideWidth, Pres.PageSetup.SlideHeight);
     TextBoxInfo textBoxInfo = textBoxes.GetTextBoxesInfo();
     Assert.AreEqual(null, textBoxInfo);
 }
Ejemplo n.º 3
0
        public void TestGetTextBoxInfoForEmptyTextBoxes()
        {
            var shapes    = PpOperations.SelectShapesByPrefix("TextBox");
            var textBoxes = new TextBoxes(shapes,
                                          Pres.PageSetup.SlideWidth, Pres.PageSetup.SlideHeight);
            var textBoxInfo = textBoxes.GetTextBoxesInfo();

            Assert.AreEqual(null, textBoxInfo);
        }
Ejemplo n.º 4
0
        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));
        }
Ejemplo n.º 5
0
        public void TestGetTextBoxInfo()
        {
            PpOperations.SelectSlide(2);
            Microsoft.Office.Interop.PowerPoint.ShapeRange shapes = PpOperations.SelectShapesByPrefix("TextBox");
            TextBoxes textBoxes = new TextBoxes(shapes,
                                                Pres.PageSetup.SlideWidth, Pres.PageSetup.SlideHeight);
            TextBoxInfo textBoxInfo = textBoxes.GetTextBoxesInfo();

            Assert.IsTrue(SlideUtil.IsRoughlySame(57.5200043f, textBoxInfo.Height));
            Assert.IsTrue(SlideUtil.IsRoughlySame(68.2f, textBoxInfo.Left));
            Assert.IsTrue(SlideUtil.IsRoughlySame(52.17752f, textBoxInfo.Top));
            Assert.IsTrue(SlideUtil.IsRoughlySame(710.945068f, textBoxInfo.Width));

            TextBoxes.AddMargin(textBoxInfo, 25);
            Assert.IsTrue(SlideUtil.IsRoughlySame(107.520004f, textBoxInfo.Height));
            Assert.IsTrue(SlideUtil.IsRoughlySame(43.1999969f, textBoxInfo.Left));
            Assert.IsTrue(SlideUtil.IsRoughlySame(27.17752f, textBoxInfo.Top));
            Assert.IsTrue(SlideUtil.IsRoughlySame(760.945068f, textBoxInfo.Width));
        }
Ejemplo n.º 6
0
        public void TestGetTextBoxInfo()
        {
            PpOperations.SelectSlide(2);
            var shapes    = PpOperations.SelectShapesByPrefix("TextBox");
            var textBoxes = new TextBoxes(shapes,
                                          Pres.PageSetup.SlideWidth, Pres.PageSetup.SlideHeight);
            var textBoxInfo = textBoxes.GetTextBoxesInfo();

            Assert.IsTrue(SlideUtil.IsRoughlySame(348.4239f, textBoxInfo.Height));
            Assert.IsTrue(SlideUtil.IsRoughlySame(68.2f, textBoxInfo.Left));
            Assert.IsTrue(SlideUtil.IsRoughlySame(52.17752f, textBoxInfo.Top));
            Assert.IsTrue(SlideUtil.IsRoughlySame(741.0565f, textBoxInfo.Width));

            TextBoxes.AddMargin(textBoxInfo, 25);
            Assert.IsTrue(SlideUtil.IsRoughlySame(398.4239f, textBoxInfo.Height));
            Assert.IsTrue(SlideUtil.IsRoughlySame(43.1999969f, textBoxInfo.Left));
            Assert.IsTrue(SlideUtil.IsRoughlySame(27.17752f, textBoxInfo.Top));
            Assert.IsTrue(SlideUtil.IsRoughlySame(791.0565f, textBoxInfo.Width));
        }
Ejemplo n.º 7
0
        public void TestStartBoxingWithTextWrapping()
        {
            PpOperations.SelectSlide(2);
            Microsoft.Office.Interop.PowerPoint.ShapeRange shapes = PpOperations.SelectShapesByPrefix("TextBox");
            TextBoxes textBoxes = new TextBoxes(shapes,
                Pres.PageSetup.SlideWidth, Pres.PageSetup.SlideHeight);

            textBoxes.StartTextWrapping();

            textBoxes
                .SetAlignment(Alignment.Centre)
                .SetPosition(Position.Left)
                .StartBoxing();

            TextBoxInfo textBoxInfo = textBoxes.GetTextBoxesInfo();
            Assert.IsTrue(SlideUtil.IsRoughlySame(105.040009f, textBoxInfo.Height));
            Assert.IsTrue(SlideUtil.IsRoughlySame(25.00004f, textBoxInfo.Left));
            Assert.IsTrue(SlideUtil.IsRoughlySame(217.480042f, textBoxInfo.Top));
            // aft text wrapping, width is smaller (originally should be 710)
            Assert.IsTrue(SlideUtil.IsRoughlySame(365.47f, textBoxInfo.Width));
        }
Ejemplo n.º 8
0
        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));
        }