示例#1
0
        public void AuditDispatcher_isRoutingkeyMatch_IncorrectMatchWithHashWildcardThreeLevelsWithTrailingText()
        {
            // Arrange

            using (var target = new AuditDispatcher(null, null, options))
            {
                var commandKey = "Test.#.event";
                var eventKey   = "Test.test.test";

                // Act
                var result = target.isRoutingKeyMatch(commandKey, eventKey);

                // Assert
                Assert.IsFalse(result);
            }
        }
示例#2
0
        public void AuditDispatcher_isRoutingkeyMatch_CorrectMatchWithHashWildcardFourLevelsWithLeadingAndTrailingText()
        {
            // Arrange

            using (var target = new AuditDispatcher(null, null, options))
            {
                var commandKey = "Test.#.Event";
                var eventKey   = "Test.test.tEst.Event";

                // Act
                var result = target.isRoutingKeyMatch(commandKey, eventKey);

                // Assert
                Assert.IsTrue(result);
            }
        }
示例#3
0
        public void AuditDispatcher_isRoutingkeyMatch_CorrectMatchWithHashWildcardTwoLevels()
        {
            // Arrange

            using (var target = new AuditDispatcher(null, null, options))
            {
                var commandKey = "#";
                var eventKey   = "Test.test";

                // Act
                var result = target.isRoutingKeyMatch(commandKey, eventKey);

                // Assert
                Assert.IsTrue(result);
            }
        }
示例#4
0
        public void AuditDispatcher_isRoutingkeyMatch_IncorrectMatchWithStarWildcardMultipleLevels()
        {
            // Arrange

            using (var target = new AuditDispatcher(null, null, options))
            {
                var commandKey = "Test.*.event";
                var eventKey   = "Test.test.anothertest.event";

                // Act
                var result = target.isRoutingKeyMatch(commandKey, eventKey);

                // Assert
                Assert.IsFalse(result);
            }
        }
示例#5
0
        public void AuditDispatcher_isRoutingkeyMatch_correctMatchWithStarWildcardAndTrailingText()
        {
            // Arrange

            using (var target = new AuditDispatcher(null, null, options))
            {
                var commandKey = "Test.*.event";
                var eventKey   = "Test.test.event";

                // Act
                var result = target.isRoutingKeyMatch(commandKey, eventKey);

                // Assert
                Assert.IsTrue(result);
            }
        }
示例#6
0
        public void AuditDispatcher_isRoutingkeyMatch_IncorrectMatch()
        {
            // Arrange

            using (var target = new AuditDispatcher(null, null, options))
            {
                var commandKey = "Test";
                var eventKey   = "Mismatch";

                // Act
                var result = target.isRoutingKeyMatch(commandKey, eventKey);

                // Assert
                Assert.IsFalse(result);
            }
        }