示例#1
0
        public void should_create_folder_with_a_file()
        {
            var genesis = new FileGenesis(workPlace);
            genesis.Folder("Flo").File("Fle.txt", "aaaaa");

            Assert.That(File.ReadAllText(Path.Combine(workPlace, Os.DirChars("Flo/Fle.txt"))), Is.EqualTo("aaaaa"));
        }
示例#2
0
 public void AddTaskWithComment(string taskName, string comment, string content, string project)
 {
     var repo = (string) ScenarioContext.Current[project];
     var gen = new FileGenesis();
     gen.File(string.Format("{0}.testtask", taskName), content.Replace("\\n", Environment.NewLine));
     GitTestSupport.CommitChangeFiles(repo, gen.Root, comment);
 }
示例#3
0
        public void should_create_file_with_contents()
        {
            var genesis = new FileGenesis(workPlace);
            genesis.File("Fle.txt", "aaaaa");

            Assert.That(File.ReadAllText(Path.Combine(workPlace, "Fle.txt")), Is.EqualTo("aaaaa"));
        }
 protected override void Given()
 {
     directory = IO.GetTemporaryDirectory();
     var genesis = new FileGenesis(directory);
     genesis.File("config.json", "{setting1 : 'v1', setting2 : 'wow' }")
            .Folder(sub_folder_name)
            .File("config.json", "{setting1 : 'v2'}");
 }
示例#5
0
        public void should_create_multiple_files()
        {
            var genesis = new FileGenesis(workPlace);
            genesis.File("Fle.txt", "aaaaa").File("Dugh.bin", "sdsd");

            Assert.That(File.ReadAllText(Path.Combine(workPlace, Os.DirChars("Fle.txt"))), Is.EqualTo("aaaaa"));
            Assert.That(File.ReadAllText(Path.Combine(workPlace, Os.DirChars("Dugh.bin"))), Is.EqualTo("sdsd"));
        }
示例#6
0
        public void should_go_up_the_folder_hierarchy()
        {
            var genesis = new FileGenesis(workPlace);
            genesis
                .Folder("down")
                .File("Dugh.bin", "sdsd")
                .Up()
                .File("Fle.txt", "aaaaa");

            Assert.That(File.ReadAllText(Path.Combine(workPlace, Os.DirChars("Fle.txt"))), Is.EqualTo("aaaaa"));
            Assert.That(File.ReadAllText(Path.Combine(workPlace, Os.DirChars("down/Dugh.bin"))), Is.EqualTo("sdsd"));
        }
        protected override void Given()
        {
            base.Given();
            var changeset = GetChangesetArea();
            var genesis = new FileGenesis(changeset);
            genesis
                .File("SampleProject.sln", "")
                .Folder("src")
                .Folder("tests")
                .Folder("Some.Tests")
                .File("Some.Test.csproj", "");

            GitTestSupport.CommitChangeFiles(repoUrl, changeset);
        }
示例#8
0
        protected override void Given()
        {
            base.Given();
            var changeset = GetChangesetArea();
            var genesis = new FileGenesis(changeset);
            genesis
                .Folder("src")
                    .Folder("tests")
                        .Folder("Some.Tests")
                            .File("Some.Test.csproj", "")
                            .Up()
                        .Up()
                    .Up()
                .File("SampleProject.sln", "");

            GitTestSupport.CommitChangeFiles(repoUrl, changeset, commitMessage: "commenting");
            revision1 = _driver.GetLatestRevision();
        }
示例#9
0
        public void Setup()
        {
            list = new List<string>();
            pathFinder = new PathFinder();

            workPlace = Path.Combine(GitTestSupport.GetTempPath(), Path.GetRandomFileName());
            Directory.CreateDirectory(workPlace);
            var genesis = new FileGenesis(workPlace);
            genesis.Folder("TestFixtures")
                .File("notest.txt", "")
                .File("test.txt", "")
                .Folder("Goble")
                    .File("l0f1.txt", "")
                    .File("l0f2.txt", "")
                    .Folder("level1")
                        .File("l1f1.txt", "")
                        .File("l1f2.txt", "")
                        .Folder("level2")
                            .File("l2f1.txt", "")
                            .File("l2f2.txt", "");
        }
示例#10
0
 public void Give_I_add_a_task(string taskName, string content, string project)
 {
     var repo = (string) ScenarioContext.Current[project];
     var gen = new FileGenesis();
     gen.File(string.Format("{0}.testtask", taskName), content.Replace("\\n", Environment.NewLine));
     GitTestSupport.CommitChangeFiles(repo, gen.Root, string.Format("commit on project {0} for adding task {1}", project, taskName));
 }
示例#11
0
 protected override void Given()
 {
     directory = IO.GetTemporaryDirectory();
     genesis = new FileGenesis(directory);
     genesis.File("config.json", "{level1 : {level2 : '1', level21 : {level3 : 'level3'}} }");
 }
示例#12
0
 protected override void Given()
 {
     directory = IO.GetTemporaryDirectory();
     var genesis = new FileGenesis(directory);
     genesis.File("config.json", "{setting1 : 'v1'}");
 }