예제 #1
0
        public void local_dependencies()
        {
            var solution = new Solution();
            var storage = MockRepository.GenerateStub<INugetStorage>();

            var dependencies = new LocalDependencies(new[] { new NugetFile("Bottles.1.0.1.252.nupkg", SolutionMode.Ripple) });
            storage.Stub(x => x.Dependencies(solution)).Return(dependencies);

            solution.UseStorage(storage);

            solution.LocalDependencies().ShouldEqual(dependencies);
        }
예제 #2
0
        public void convert_solution()
        {
            var storage = MockRepository.GenerateStub<INugetStorage>();

            var solution = new Solution();
            solution.UseStorage(storage);

            solution.ConvertTo(SolutionMode.Ripple);

            storage.AssertWasCalled(x => x.Reset(solution));

            solution.Storage.ShouldBeOfType<NugetStorage>().Strategy.ShouldBeOfType<RippleDependencyStrategy>();
        }
예제 #3
0
        public void missing_files()
        {
            var solution = new Solution();
            var storage = MockRepository.GenerateStub<INugetStorage>();

            var q1 = new Dependency("Bottles", "1.0.1.1");
            var q2 = new Dependency("FubuCore", "1.0.1.252");

            storage.Stub(x => x.MissingFiles(solution)).Return(new[] { q1, q2 });

            solution.UseStorage(storage);

            solution.MissingNugets().ShouldHaveTheSameElementsAs(q1, q2);
        }
예제 #4
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"));
        }
        public void SetUp()
        {
            theStorage = new StubNugetStorage();
            theStorage.Add("FubuCore", "1.0.0.0");
            theStorage.Add("Bottles", "1.0.0.0");
            theStorage.Add("StructureMap", "2.6.3");

            theSolution = Solution.Empty();
            theSolution.AddDependency(new Dependency("FubuCore", "1.0.0.0"));
            theSolution.AddDependency(new Dependency("Bottles", "1.0.0.0"));
            theSolution.AddDependency(new Dependency("FubuLocalization", "1.0.0.0"));
            theSolution.AddDependency(new Dependency("StructureMap", "2.6.3", UpdateMode.Fixed));
            theSolution.AddFeed(Feed.Fubu);
            theSolution.UseStorage(theStorage);

            FeedScenario.Create(scenario =>
            {
                scenario
                    .For(Feed.Fubu)
                    .Add("StructureMap", "2.6.4.54");
            });
        }
        public void SetUp()
        {
            theFeed = new Feed("testing");
            theStorage = new StubNugetStorage();

            theSolution = new Solution();
            theSolution.UseStorage(theStorage);
            theSolution.AddFeed(theFeed);
            theSolution.AddDependency(new Dependency("Bottles", "1.0.0.0"));
            theSolution.AddDependency(new Dependency("FubuCore"));
            theSolution.AddDependency(new Dependency("StructureMap", "2.6.3", UpdateMode.Fixed));

            theFeedService = theSolution.FeedService.As<FeedService>();

            FeedScenario.Create(scenario =>
            {
                scenario.For(theFeed)
                        .Add(new Dependency("Bottles", "1.0.0.0"))
                        .Add(new Dependency("Bottles", "1.0.1.0"))
                        .Add(new Dependency("FubuCore", "1.2.0.0"))
                        .Add(new Dependency("StructureMap", "2.6.4.54"));
            });
        }
예제 #7
0
        public void SetUp()
        {
            thePlanBuilder = MockRepository.GenerateStub<INugetPlanBuilder>();

            var r1 = new NugetPlanRequest { Dependency = new Dependency("d1")};
            var r2 = new NugetPlanRequest { Dependency = new Dependency("d2") };
            var r3 = new NugetPlanRequest { Dependency = new Dependency("d3") };

            s1 = MockRepository.GenerateStub<INugetStep>();
            s2 = MockRepository.GenerateStub<INugetStep>();
            s3 = MockRepository.GenerateStub<INugetStep>();

            thePlanBuilder.Stub(x => x.PlanFor(r1)).Return(new NugetPlan(s1));
            thePlanBuilder.Stub(x => x.PlanFor(r2)).Return(new NugetPlan(s2));
            thePlanBuilder.Stub(x => x.PlanFor(r3)).Return(new NugetPlan(s3));
            
            theSolution = new Solution();
            theSolution.UseBuilder(thePlanBuilder);
            theSolution.UseStorage(new StubNugetStorage());

            var input = new StubNugetOperationContext(r1, r2, r3);
            new NugetOperation { Solution = theSolution}.Execute(input, null);
        }
예제 #8
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));
        }
예제 #9
0
        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));
        }
예제 #10
0
        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));
        }
        public void SetUp()
        {
            theStorage = new StubNugetStorage();
            theStorage.Add("FubuCore", "1.0.0.0");
            theStorage.Add("Bottles", "1.0.0.0");
            theStorage.Add("FubuLocalization", "1.0.0.0");

            theSolution = new Solution();
            theSolution.AddDependency(new Dependency("FubuCore", "1.0.0.0"));
            theSolution.AddDependency(new Dependency("Bottles", "1.0.0.0"));
            theSolution.AddDependency(new Dependency("FubuLocalization", "1.0.0.0"));
            theSolution.AddFeed(new Feed("local"));
            theSolution.UseStorage(theStorage);

            FeedScenario.Create(scenario =>
            {
                scenario.For(new Feed("local"))
                    .Add("FubuCore", "1.0.0.1")
                    .Add("Bottles", "1.0.0.0");
            });
        }