Exemplo n.º 1
0
 public void ReplaceTextExistsAfterReplace()
 {
     WordInterface = new WordAPI(TemplatePath, false);
     WordInterface.FindAndReplace(FindAndReplacePairs, false);
     foreach (var pair in FindAndReplacePairs)
     {
         Assert.IsTrue(WordInterface.ContainsText(pair.Value, false));
     }
     WordInterface.Close();
 }
Exemplo n.º 2
0
 public void SearchTextDoesNotExistAfterReplace()
 {
     WordInterface = new WordAPI(TemplatePath, false);
     WordInterface.FindAndReplace(FindAndReplacePairs, false);
     foreach (var pair in FindAndReplacePairs)
     {
         Assert.IsFalse(WordInterface.ContainsText(pair.Key, false));
     }
     WordInterface.Close();
 }
Exemplo n.º 3
0
        public void ReadOnlySearchAndReplaceFails()
        {
            Exception failedEx = null;

            try
            {
                WordInterface = new WordAPI(TemplatePath, true);
                WordInterface.FindAndReplace(FindAndReplacePairs, false);
            }
            catch (Exception e)
            {
                failedEx = e;
            }
            WordInterface.Close();
            Assert.IsNotNull(failedEx);
        }