Ejemplo n.º 1
0
        /// <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 (!Directory.Exists(rootPath))
            {
                Log("Creating directory {0}", rootPath);
                Directory.CreateDirectory(rootPath);
            }
        }
Ejemplo n.º 2
0
 /// <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())
 {
 }