Esempio n. 1
0
        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();
        }
Esempio n. 2
0
        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();
        }
Esempio n. 3
0
        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();
        }
Esempio n. 4
0
        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();
        }
Esempio n. 5
0
 public ChannelExpression AcceptsMessagesInNamespaceContainingType <TMessageType>()
 {
     alter = node => node.Rules.Add(NamespaceRule.For <TMessageType>());
     return(this);
 }