Esempio n. 1
0
        public void copy_directory()
        {
            var system = new FileSystem();

            system.ResetDirectory("dagobah");
            system.WriteStringToFile("dagobah".AppendPath("f1", "a.txt"), "something");
            system.WriteStringToFile("dagobah".AppendPath("f2", "a.txt"), "something");
            system.WriteStringToFile("dagobah".AppendPath("f3", "a.txt"), "something");
            system.WriteStringToFile("dagobah".AppendPath("f1", "f1a", "a.txt"), "something");
            system.WriteStringToFile("dagobah".AppendPath("f1", "f1a", "f1b", "a.txt"), "something");
            system.WriteStringToFile("dagobah".AppendPath("a.txt"), "something");

            system.DeleteDirectory("rhenvar");
            system.Copy("dagobah", "rhenvar");

            system.FindFiles("rhenvar", FileSet.Everything()).Select(x => x.PathRelativeTo("rhenvar")).OrderBy(x => x)
                .ShouldHaveTheSameElementsAs(
                    "a.txt",
                    FileSystem.Combine("f1", "a.txt"),
                    FileSystem.Combine("f1", "f1a", "a.txt"),
                    FileSystem.Combine("f1", "f1a", "f1b", "a.txt"),
                    FileSystem.Combine("f2", "a.txt"),
                    FileSystem.Combine("f3", "a.txt")
                );
        }
Esempio n. 2
0
        public void SetUp()
        {
            fileSystem = new FileSystem();

            fileSystem.Copy("FubuMVC.SlickGrid.Docs.csproj.fake", "FubuMVC.SlickGrid.Docs.csproj");
            fileSystem.Copy("SlickGridHarness.csproj.fake", "SlickGridHarness.csproj");
            fileSystem.Copy("SlickGridHarness.csproj.fake", "SlickGridHarness/SlickGridHarness.csproj");

            fileSystem.DeleteDirectory("myproj");
            fileSystem.CreateDirectory("myproj");
        }
Esempio n. 3
0
        public void copy_with_preserve()
        {
            var system = new FileSystem();
            system.WriteStringToFile("a.txt", "something");
            system.WriteStringToFile("b.txt", "else");
            system.Copy("a.txt", "b.txt", CopyBehavior.preserve);

            system.ReadStringFromFile("b.txt").ShouldEqual("else");
        }
        public static void ResetBottleProjectCode()
        {
            var system = new FileSystem();
            CleanStagingDirectory();

            system.Copy(SourceDirectory, StagingDirectory);

            system.CreateDirectory(ZipsDirectory);
            system.CleanDirectory(ZipsDirectory);
        }
 public void SetUp()
 {
     var fileSystem = new FileSystem();
     fileSystem.DeleteDirectory("myfoo");
     fileSystem.CreateDirectory("myfoo");
     fileSystem.Copy("SlickGridHarness.csproj.fake", "SlickGridHarness.csproj");
 }
Esempio n. 6
0
        public void copy_with_overwrite()
        {
            var system = new FileSystem();
            system.WriteStringToFile("a.txt", "something");
            system.WriteStringToFile("b.txt", "else");
            system.Copy("a.txt", "b.txt", CopyBehavior.overwrite);

            system.ReadStringFromFile("b.txt").ShouldBe("something");
        }