Url from variable test added

This commit is contained in:
Paul Grimshaw 2016-09-19 12:32:46 +01:00
parent bed6302ea8
commit b5e7aceaa6
1 changed files with 11 additions and 0 deletions

View File

@ -1476,6 +1476,17 @@ Odd
Assert.AreEqual(expected, actual, "Value field didn't work"); Assert.AreEqual(expected, actual, "Value field didn't work");
} }
[TestMethod]
public void TestCompile_UrlEncodeParam() {
FormatCompiler compiler = new FormatCompiler();
const string format = @"{{#urlencode}}{{url}}{{/urlencode}}";
Generator generator = compiler.Compile(format);
string actual = generator.Render(new {url="https://google.com" });
string expected = "https%3a%2f%2fgoogle.com";
Assert.AreEqual(expected, actual, "Value field didn't work");
}
[TestMethod] [TestMethod]
public void TestCompile_UrlDecode() { public void TestCompile_UrlDecode() {
FormatCompiler compiler = new FormatCompiler(); FormatCompiler compiler = new FormatCompiler();