public void SetUp() { theFinder = MockRepository.GenerateStub<INuspecTemplateFinder>(); theSolution = new Solution(); theSolution.AddProject("Project1"); theSolution.AddProject("Project2"); d1 = new NuspecDependencyToken("DependencyA", "1.0.0.0", VersionConstraint.DefaultFixed); d2 = new NuspecDependencyToken("DependencyB", "1.0.0.0", VersionConstraint.DefaultFixed); g1 = new NuspecTemplate(new NugetSpec("Spec1", "Spec1.nuspec"), new[] { ProjectNuspec.For(theSolution.FindProject("Project1")) }); g2 = new NuspecTemplate(new NugetSpec("Spec2", "Spec2.nuspec"), new[] { ProjectNuspec.For(theSolution.FindProject("Project2")) }); theTemplates = new NuspecTemplateCollection(new[] { g1, g2 }); src1 = MockRepository.GenerateStub<INuspecDependencySource>(); src2 = MockRepository.GenerateStub<INuspecDependencySource>(); theFinder.Stub(x => x.Templates(theSolution)).Return(theTemplates); src1.Stub(x => x.DetermineDependencies(new NuspecTemplateContext(g1, theTemplates, theSolution))).Return(new[] { d1 }); src1.Stub(x => x.DetermineDependencies(new NuspecTemplateContext(g2, theTemplates, theSolution))).Return(new NuspecDependencyToken[0]); src2.Stub(x => x.DetermineDependencies(new NuspecTemplateContext(g1, theTemplates, theSolution))).Return(new NuspecDependencyToken[0]); src2.Stub(x => x.DetermineDependencies(new NuspecTemplateContext(g2, theTemplates, theSolution))).Return(new[] { d2 }); theGenerator = new NuspecGenerator(theFinder, new[] { src1, src2 }); thePlan = theGenerator.PlanFor(theSolution, new SemanticVersion("1.0.0.0")); }
public void SetUp() { theSolution = new Solution(); p1 = theSolution.AddProject("MyProject"); p1.AddDependency("Bottles"); p1.AddDependency("FubuCore"); p1.AddDependency("FubuLocalization"); p2 = theSolution.AddProject("MyOtherProject"); p2.AddDependency("FubuMVC.Core"); theSolution.AddDependency(new Dependency("Bottles", "1.0.0.0", UpdateMode.Fixed)); theSolution.AddDependency(new Dependency("FubuCore", "1.1.0.0", UpdateMode.Float)); theSolution.AddDependency(new Dependency("FubuLocalization", "1.2.0.0", UpdateMode.Fixed)); theSolution.AddDependency(new Dependency("FubuMVC.Core", "1.4.0.0", UpdateMode.Fixed)); theNugetSpec = new NugetSpec("MyProject", "myproject.nuspec"); theGroup = new NuspecTemplate(theNugetSpec, new[] { new ProjectNuspec(p1, new NugetSpec("MyProject", "MyProject.nuspec")), new ProjectNuspec(p2, new NugetSpec("MyOtherProject", "MyOtherProject.nuspec")) }); }
public void SetUp() { theSolution = new Solution(new SolutionConfig() { SourceFolder = "src", BuildCommand = RippleFileSystem.RakeRunnerFile(), FastBuildCommand = "rake compile", Floats = new string[] { "Nug1", "Nug2" }, }, "directory1"); var project1 = new Project("something.csproj"); project1.AddDependency(new NugetDependency("Nug1")); project1.AddDependency(new NugetDependency("Nug2")); project1.AddDependency(new NugetDependency("Nug3")); project1.AddDependency(new NugetDependency("Nug4")); theSolution.AddProject(project1); var project2 = new Project("something.csproj"); project2.AddDependency(new NugetDependency("Nug1")); project2.AddDependency(new NugetDependency("Nug3")); project2.AddDependency(new NugetDependency("Nug5")); project2.AddDependency(new NugetDependency("Nug6")); theSolution.AddProject(project2); }
public void SetUp() { theSolution = new Solution(); theProject = theSolution.AddProject("Project1"); theRunner = new NugetStepRunner(theSolution); }
public void can_read_and_write_the_packages_config() { var theFileSystem = new FileSystem(); theFileSystem.WriteStringToFile(NuGetDependencyStrategy.PackagesConfig, "<?xml version=\"1.0\" encoding=\"utf-8\"?><packages></packages>"); var theSolution = new Solution(); theSolution.AddDependency(new Dependency("Bottles", "1.0.1.1")); theSolution.AddDependency(new Dependency("FubuCore", "1.2.0.1")); var theProject = new Project("Test.csproj"); theProject.AddDependency("Bottles"); theProject.AddDependency("FubuCore"); theSolution.AddProject(theProject); var theStrategy = new NuGetDependencyStrategy(); theStrategy.Write(theProject); theStrategy .Read(theProject) .ShouldHaveTheSameElementsAs( new Dependency("Bottles", "1.0.1.1"), new Dependency("FubuCore", "1.2.0.1") ); theFileSystem.DeleteFile(NuGetDependencyStrategy.PackagesConfig); }
public void SetUp() { theSolution = new Solution(); theSolution.ClearFeeds(); theSolution.AddFeed(Feed.Fubu); theSolution.AddFeed(Feed.NuGetV2); theSolution.AddDependency(fubucore = new Dependency("FubuCore", "1.0.1.201")); var theProject = new Project("Test.csproj"); theSolution.AddProject(theProject); theProject.AddDependency(bottles = new Dependency("Bottles")); theProject.AddDependency(rhinomocks = new Dependency("RhinoMocks", "3.6.1", UpdateMode.Fixed)); theProject.AddDependency(structuremap = new Dependency("StructureMap", "2.6.3", UpdateMode.Fixed)); FeedScenario.Create(scenario => { scenario.For(Feed.Fubu) .Add("Bottles", "1.0.2.2") .Add("FubuCore", "1.0.2.232") .Add("StructureMap", "2.6.4.71"); scenario.For(Feed.NuGetV2) .Add("RhinoMocks", "3.6.1") .Add("StructureMap", "2.6.3"); scenario.For(theSolution.Cache.ToFeed()); scenario.Online(); }); }
public void SetUp() { theSolution = new Solution(); theSolution.ClearFeeds(); theSolution.AddFeed(Feed.Fubu); theSolution.AddFeed(Feed.NuGetV2); theSolution.AddDependency(fubucore = new Dependency("FubuCore", "1.0.1.201")); var theProject = new Project("Test.csproj"); theSolution.AddProject(theProject); theProject.AddDependency(bottles = new Dependency("Bottles")); theProject.AddDependency(rhinomocks = new Dependency("RhinoMocks", "3.6.1", UpdateMode.Fixed)); theProject.AddDependency(structuremap = new Dependency("StructureMap", "2.6.3", UpdateMode.Fixed)); theFubuFeed = MockRepository.GenerateStub<IFloatingFeed>(); theFubuFeed.Stub(x => x.GetLatest()).Return(new IRemoteNuget[] { new StubNuget("Bottles", "1.0.2.2"), new StubNuget("FubuCore", "1.0.2.232"), new StubNuget("StructureMap", "2.6.4.71"), }); theNugetFeed = MockRepository.GenerateStub<INugetFeed>(); theNugetFeed.Stub(x => x.Find(rhinomocks)).Return(new StubNuget("RhinoMocks", "3.6.1")); theNugetFeed.Stub(x => x.Find(structuremap)).Return(new StubNuget("StructureMap", "2.6.3")); theFeedProvider = MockRepository.GenerateStub<IFeedProvider>(); theFeedProvider.Stub(x => x.For(Feed.Fubu)).Return(theFubuFeed); theFeedProvider.Stub(x => x.For(Feed.NuGetV2)).Return(theNugetFeed); FeedRegistry.Stub(theFeedProvider); }
public void SetUp() { theSolution = Solution.NuGet("Test"); p1 = theSolution.AddProject("Project1"); p2 = theSolution.AddProject("Project2"); p1.AddDependency(new Dependency("NuGetA", "1.0.0.0", UpdateMode.Fixed)); p1.AddDependency(new Dependency("NuGetB", "1.1.0.0", UpdateMode.Fixed)); p1.AddDependency(new Dependency("NuGetC", "1.4.5.0", UpdateMode.Fixed)); p2.AddDependency(new Dependency("NuGetD", "1.3.0.0", UpdateMode.Fixed)); p2.AddDependency(new Dependency("NuGetE", "3.3.0.0", UpdateMode.Fixed)); p2.AddDependency(new Dependency("NuGetF", "2.1.0.0", UpdateMode.Fixed)); p2.AddDependency(new Dependency("NuGetB", "1.2.0.0", UpdateMode.Fixed)); // Conflict new NuGetSolutionLoader().SolutionLoaded(theSolution); }
public void SetUp() { theConfig = new SolutionConfig(); theSolution = new Solution(); p1 = theSolution.AddProject("Project1"); p2 = theSolution.AddProject("Project2"); p1.AddDependency(new Dependency("Bottles")); p1.AddDependency(new Dependency("FubuCore", "1.1.2.3", UpdateMode.Fixed)); p2.AddDependency(new Dependency("FubuCore", "1.1.2.3", UpdateMode.Fixed)); p2.AddDependency(new Dependency("FubuLocalization")); p2.AddDependency(new Dependency("StructureMap", "2.6.3", UpdateMode.Fixed)); theLoader = new NuGetSolutionLoader(); theLoader.ExtractSolutionLevelConfiguration(theConfig, theSolution); }
public void adding_a_project_sets_the_solution() { var solution = new Solution(); var project = new Project("MyProject.csproj"); solution.AddProject(project); solution.Projects.ShouldHaveTheSameElementsAs(project); project.Solution.ShouldBeTheSameAs(solution); }
public void combines_the_dependencies() { var solution = new Solution(); solution.AddDependency(new Dependency("Bottles", "1.0.1.1")); var project = new Project("MyProject.csproj"); project.AddDependency(new Dependency("FubuCore", "1.2.3.4")); solution.AddProject(project); solution.Dependencies.ShouldHaveTheSameElementsAs(new Dependency("Bottles", "1.0.1.1"), new Dependency("FubuCore", "1.2.3.4")); }
public void SetUp() { theSolution = new Solution(); theProject = new Project("TestProject.csproj"); theProject.AddDependency(new Dependency("Bottles", "1.0.0.0", UpdateMode.Fixed)); theProject.AddDependency(new Dependency("FubuCore", "1.0.0.0", UpdateMode.Fixed)); theSolution.AddProject(theProject); theSolution.Update("Bottles", "1.1.0.0"); theSolution.Update("FubuCore", "1.2.0.1"); }
public void SetUp() { theSolution = new Solution(); p1 = theSolution.AddProject("MyProject"); p1.AddDependency("Bottles"); p1.AddDependency("FubuCore"); p1.AddDependency("FubuLocalization"); p2 = theSolution.AddProject("MyOtherProject"); p2.AddDependency("FubuMVC.Core"); theSolution.AddDependency(new Dependency("Bottles", "1.0.0.0", UpdateMode.Fixed)); theSolution.AddDependency(new Dependency("FubuCore", "1.1.0.0", UpdateMode.Float)); theSolution.AddDependency(new Dependency("FubuLocalization", "1.2.0.0", UpdateMode.Fixed)); theSolution.AddDependency(new Dependency("FubuMVC.Core", "1.4.0.0", UpdateMode.Fixed)); theNugetSpec = new NugetSpec("MyProject", "myproject.nuspec"); // explicit dependencies are not overridden theNugetSpec.Dependencies.Add(new NuspecDependency("Bottles", "1.0.0.0")); theGroup = new SpecGroup(theNugetSpec, new[] { p1, p2 }); }
public void get_nuget_directory() { var solution = new Solution { SourceFolder = "source", Directory = ".".ToFullPath() }; var storage = new StubNugetStorage(); storage.Add("FubuCore", "0.9.1.37"); solution.UseStorage(storage); var project = new Project("something.csproj"); var dependency = new Dependency("FubuCore", "0.9.1.37"); project.AddDependency(dependency); solution.AddProject(project); var spec = new NugetSpec("FubuCore", "somefile.nuspec"); solution.NugetFolderFor(spec) .ShouldEqual(".".ToFullPath().AppendPath(solution.PackagesDirectory(), "FubuCore")); }
public void adding_a_project_should_set_the_update_mode_on_all_nuget_dependencies() { var solution = new Solution(new SolutionConfig() { SourceFolder = "src", BuildCommand = RippleFileSystem.RakeRunnerFile(), FastBuildCommand = "rake compile", Floats = new string[]{"Nug1", "Nug2"}, }, "directory1"); var project = new Project("something.csproj"); project.AddDependency(new NugetDependency("Nug1")); project.AddDependency(new NugetDependency("Nug2")); project.AddDependency(new NugetDependency("Nug3")); project.AddDependency(new NugetDependency("Nug4")); solution.AddProject(project); project.FindDependency("Nug1").UpdateMode.ShouldEqual(UpdateMode.Float); project.FindDependency("Nug2").UpdateMode.ShouldEqual(UpdateMode.Float); project.FindDependency("Nug3").UpdateMode.ShouldEqual(UpdateMode.Locked); project.FindDependency("Nug4").UpdateMode.ShouldEqual(UpdateMode.Locked); }
public void valid_for_floated_nugets() { var solution = new Solution(); var p1 = new Project("Project1.csproj"); p1.Dependencies.Add(new Dependency("Bottles")); var p2 = new Project("Project2.csproj"); p2.Dependencies.Add(new Dependency("Bottles")); solution.AddProject(p1); solution.AddProject(p2); solution.AssertIsValid(); }
public void valid_for_matching_dependencies() { var solution = new Solution(); var p1 = new Project("Project1.csproj"); p1.Dependencies.Add(new Dependency("Bottles", "1.0.0.0")); var p2 = new Project("Project2.csproj"); p2.Dependencies.Add(new Dependency("Bottles", "1.0.0.0")); solution.AddProject(p1); solution.AddProject(p2); solution.AssertIsValid(); }
private static void readProjects(string directory, FileSystem system, Solution solution) { var csProjSet = new FileSet(){ Include = "*.csproj" }; system.FindFiles(directory, csProjSet).Each(file => { var project = Project.ReadFrom(file); solution.AddProject(project); }); }
public void SetUp() { theConfig = new SolutionConfig(); theConfig.FloatNuget("Bottles"); theConfig.FloatNuget("FubuCore"); theConfig.FloatNuget("FubuLocalization"); theSolution = new Solution(); p1 = theSolution.AddProject("Project1"); p2 = theSolution.AddProject("Project2"); p1.AddDependency(new Dependency("Bottles", "1.1.2.3", UpdateMode.Fixed)); p1.AddDependency(new Dependency("FubuCore", "1.1.2.3", UpdateMode.Fixed)); p2.AddDependency(new Dependency("FubuLocalization", "1.0.0.1", UpdateMode.Fixed)); p2.AddDependency(new Dependency("StructureMap", "2.6.3", UpdateMode.Fixed)); theLoader = new NuGetSolutionLoader(); theLoader.MarkFloatingDependencies(theConfig, theSolution); }
public void get_nuget_directory() { var solution = new Solution(new SolutionConfig() { SourceFolder = "source" }, ".".ToFullPath()); var project = new Project("something.csproj"); var dependency = new NugetDependency("FubuCore", "0.9.1.37"); project.AddDependency(dependency); solution.AddProject(project); var spec = new NugetSpec("FubuCore", "somefile.nuspec"); solution.NugetFolderFor(spec) .ShouldEqual(".".ToFullPath().AppendPath(solution.Config.SourceFolder, "packages", "FubuCore.0.9.1.37")); }
public void invalid_for_mismatched_dependencies() { var solution = new Solution(); var p1 = new Project("Project1.csproj"); p1.Dependencies.Add(new Dependency("Bottles", "1.0.0.0")); var p2 = new Project("Project2.csproj"); p2.Dependencies.Add(new Dependency("Bottles", "0.9.0.0")); solution.AddProject(p1); solution.AddProject(p2); Exception<RippleException>.ShouldBeThrownBy(() => solution.AssertIsValid()) .HasProblems().ShouldBeTrue(); }
public void saving_the_solution_with_changed_projects() { var storage = MockRepository.GenerateStub<INugetStorage>(); var solution = new Solution(); var project = new Project("Test.csproj"); solution.AddProject(project); solution.UseStorage(storage); project.AddDependency("FubuCore"); solution.Save(true); storage.AssertWasCalled(x => x.Write(solution)); storage.AssertWasCalled(x => x.Write(project)); }
public void saving_the_solution_after_requesting_a_save() { var storage = MockRepository.GenerateStub<INugetStorage>(); var solution = new Solution(); var project = new Project("Test.csproj"); solution.AddProject(project); solution.UseStorage(storage); solution.RequestSave(); solution.Save(); storage.AssertWasCalled(x => x.Write(solution)); storage.AssertWasNotCalled(x => x.Write(project)); }
public void saving_the_solution_with_no_changes_in_projects() { var storage = MockRepository.GenerateStub<INugetStorage>(); var solution = new Solution(); var project = new Project("Test.csproj"); solution.AddProject(project); solution.UseStorage(storage); solution.Save(); storage.AssertWasNotCalled(x => x.Write(solution)); storage.AssertWasNotCalled(x => x.Write(project)); }