public void ApplyTo_ReturnsNonMatch_IfRuleDoesNotMatch()
        {
            var rule   = new RegexRule("apple", "banana", false, 1, true, true, true);
            var result = rule.ApplyTo("cthulu");

            Assert.IsFalse(result.IsMatch);
        }
        public void ApplyTo_ReturnsCorrectResult_ForComplicatedRule(string input, string expectedOutput)
        {
            var rule   = new RegexRule("(.*)/social/rest/([^/]*)/.*", "$1/social/rest/$2/*", false, 0, false, false, false);
            var output = rule.ApplyTo(input).Replacement;

            Assert.AreEqual(expectedOutput, output);
        }
        public void ApplyTo_ReturnsCorrectResult_ForIgnoreRule()
        {
            var rule = new RegexRule("/test/.*", null, true, 0, false, false, false);

            var result = rule.ApplyTo("WebTransaction/NormalizedUri/test/ignore");

            Assert.IsTrue(result.IsMatch);
            Assert.IsNull(result.Replacement);
        }
        public void ApplyTo_ReturnsCorrectResult_ForJadeRule()
        {
            var rule = new RegexRule("/Fixture/[^/]*/id/\\*/tabid/\\*/Default\\.aspx$", "/Fixture/*/id/*/tabid/*/Default.aspx", false, 0, false, false, false);

            Assert.AreEqual("WebTransaction/NormalizedUri/Fixture/*/id/*/tabid/*/Default.aspx", rule.ApplyTo("WebTransaction/NormalizedUri/Fixture/BluesVsStormers/id/*/tabid/*/Default.aspx").Replacement);
        }
        public void ApplyTo_ReturnsCorrectResult_ForBackreferencedRule()
        {
            var rule = new RegexRule("/test/(.*)/(.*)", "/blah/$2/$1", false, 0, false, false, false);

            Assert.AreEqual("WebTransaction/NormalizedUri/blah/ohman/ohdude", rule.ApplyTo("WebTransaction/NormalizedUri/test/ohdude/ohman").Replacement);
        }
        public void ApplyTo_ReturnsCorrectResult_ForSimpleRule()
        {
            var rule = new RegexRule("/test/.*", "/test", false, 0, false, false, false);

            Assert.AreEqual("WebTransaction/NormalizedUri/test", rule.ApplyTo("WebTransaction/NormalizedUri/test/ohdude").Replacement);
        }