public void CropMultipleShapesSuccessfully() { var actualSlide = PpOperations.SelectSlide(7); var shapesBeforeCrop = PpOperations.SelectShapesByPrefix("selectMe"); Assert.AreEqual(6, shapesBeforeCrop.Count); // Execute the Crop To Shape feature PplFeatures.AutoCrop(); // the result shape after crop multiple shapes will have name starts with // Group var resultShape = PpOperations.SelectShapesByPrefix("Group")[1]; var resultShapeInPic = PpOperations.ExportSelectedShapes(); var expSlide = PpOperations.SelectSlide(8); var expShape = PpOperations.SelectShapesByPrefix("Group")[1]; var expShapeInPic = PpOperations.ExportSelectedShapes(); // remove elements that affect comparing slides // e.g. "Expected" textbox PpOperations.SelectShapesByPrefix("text").Delete(); SlideUtil.IsSameLooking(expShape, expShapeInPic, resultShape, resultShapeInPic); SlideUtil.IsSameLooking(expSlide, actualSlide); }
private void CropRotatedShapeSuccessfully() { Microsoft.Office.Interop.PowerPoint.Slide actualSlide = PpOperations.SelectSlide(10); PpOperations.SelectShape("selectMe"); // Execute the Crop To Shape feature PplFeatures.AutoCrop(); Microsoft.Office.Interop.PowerPoint.Shape resultShape = PpOperations.SelectShapesByPrefix("selectMe")[1]; System.IO.FileInfo resultShapeInPic = PpOperations.ExportSelectedShapes(); Microsoft.Office.Interop.PowerPoint.Slide expSlide = PpOperations.SelectSlide(11); Microsoft.Office.Interop.PowerPoint.Shape expShape = PpOperations.SelectShapesByPrefix("selectMe")[1]; System.IO.FileInfo expShapeInPic = PpOperations.ExportSelectedShapes(); // remove elements that affect comparing slides // e.g. "Expected" textbox PpOperations.SelectShapesByPrefix("text").Delete(); SlideUtil.IsSameLooking(expShape, expShapeInPic, resultShape, resultShapeInPic); SlideUtil.IsSameLooking(expSlide, actualSlide); }
private void CropRotatedShapeSuccessfully() { var actualSlide = PpOperations.SelectSlide(10); PpOperations.SelectShape("selectMe"); // Execute the Crop To Shape feature PplFeatures.AutoCrop(); var resultShape = PpOperations.SelectShapesByPrefix("selectMe")[1]; var resultShapeInPic = PpOperations.ExportSelectedShapes(); var expSlide = PpOperations.SelectSlide(11); var expShape = PpOperations.SelectShapesByPrefix("selectMe")[1]; var expShapeInPic = PpOperations.ExportSelectedShapes(); // remove elements that affect comparing slides // e.g. "Expected" textbox PpOperations.SelectShapesByPrefix("text").Delete(); SlideUtil.IsSameLooking(expShape, expShapeInPic, resultShape, resultShapeInPic); SlideUtil.IsSameLooking(expSlide, actualSlide); }