public void enumerating_aggregates_the_dependencies() { var child1 = new DependencyCollection(); child1.Add(new Dependency("Bottles")); child1.Add(new Dependency("FubuCore")); var child2 = new DependencyCollection(); child2.Add(new Dependency("Bottles")); child2.Add(new Dependency("FubuCore")); child2.Add(new Dependency("FubuTestingSupport", "0.9.2.4")); child2.Add(new Dependency("RhinoMocks", "3.6.1")); theSolutionDependencies.Add(new Dependency("Bottles", "1.0.1.2")); theSolutionDependencies.Add(new Dependency("FubuCore", "1.0.1.5")); theSolutionDependencies.AddChild(child1); theSolutionDependencies.AddChild(child2); var expected = new[] { new Dependency("Bottles", "1.0.1.2"), new Dependency("FubuCore", "1.0.1.5"), new Dependency("FubuTestingSupport", "0.9.2.4"), new Dependency("RhinoMocks", "3.6.1") }; theSolutionDependencies.ShouldHaveTheSameElementsAs(expected); }
public void updates_cached_routes() { var cache = new SubscriptionCache(new ChannelGraph(), new ITransport[]{new InMemoryTransport(), }); var subscriptions1 = new[] { ObjectMother.ExistingSubscription(), ObjectMother.ExistingSubscription() }; subscriptions1[0].MessageType = typeof(string).FullName; subscriptions1[1].MessageType = typeof(int).FullName; var subscriptions2 = new[] { ObjectMother.ExistingSubscription() }; subscriptions2[0].MessageType = typeof(int).FullName; cache.LoadSubscriptions(subscriptions1); cache.FindDestinationChannels(new Envelope { Message = "Foo" }); cache.FindDestinationChannels(new Envelope { Message = 42 }); cache.CachedRoutes.ContainsKey(typeof(string)).ShouldBeTrue(); cache.CachedRoutes.ContainsKey(typeof(int)).ShouldBeTrue(); cache.LoadSubscriptions(subscriptions2); cache.CachedRoutes.ContainsKey(typeof(string)).ShouldBeFalse(); cache.CachedRoutes.ContainsKey(typeof(int)).ShouldBeTrue(); }
public void can_generate_output_for_a_collection_of_tags() { var tags = new[]{ new HtmlTag("div"), new HtmlTag("p"), new HtmlTag("div")}; var list = new TagList(tags); list.ToString().ShouldEqual("<div></div>\n<p></p>\n<div></div>"); }
public void can_be_used_as_a_tag_source() { var tags = new[] { new HtmlTag("div"), new HtmlTag("p"), new HtmlTag("div") }; var tagSource = (ITagSource)new TagList(tags); tagSource.AllTags().ShouldHaveTheSameElementsAs(tags); }