/// <summary>
/// Validate a collection of assertions against files that are expected
/// to exist in the file system watched by a FileSystemHelper.
/// </summary>
/// <param name="files">
/// The FileSystemHelper watching the files.
/// </param>
/// <param name="assertions">
/// Mapping of relative path names to actions that will validate the
/// contents of the path. Each action takes a full path to the file
/// so it can be opened, verified, etc. Null actions are allowed and
/// serve to verify only that a file exists.
/// </param>
public static void AssertFiles(this FileSystemHelper files, Dictionary <string, Action <string> > assertions)
{
Assert.IsNotNull(files);
Assert.IsNotNull(assertions);
foreach (KeyValuePair <string, Action <string> > pair in assertions)
{
string path = files.GetFullPath(pair.Key);
bool exists = File.Exists(path);
Assert.IsTrue(exists, "Expected the existence of file {0}", pair.Key);
if (exists && pair.Value != null)
{
pair.Value(path);
}
}
}