public void offline_just_returns_the_cache()
        {
            RippleEnvironment.StubConnection(false);
            var cachedFeed = theCacheFeed.GetNugetFeed();

            theConnectivity.FeedsFor(theSolution).ShouldHaveTheSameElementsAs(cachedFeed);
        }
        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);
        }
        public void online_returns_the_cache_first_and_the_feed()
        {
            RippleEnvironment.StubConnection(true);

            var testFeed   = theFeed.GetNugetFeed();
            var cachedFeed = theCacheFeed.GetNugetFeed();

            theConnectivity.FeedsFor(theSolution).ShouldHaveTheSameElementsAs(cachedFeed, testFeed);
        }
Beispiel #4
0
 public void Online()
 {
     RippleEnvironment.StubConnection(true);
 }
Beispiel #5
0
 public void Offline()
 {
     RippleEnvironment.StubConnection(false);
 }