Skip to content

Commit

Permalink
Check existence of prerequisite files
Browse files Browse the repository at this point in the history
  • Loading branch information
tatsuyafujisaki committed Oct 27, 2017
1 parent f9479d7 commit bb7995c
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions UnitTestProject1/UnitTest1.cs
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,11 @@ public void TestMergeDocuments()
const string path1 = "Source1.docx";
const string path2 = "Source2.docx";

if (!(File.Exists(path1) && File.Exists(path2)))
{
return;
}

Api.MergeDocuments(path1, path2);

Process.Start(path1);
Expand All @@ -101,6 +106,11 @@ public void TestMergeDocumentsToNewFile()
const string path2 = "Source2.docx";
const string path3 = "Destination.docx";

if (!(File.Exists(path1) && File.Exists(path2)))
{
return;
}

Api.MergeDocuments(path1, path2, path3);

Process.Start(path3);
Expand All @@ -111,6 +121,11 @@ public void TestProtectWord()
{
const string path = "Sample.docx";

if (!File.Exists(path))
{
return;
}

Api.ProtectWord(path, "dummy");

Process.Start(path);
Expand All @@ -121,6 +136,11 @@ public void TestSetColumnJustification()
{
const string path = "Sample.docx";

if (!File.Exists(path))
{
return;
}

TestRunner(path, mdp => Api.SetColumnJustification(mdp.Document.Body.GetFirstChild<Table>(), 0, JustificationValues.Center));
}

Expand Down

0 comments on commit bb7995c

Please sign in to comment.