示例#1
0
        public void AddSingleLevelWildcard()
        {
            // Arrange
            ITopicBuilder builder = new TopicBuilder(TopicConsumer.Publisher);

            // Act
            Action addSingleLevelWildcard = () =>
                                            builder = builder.AddMultiLevelWildcard();

            // Assert
            addSingleLevelWildcard.Should()
            .Throw <IllegalStateOperationException>(
                "because a topic used on PUBLISH mode cannot use wildcard");
        }
示例#2
0
        public void AddMultiLevelWildcard()
        {
            // Arrange
            ITopicBuilder builder = new TopicBuilder(TopicConsumer.Subscriber);

            // Act
            builder = builder.AddMultiLevelWildcard();

            // Assert
            builder.Levels
            .Should()
            .Be(1, "because the wildcard consist of one level");

            builder.IsAppendingAllowed
            .Should()
            .BeFalse("because no addition should be allowed after a multi-level wildcard");
        }