/// <summary> /// Initialize a new FileSystemHelper to a specific directory. /// </summary> /// <param name="testInstance"> /// Reference to the test class (to access its logging). /// </param> /// <param name="rootPath">The rootPath directory.</param> public FileSystemHelper(TestBase testInstance, string rootPath) { Debug.Assert(testInstance != null); Debug.Assert(!string.IsNullOrEmpty(rootPath)); TestInstance = testInstance; // Set the directory and create it if necessary. RootPath = rootPath; if (!FileUtilities.DataStore.DirectoryExists(rootPath)) { Log("Creating directory {0}", rootPath); FileUtilities.DataStore.CreateDirectory(rootPath); } }
/// <summary> /// Initializes a new FileSystemHelper to a random temp directory. /// </summary> /// <param name="testInstance"> /// Reference to the test class (to access its logging). /// </param> public FileSystemHelper(TestBase testInstance) : this(testInstance, GetTemporaryDirectoryName()) { }