Permalink
Browse files

added a new test for a common QSA problem

  • Loading branch information...
nberardi committed Jan 17, 2011
1 parent 9ef547a commit b058ca8fced7b079fd89c25242f6d279b889a8c5
Showing with 20 additions and 1 deletion.
  1. +20 −1 test/ManagedFusion.Rewriter.Tests/CommonProblemTest.cs
@@ -28,5 +28,24 @@ public void VariableDoubleProcessingNotAllowed()
Assert.AreEqual(expected, result);
}
+
+ [Test]
+ public void AddQueryStringParameterOnToUrlThatContainsQueryString()
+ {
+ var target = CreateRuleSet(@"
+RewriteRule ^/(.*)$ /$1?test=added [QSA]");
+
+ var url = new Uri("http://somesite.com/pass?test=1&test=2&test=3");
+ var context = HttpHelpers.MockHttpContext(url);
+ context.Request.SetServerVariables(new Dictionary<string,string> {
+ { "QUERY_STRING", "test=1&test=2&test=3" },
+ { "HTTP_HOST", "somesite.com" }
+ });
+
+ Uri expected = new Uri("http://somesite.com/pass?test=added&test=1&test=2&test=3");
+ Uri result = target.RunRules(context, url);
+
+ Assert.AreEqual(expected, result);
+ }
}
-}
+}

0 comments on commit b058ca8

Please sign in to comment.