Beispiel #1
0
        public void IsMatch_WhenNoConditions_ReturnsTrue()
        {
            // Arrange
            RewriteAction   action  = new RewriteAction("/", RewriteProcessing.RestartProcessing);
            IRewriteContext context = new MockRewriteContext();

            // Act
            bool match = action.IsMatch(context);

            // Assert
            Assert.IsTrue(match);
        }
        public void IsMatch_WhenMultipleMatchingConditions_ReturnsTrue()
        {
            // Arrange
            RewriteAction action = new RewriteAction("/", RewriteProcessing.RestartProcessing);
            IRewriteContext context = new MockRewriteContext();
            action.Conditions.Add(new MockRewriteCondition(true));
            action.Conditions.Add(new MockRewriteCondition(true));

            // Act
            bool match = action.IsMatch(context);

            // Assert
            Assert.IsTrue(match);
        }
Beispiel #3
0
        public void IsMatch_WhenSingleConditionDoesNotMatch_ReturnsFalse()
        {
            // Arrange
            RewriteAction   action  = new RewriteAction("/", RewriteProcessing.RestartProcessing);
            IRewriteContext context = new MockRewriteContext();

            action.Conditions.Add(new MockRewriteCondition(false));

            // Act
            bool match = action.IsMatch(context);

            // Assert
            Assert.IsFalse(match);
        }
        public void IsMatch_WhenSingleConditionDoesNotMatch_ReturnsFalse()
        {
            // Arrange
            RewriteAction action = new RewriteAction("/", RewriteProcessing.RestartProcessing);
            IRewriteContext context = new MockRewriteContext();
            action.Conditions.Add(new MockRewriteCondition(false));

            // Act
            bool match = action.IsMatch(context);

            // Assert
            Assert.IsFalse(match);
        }