Ejemplo n.º 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);
        }
Ejemplo n.º 2
0
        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);
        }
Ejemplo n.º 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);
        }
Ejemplo n.º 4
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);
        }