public void SetUp()
        {
            theSolution = new Solution();
            theSolution.ClearFeeds();

            theSolution.AddFeed(Feed.Fubu);
            theSolution.AddFeed(Feed.NuGetV2);

            theSolution.AddDependency(bottles      = new Dependency("Bottles"));
            theSolution.AddDependency(fubucore     = new Dependency("FubuCore", "1.0.1.201"));
            theSolution.AddDependency(rhinomocks   = new Dependency("RhinoMocks", "3.6.1", UpdateMode.Fixed));
            theSolution.AddDependency(structuremap = new Dependency("StructureMap", "2.6.3", UpdateMode.Fixed));

            RippleEnvironment.StubConnection(true);

            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"),
            });
            theFubuFeed.Stub(x => x.IsOnline()).Return(true);

            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"));
            theNugetFeed.Stub(x => x.IsOnline()).Return(true);

            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);
        }
Esempio n. 2
0
        public static void Create(Action <FeedScenario> configure)
        {
            var scenario = new FeedScenario();

            scenario.Online();

            configure(scenario);

            FeedRegistry.Stub(scenario.theProvider);
        }