public void SetUp()
        {
            thePlan = TemplatePlan.CreateClean("copy-references");

            thePlan.FileSystem.WriteStringToFile("ripple.dependencies.config", @"FubuCore
FubuMVC.Core
");

            thePlan.Add(new CreateSolution("References"));
            var originalPlan = new ProjectPlan("References");

            thePlan.Add(originalPlan);
            originalPlan.Add(new SystemReference("System.Data"));
            originalPlan.Add(new SystemReference("System.Configuration"));
            originalPlan.Add(new CopyFileToProject("ripple.dependencies.config", "ripple.dependencies.config"));
            originalPlan.NugetDeclarations.Add("Bottles");
            originalPlan.NugetDeclarations.Add("FubuMVC.Core");
            originalPlan.NugetDeclarations.Add("FubuLocalization");

            testingPlan = new ProjectPlan("References.Testing");
            thePlan.Add(testingPlan);
            thePlan.Add(new CopyProjectReferences("References"));


            thePlan.Execute();

            theOriginalProject = thePlan.Solution.FindProject("References").Project;
            theTestingProject  = thePlan.Solution.FindProject("References.Testing").Project;
        }
        public void project_folder_is_substituted()
        {
            thePlan = TemplatePlan.CreateClean("create-solutionProject");
            thePlan.Add(new CreateSolution("MySolution"));
            thePlan.Add(new ProjectPlan("MyProject"));

            thePlan.Execute();

            thePlan.CurrentProject.ApplySubstitutions("*%PROJECT_FOLDER%*")
            .ShouldEqual("*src/MyProject*");
        }
Пример #3
0
        public static void ConfigurePlan(TextFile textFile, TemplatePlan plan)
        {
            var ignores = textFile.ReadLines().Where(x => x.IsNotEmpty()).ToArray();
            var step    = new GitIgnoreStep(ignores);

            plan.Add(step);
        }
Пример #4
0
 public static void ConfigurePlan(TextFile textFile, TemplatePlan plan)
 {
     textFile.ReadLines().Each(line => {
         var parts = line.ToDelimitedArray();
         plan.Add(new GemReference(parts.First(), parts.Last()));
     });
 }
        public void alter_by_creating_new_project_from_default_template()
        {
            thePlan = TemplatePlan.CreateClean("create-solutionProject");
            thePlan.Add(new CreateSolution("MySolution"));
            thePlan.Add(new ProjectPlan("MyProject"));

            thePlan.Execute();

            var file = thePlan.SourceDirectory.AppendPath("MyProject", "MyProject.csproj");

            File.Exists(file).ShouldBeTrue();

            var project = CsProjFile.LoadFrom(file);

            project.ShouldNotBeNull();  // really just a smoke test
        }
Пример #6
0
 public static void ConfigurePlan(TextFile textFile, TemplatePlan plan)
 {
     GenericEnumerableExtensions.Each <string>(textFile.ReadLines(), delegate(string line)
     {
         string[] parts = FubuCore.StringExtensions.ToDelimitedArray(line);
         plan.Add(new GemReference(parts.First <string>(), parts.Last <string>()));
     });
 }
        public void project_plan_applies_the_dot_net_version()
        {
            thePlan = TemplatePlan.CreateClean("create-solutionProject");
            thePlan.Add(new CreateSolution("MySolution"));
            var projectPlan = new ProjectPlan("MyProject");

            thePlan.Add(projectPlan);

            thePlan.Execute();

            var file = thePlan.SourceDirectory.AppendPath("MyProject", "MyProject.csproj");

            File.Exists(file).ShouldBeTrue();

            var project = CsProjFile.LoadFrom(file);

            project.DotNetVersion.ShouldEqual(DotNetVersion.V40);
        }
Пример #8
0
        public static void ConfigurePlan(TextFile textFile, TemplatePlan plan)
        {
            string[] ignores = (from x in textFile.ReadLines()
                                where FubuCore.StringExtensions.IsNotEmpty(x)
                                select x).ToArray <string>();
            GitIgnoreStep step = new GitIgnoreStep(ignores);

            plan.Add(step);
        }
        public void copy_a_deep_path_to_the_right_spot()
        {
            thePlan = TemplatePlan.CreateClean("copy-file-to-project");

            thePlan.Add(new CreateSolution("MySolution"));
            var projectPlan = new ProjectPlan("MyProject");

            thePlan.Add(projectPlan);

            thePlan.FileSystem.WriteStringToFile("foo.txt", "some text");
            projectPlan.Add(new CopyFileToProject("bar/folder/foo.txt", "foo.txt"));

            thePlan.Execute();

            var file = FileSystem.Combine(thePlan.SourceDirectory, "MyProject", "bar", "folder", "foo.txt");

            File.Exists(file).ShouldBeTrue();
        }
        public void adds_the_project_file_to_the_csproj_file_as_Content()
        {
            thePlan = TemplatePlan.CreateClean("copy-file-to-project");

            thePlan.Add(new CreateSolution("MySolution"));
            var projectPlan = new ProjectPlan("MyProject");

            thePlan.Add(projectPlan);

            thePlan.FileSystem.WriteStringToFile("foo.txt", "some text");
            projectPlan.Add(new CopyFileToProject("foo.txt", "foo.txt"));

            thePlan.Execute();

            var project = CsProjFile.LoadFrom("copy-file-to-project".AppendPath("src", "MyProject", "MyProject.csproj"));

            project.Find <Content>("foo.txt").ShouldNotBeNull();
        }
        public void applies_substitutions()
        {
            thePlan = TemplatePlan.CreateClean("copy-file-to-project");

            thePlan.Add(new CreateSolution("MySolution"));
            var projectPlan = new ProjectPlan("MyProject");

            thePlan.Add(projectPlan);
            projectPlan.Substitutions.Set("%TEAM%", "Chiefs");

            thePlan.FileSystem.WriteStringToFile("foo.txt", "*%TEAM%*");
            projectPlan.Add(new CopyFileToProject("foo.txt", "foo.txt"));

            thePlan.Execute();

            var file = FileSystem.Combine(thePlan.SourceDirectory, "MyProject", "foo.txt");

            thePlan.FileSystem.ReadStringFromFile(file).ShouldEqual("*Chiefs*");
        }
        public void remembers_the_last_project_plan()
        {
            var context = new TemplatePlan("something");
            var plan1   = new ProjectPlan("NewProj1");
            var plan2   = new ProjectPlan("NewProj2");

            context.Add(new GitIgnoreStep("foo"));
            context.CurrentProject.ShouldBeNull();

            context.Add(plan1);
            context.CurrentProject.ShouldBeTheSameAs(plan1);

            context.Add(new CopyFileToSolution("foo", "foo.txt"));
            context.CurrentProject.ShouldBeTheSameAs(plan1);

            context.Add(plan2);

            context.CurrentProject.ShouldBeTheSameAs(plan2);
        }
Пример #13
0
        public DataMother(string directory, bool withProject = true)
        {
            _directory = directory;

            _plan = TemplatePlan.CreateClean(_directory);
            if (withProject)
            {
                _plan.Add(new ProjectPlan("SomeProject"));
            }
        }
        public void alter_by_creating_a_new_project_with_a_project_template_file()
        {
            thePlan = TemplatePlan.CreateClean("create-solutionProject");
            thePlan.Add(new CreateSolution("MySolution"));
            thePlan.Add(new ProjectPlan("MyProject")
            {
                ProjectTemplateFile = "Project.txt"
            });

            thePlan.Execute();

            var file = thePlan.SourceDirectory.AppendPath("MyProject", "MyProject.csproj");

            File.Exists(file).ShouldBeTrue();

            var project = CsProjFile.LoadFrom(file);

            project.All <AssemblyReference>().Any(x => x.Include == "System.Data")
            .ShouldBeTrue();     // the 'special' testing template has this reference, but the default template does not
        }