Example #1
0
        public void AddImage_NegativeHeight_Throws()
        {
            PresentationDocument pres       = PowerpointHelper.CreatePresentationWithOneEmptySlide("./testFileI3.pptx");
            ShapeTree            shapeTree  = PowerpointHelper.GetShapeTreeOfFirstSlide(pres);
            GroupShape           groupShape = PowerpointHelper.CreateGroupShape(50, 50, 50, 50);

            PowerpointHelper.AddElement(shapeTree, groupShape);

            Bitmap logo = Resx.klee;

            using (MemoryStream ms = new MemoryStream()) {
                logo.Save(ms, System.Drawing.Imaging.ImageFormat.Png);
                PowerpointHelper.AddImage(groupShape, ms, 50, 50, 50, -50);
            }
        }
Example #2
0
        public void AddImage_Valid()
        {
            PresentationDocument pres       = PowerpointHelper.CreatePresentationWithOneEmptySlide("./testFileI.pptx");
            ShapeTree            shapeTree  = PowerpointHelper.GetShapeTreeOfFirstSlide(pres);
            GroupShape           groupShape = PowerpointHelper.CreateGroupShape(50, 50, 50, 50);

            PowerpointHelper.AddElement(shapeTree, groupShape);
            Bitmap logo = Resx.klee;

            int oldNbPicture = groupShape.Descendants <Picture>().Count();

            using (MemoryStream ms = new MemoryStream()) {
                logo.Save(ms, System.Drawing.Imaging.ImageFormat.Png);
                PowerpointHelper.AddImage(groupShape, ms, 50, 50, 50, 50);
            }

            Assert.IsTrue(groupShape.Descendants <Picture>().Count() - oldNbPicture == 1);
        }
Example #3
0
        public void ResizeGroup_NegativeHeight_Throws()
        {
            GroupShape groupShape = PowerpointHelper.CreateGroupShape(50, 50, 50, 50);

            PowerpointHelper.ResizeGroup(groupShape, 10, -100);
        }
Example #4
0
        public void ResizeGroup_ZerosValues_Valid()
        {
            GroupShape groupShape = PowerpointHelper.CreateGroupShape(50, 50, 50, 50);

            PowerpointHelper.ResizeGroup(groupShape, 0, 0);
        }
Example #5
0
        public void ResizeGroup_Valid()
        {
            GroupShape groupShape = PowerpointHelper.CreateGroupShape(50, 50, 50, 50);

            PowerpointHelper.ResizeGroup(groupShape, 100, 10);
        }
Example #6
0
 public void CreateGroupShape_NegativeHeight_Throws()
 {
     PowerpointHelper.CreateGroupShape(50, 50, 50, -100);
 }
Example #7
0
 public void CreateGroupShape_ZerosValues_Valid()
 {
     GroupShape groupShape = PowerpointHelper.CreateGroupShape(-10, -10, 0, 0);
 }
Example #8
0
 public void CreateGroupShape_Valid()
 {
     GroupShape groupShape = PowerpointHelper.CreateGroupShape(50, 50, 50, 50);
 }