public void negative_test() { var rule = NamespaceRule.For <Red.Message1>(); rule.Matches(typeof(Green.Message1)).ShouldBeFalse(); rule.Matches(typeof(Green.Message2)).ShouldBeFalse(); rule.Matches(typeof(Green.Message3)).ShouldBeFalse(); }
public void positive_test() { var rule = NamespaceRule.For <Red.Message1>(); rule.Matches(typeof(Red.Message1)).ShouldBeTrue(); rule.Matches(typeof(Red.Message2)).ShouldBeTrue(); rule.Matches(typeof(Red.Message3)).ShouldBeTrue(); }
public void add_namespace_publishing_rule_2() { theRegistry.Channel(x => x.Outbound).AcceptsMessagesInNamespace(typeof(BusSettings).Namespace); channelFor(x => x.Outbound).Rules.Single() .ShouldBe(NamespaceRule.For <BusSettings>()); channelFor(x => x.Upstream).Rules.Any().ShouldBeFalse(); }
public void add_namespace_publishing_rule() { theRegistry.Channel(x => x.Outbound).AcceptsMessagesInNamespaceContainingType <BusSettings>(); channelFor(x => x.Outbound).Rules.Single() .ShouldEqual(NamespaceRule.For <BusSettings>()); channelFor(x => x.Upstream).Rules.Any().ShouldBeFalse(); }
public ChannelExpression AcceptsMessagesInNamespaceContainingType <TMessageType>() { alter = node => node.Rules.Add(NamespaceRule.For <TMessageType>()); return(this); }