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);
        }
Beispiel #3
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 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();

			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 = 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 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);
        }
Beispiel #9
0
        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"));
        }
Beispiel #10
0
        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"));

        }
Beispiel #11
0
        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));
        }