Beispiel #1
0
 /// <summary>
 /// Creates a directory at the specified path.
 /// </summary>
 /// <param name="fileSystem">The file system.</param>
 /// <param name="path">The path.</param>
 /// <returns>The same <see cref="FakeDirectory"/> instance so that multiple calls can be chained.</returns>
 public static FakeDirectory CreateDirectory(this FakeFileSystem fileSystem, DirectoryPath path)
 {
     var directory = fileSystem.GetDirectory(path);
     if (!directory.Exists)
     {
         directory.Create();
     }
     return directory;
 }
Beispiel #2
0
        /// <summary>
        /// Creates a directory at the specified path.
        /// </summary>
        /// <param name="fileSystem">The file system.</param>
        /// <param name="path">The path.</param>
        /// <returns>The same <see cref="FakeDirectory"/> instance so that multiple calls can be chained.</returns>
        public static FakeDirectory CreateDirectory(this FakeFileSystem fileSystem, DirectoryPath path)
        {
            if (fileSystem == null)
            {
                throw new ArgumentNullException("fileSystem");
            }
            if (path == null)
            {
                throw new ArgumentNullException("path");
            }
            var directory = fileSystem.GetDirectory(path);

            if (!directory.Exists)
            {
                directory.Create();
            }
            return(directory);
        }