Пример #1
0
        public void IsMatch_WhenNoConditions_ReturnsTrue()
        {
            // Arrange
            RedirectAction  action  = new RedirectAction("/", true);
            IRewriteContext context = new MockRewriteContext();

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

            // Assert
            Assert.IsTrue(match);
        }
Пример #2
0
        public void IsMatch_WhenMixedConditions_ReturnsFalse()
        {
            // Arrange
            RedirectAction action = new RedirectAction("/", true);
            IRewriteContext context = new MockRewriteContext();
            action.Conditions.Add(new MockRewriteCondition(true));
            action.Conditions.Add(new MockRewriteCondition(false));

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

            // Assert
            Assert.IsFalse(match);
        }
Пример #3
0
        public void IsMatch_WhenSingleConditionDoesNotMatch_ReturnsFalse()
        {
            // Arrange
            RedirectAction  action  = new RedirectAction("/", true);
            IRewriteContext context = new MockRewriteContext();

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

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

            // Assert
            Assert.IsFalse(match);
        }
Пример #4
0
        public void IsMatch_WhenNoConditions_ReturnsTrue()
        {
            // Arrange
            RedirectAction action = new RedirectAction("/", true);
            IRewriteContext context = new MockRewriteContext();

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

            // Assert
            Assert.IsTrue(match);
        }