예제 #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"));
        }
예제 #4
0
 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
파일: GobleTests.cs 프로젝트: pshomov/frog
        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'}");
 }