Exemplo n.º 1
0
 public static void DoesNotExist(string filePath, string shapeName)
 {
     using (PresentationDocument document = PresentationDocument.Open(filePath, false))
     {
         var shape = document.GetShapeByName(shapeName);
         Assert.IsNull(shape);
     }
 }
Exemplo n.º 2
0
        public static void ContainsText(string filePath, string shapeName, string expectedText)
        {
            using (PresentationDocument document = PresentationDocument.Open(filePath, false))
            {
                var textbox = document.GetShapeByName(shapeName);
                var text    = "";
                var runs    = textbox.TextBody.Descendants <Run>();

                if (runs != null && runs.Count() > 0)
                {
                    foreach (var run in runs)
                    {
                        if (run != null)
                        {
                            text += run.Text.Text;
                        }
                    }
                }
                Assert.AreEqual(expectedText, text);
            }
        }