Beispiel #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);
            }
        }
Beispiel #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);
        }
Beispiel #3
0
        public void ResizeGroup_NegativeHeight_Throws()
        {
            GroupShape groupShape = PowerpointHelper.CreateGroupShape(50, 50, 50, 50);

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

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

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