Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
MessageConfig.FileBaseDir will now be checked for an absolute path
- Loading branch information
Showing
9 changed files
with
139 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
using System; | ||
using System.IO; | ||
using MailMergeLib; | ||
using NUnit.Framework; | ||
|
||
namespace UnitTests | ||
{ | ||
[TestFixture] | ||
public class Message_Config | ||
{ | ||
private MessageConfig _msgConfig = new MessageConfig(); | ||
private string _tempPath = Path.GetTempPath(); | ||
|
||
[TestCase(" \t", "?")] | ||
[TestCase(" ", "?")] | ||
[TestCase("", "?")] | ||
[TestCase(null, "?")] | ||
[TestCase("\\noFullPath", null)] | ||
[TestCase("C:\\some\\path\\to\\folder", "C:\\some\\path\\to\\folder")] | ||
public void SetFileBaseDirectory(string path, string expected) | ||
{ | ||
if (expected == "?") expected = Path.GetTempPath(); | ||
if (expected == null) | ||
{ | ||
Assert.Throws<ArgumentException>(() => _msgConfig.FileBaseDirectory = path); | ||
return; | ||
} | ||
|
||
_msgConfig.FileBaseDirectory = path; | ||
Assert.AreEqual(expected, _msgConfig.FileBaseDirectory); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters