public void PersistedDirectoryLazyLoad(FileSystemRunner fileSystem)
        {
            const string EnumerateDirectoryName = "GVFS\\GVFS";

            string[] subFolders = new string[]
            {
                Path.Combine(EnumerateDirectoryName, "Properties"),
                Path.Combine(EnumerateDirectoryName, "CommandLine")
            };

            string[] subFiles = new string[]
            {
                Path.Combine(EnumerateDirectoryName, "App.config"),
                Path.Combine(EnumerateDirectoryName, "GitVirtualFileSystem.ico"),
                Path.Combine(EnumerateDirectoryName, "GVFS.csproj"),
                Path.Combine(EnumerateDirectoryName, "packages.config"),
                Path.Combine(EnumerateDirectoryName, "Program.cs"),
                Path.Combine(EnumerateDirectoryName, "Setup.iss")
            };

            string enumerateDirectoryPath = this.Enlistment.GetVirtualPathTo(EnumerateDirectoryName);

            fileSystem.DirectoryExists(enumerateDirectoryPath).ShouldEqual(true);

            foreach (string folder in subFolders)
            {
                string directoryPath = this.Enlistment.GetVirtualPathTo(folder);
                fileSystem.DirectoryExists(directoryPath).ShouldEqual(true);
            }

            foreach (string file in subFiles)
            {
                string filePath = this.Enlistment.GetVirtualPathTo(file);
                fileSystem.FileExists(filePath).ShouldEqual(true);
            }

            this.Enlistment.UnmountGVFS();
            this.Enlistment.MountGVFS();

            foreach (string folder in subFolders)
            {
                string directoryPath = this.Enlistment.GetVirtualPathTo(folder);
                fileSystem.DirectoryExists(directoryPath).ShouldEqual(true);
            }

            foreach (string file in subFiles)
            {
                string filePath = this.Enlistment.GetVirtualPathTo(file);
                fileSystem.FileExists(filePath).ShouldEqual(true);
            }
        }
 public static string ShouldNotExistOnDisk(this string path, FileSystemRunner runner)
 {
     runner.FileExists(path).ShouldEqual(false, "File " + path + " exists when it should not");
     runner.DirectoryExists(path).ShouldEqual(false, "Directory " + path + " exists when it should not");
     return(path);
 }
Exemplo n.º 3
0
 public static string ShouldNotExistOnDisk(this string path, FileSystemRunner runner)
 {
     runner.FileExists(path).ShouldEqual(false);
     runner.DirectoryExists(path).ShouldEqual(false);
     return(path);
 }