public void Topic_returns_the_matching_topic()
 {
     var sut = new HostConfiguration();
     sut.Topics.Add(new TopicConfiguration() { TopicName = "Atopic"});
     sut.Topics.Add(new TopicConfiguration() { TopicName = "othertopic" });
     Assert.Equal(sut.Topic("Atopic").TopicName, "Atopic");
     Assert.Equal(sut.Topic("othertopic").TopicName, "othertopic");
 }
 public void If_any_of_the_topics_configuration_is_not_valid_HostConfiguration_is_not_valid_either()
 {
     var sut = new  HostConfiguration();
     sut.Topics.Add(new TopicConfiguration());
     Assert.False(sut.IsValid());
     Assert.Equal(sut.BrokenRules.Count(), 2);
     Assert.Contains("topic name can't be null", sut.BrokenRules.ElementAt(0));
     Assert.Contains("a quota must be configured", sut.BrokenRules.ElementAt(1));
 }